[CRIU] [PATCH 1/3] dump: dump tid_addr_clear for thread leaders
Andrey Vagin
avagin at openvz.org
Wed Jul 10 09:42:02 EDT 2013
Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
cr-dump.c | 1 +
include/parasite.h | 1 +
pie/parasite.c | 6 +++++-
3 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/cr-dump.c b/cr-dump.c
index 003724b..d0167c2 100644
--- a/cr-dump.c
+++ b/cr-dump.c
@@ -664,6 +664,7 @@ static int dump_task_core_all(struct parasite_ctl *ctl,
goto err;
core_put_tls(core, misc->tls);
+ CORE_THREAD_ARCH_INFO(core)->clear_tid_addr = encode_pointer(misc->tid_addr);
ret = pb_write_one(fd_core, core, PB_CORE);
if (ret < 0)
diff --git a/include/parasite.h b/include/parasite.h
index fe25299..6011b55 100644
--- a/include/parasite.h
+++ b/include/parasite.h
@@ -142,6 +142,7 @@ static inline int posix_timers_dump_size(int timer_n)
struct parasite_dump_misc {
unsigned long brk;
+ unsigned int *tid_addr;
u32 pid;
u32 sid;
diff --git a/pie/parasite.c b/pie/parasite.c
index 4f6708f..6778c70 100644
--- a/pie/parasite.c
+++ b/pie/parasite.c
@@ -138,6 +138,8 @@ static int dump_posix_timers(struct parasite_dump_posix_timers_args *args)
static int dump_misc(struct parasite_dump_misc *args)
{
+ int ret;
+
args->brk = sys_brk(0);
args->pid = sys_getpid();
@@ -147,7 +149,9 @@ static int dump_misc(struct parasite_dump_misc *args)
args->umask = sys_umask(0);
sys_umask(args->umask); /* never fails */
- return 0;
+ ret = sys_prctl(PR_GET_TID_ADDRESS, (unsigned long) &args->tid_addr, 0, 0, 0);
+
+ return ret;
}
static int dump_creds(struct parasite_dump_creds *args)
--
1.8.3.1
More information about the CRIU
mailing list