1. 01 Jun, 2013 2 commits
  2. 31 May, 2013 11 commits
  3. 30 May, 2013 6 commits
  4. 29 May, 2013 1 commit
  5. 28 May, 2013 4 commits
  6. 27 May, 2013 9 commits
  7. 24 May, 2013 7 commits
    • Andrey Vagin's avatar
      a845d5fa
    • Andrey Vagin's avatar
      parasite: Restore parasite state via rt_sigreturn · 0bc16263
      Andrey Vagin authored
      This patch reduces a window, when a crtools can kill a dumped process,
      because if a parasite in a deamon mode can restore the state of the
      process, if crtools detached unexpectedly.
      
      All threads are synchronized on the _exit_ point from sys_rt_sigreturn,
      for that crtools traces all syscalls. After that we remove the parasite
      blob from dumpee as we did it previously and let the process run further.
      Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
      Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
      0bc16263
    • Andrey Vagin's avatar
      dump: Reseve space and construc sigframes for parasites · 8d0e2965
      Andrey Vagin authored
      We're about to implement functionality to allow parasite to
      return to dumpee via sigreturn in case crtools suddenly detached
      from it. Thus, we need a space for sigframe in shared area.
      Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
      Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
      8d0e2965
    • Andrey Vagin's avatar
      dump: Return signal mask from parasite on initialization · 75a3932b
      Andrey Vagin authored
      This mask should be put into sigframe (used by parasite, coming
      soon) thus we have to pull one from dumpee early.
      
      Plus, check that signals are blocked for each thread separately
      Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
      Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
      75a3932b
    • Andrey Vagin's avatar
      parasite: Switch parasite to daemon mode (v2) · 595b772a
      Andrey Vagin authored
      Parasite daemon mode it quite tricky. One may consider
      it as consisting of two parts
      
       - daemon mode for thread leader
       - daemon mode for regular threads
      
      Thread leader daemon
      --------------------
      
      Once thread leader parasite code switched initialized,
      it starts spinning on socket listening for commands
      to handle.
      
      If the command destination is the thread leader itself it
      handles it and replies back the ack to the caller (iow
      the main crtools code).
      
      If the recepient is not thread leader but one of threads,
      then thread leader wakes up the thread by futex and makes
      it to handle the command waiting on futex for result. Once
      result obtained, the ack is being sending back to caller.
      
      Thread daemon
      -------------
      
      On initialization thread daemon starts waiting a command on futex.
      The futex is triggered by thread leader daemon when command received.
      Once command is received and handled, the result is reported back to
      the thread leader daemon, which in turn send ack message.
      
      Both thread-leader and regular threads require own stack to operate
      on since they all are present in memory simultaneously. Thus we use
      call_daemon_thread() helper which takes care of providing stack
      to the callee.
      
      TODO:
      
       - ARM requires own wrappers on damonize/trap low-level code,
         at moment x86-64 is only covered
      
      v2: remove PARASITE_CMD_DAEMONIZED and s->ack
          parasite: use a propper command for getting ack
      Fixed-by: 's avatarAndrey Vagin <avagin@openvz.org>
      Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
      Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
      Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
      595b772a
    • Cyrill Gorcunov's avatar
      git: Drop include/config.h from monitoring · 86d4c1ed
      Cyrill Gorcunov authored
      It's autogenerated file.
      Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
      Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
      86d4c1ed
    • Cyrill Gorcunov's avatar
      parasite: Prepare structures for daemon mode · 24864ae7
      Cyrill Gorcunov authored
      Parasite daemon mode might be considered as a series
      of network messages sent from main crtools module to
      parasite daemon which spins on a socket waiting for
      command to handle.
      
      Simple command handling session might look as
      
              crtools                     daemon
              |                           |                           |
              | ---> command message ---> |                           |
              |                           | ---> receive command ---> |
              |                           |           ....            |
              |                           |       handle command      |
              |                           |           ....            |
              |                           | <--- send ack       <---  |
              | <--- receive ack     <--- |                           |
              |                           |                           |
              v                           v                           v
            time
      
      where, in case of multithread application [handle command] stage
      includes waking up of children threads via futexes, wait until
      handling complete and only then send ack back to ctrools module.
      
      This patch brings in description of command message as
      
      struct ctl_msg {
          unsigned int    id;     /* command recipient */
          unsigned int    cmd;    /* command itself */
          unsigned int    ack;    /* ack on command */
          int             err;    /* error code on reply */
      };
      
      For example, in case of dumpee being with pid 2 and acquiring
      to handle PARASITE_CMD_DUMP_MISC, the command/ack series will look
      as
      
          cmd-msg
          -------
          .id     = 2,
          .cmd    = PARASITE_CMD_DUMP_MISC,
          .ack    = 0,
          .err    = 0,
      
          ack-msg
          -------
          .id     = 2,
          .cmd    = PARASITE_CMD_DUMP_MISC,
          .ack    = PARASITE_CMD_DUMP_MISC,
          .err    = 0
      
      in case if error happened in parasite, the @err field set accordingly.
      
      For convenience ctl_msg_cmd()/ctl_msg_ack() macros are provided
      for control message generations.
      
      v2: delete futex_t ack from tid_state_s
      Fixed-by: 's avatarAndrew Vagin <avagin@openvz.org>
      Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
      Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
      Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
      24864ae7