[CRIU] [PATCH 28/44] cr-dump.c: implemented TLS dumping.
Alexander Kartashov
alekskartashov at parallels.com
Mon Jan 7 10:04:57 EST 2013
Signed-off-by: Alexander Kartashov <alekskartashov at parallels.com>
---
cr-dump.c | 5 ++++-
include/parasite-syscall.h | 2 +-
parasite-syscall.c | 5 ++++-
3 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/cr-dump.c b/cr-dump.c
index 668859c..c14bd21 100644
--- a/cr-dump.c
+++ b/cr-dump.c
@@ -1152,6 +1152,7 @@ static int dump_task_thread(struct parasite_ctl *parasite_ctl, struct pid *tid)
int ret = -1, fd_core;
unsigned int *taddr;
pid_t pid = tid->real;
+ u32 tls;
pr_info("\n");
pr_info("Dumping core for thread (pid: %d)\n", pid);
@@ -1170,7 +1171,9 @@ static int dump_task_thread(struct parasite_ctl *parasite_ctl, struct pid *tid)
goto err_free;
ret = parasite_dump_thread_seized(parasite_ctl, pid, &taddr,
- &tid->virt, &core->thread_core->blk_sigset);
+ &tid->virt, &core->thread_core->blk_sigset,
+ &tls);
+
if (ret) {
pr_err("Can't dump thread for pid %d\n", pid);
goto err_free;
diff --git a/include/parasite-syscall.h b/include/parasite-syscall.h
index cccd678..2317a5e 100644
--- a/include/parasite-syscall.h
+++ b/include/parasite-syscall.h
@@ -38,7 +38,7 @@ extern int parasite_dump_pages_seized(struct parasite_ctl *ctl,
struct parasite_dump_thread;
extern int parasite_dump_thread_seized(struct parasite_ctl *ctl, pid_t pid,
unsigned int **tid_add, pid_t *tid,
- void *blocked);
+ void *blocked, u32 *tls);
struct parasite_drain_fd;
struct fd_opts;
diff --git a/parasite-syscall.c b/parasite-syscall.c
index 3a68027..6db9422 100644
--- a/parasite-syscall.c
+++ b/parasite-syscall.c
@@ -1,4 +1,5 @@
#include <unistd.h>
+#include <inttypes.h>
#include <sys/stat.h>
#include <sys/wait.h>
@@ -364,7 +365,8 @@ err:
int parasite_dump_thread_seized(struct parasite_ctl *ctl, pid_t pid,
unsigned int **tid_addr, pid_t *tid,
- void *blocked)
+ void *blocked,
+ u32 *tls)
{
struct parasite_dump_thread *args;
int ret;
@@ -376,6 +378,7 @@ int parasite_dump_thread_seized(struct parasite_ctl *ctl, pid_t pid,
memcpy(blocked, &args->blocked, sizeof(args->blocked));
*tid_addr = args->tid_addr;
*tid = args->tid;
+ *tls = args->tls;
return ret;
}
--
1.7.10.4
More information about the CRIU
mailing list