[PATCH] debug: track calls of kernel functions (v3)
Andrey Vagin
avagin at openvz.org
Wed May 7 06:46:21 PDT 2014
Pls, execute ./test.sh PID and send /mnt/mydata/dump/trace.log to us.
v2: don't clear buffer
v3: don't kill the target process
Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
mem.c | 5 ++++-
test.sh | 12 ++++++++++++
2 files changed, 16 insertions(+), 1 deletion(-)
create mode 100755 test.sh
diff --git a/mem.c b/mem.c
index 570de57..3cb0363 100644
--- a/mem.c
+++ b/mem.c
@@ -342,8 +342,11 @@ int parasite_dump_pages_seized(struct parasite_ctl *ctl,
}
ret = __parasite_dump_pages_seized(ctl, pargs, vma_area_list, pp);
- if (ret)
+ if (ret) {
pr_err("Can't dump page with parasite\n");
+ while (1)
+ sleep(1000);
+ }
pargs->add_prot = 0;
if (parasite_execute_daemon(PARASITE_CMD_MPROTECT_VMAS, ctl)) {
diff --git a/test.sh b/test.sh
new file mode 100755
index 0000000..103531e
--- /dev/null
+++ b/test.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+set -x
+pid=$1
+mkdir /tmp/debug
+mount -t debugfs debug /tmp/debug/
+echo $pid > /tmp/debug/tracing/set_ftrace_pid &&
+echo function > /tmp/debug/tracing/current_tracer &&
+echo 0 > /tmp/debug/tracing/tracing_on &&
+echo 1 > /tmp/debug/tracing/tracing_on || exit 1
+./criu dump --tree $pid --shell-job --images-dir /mnt/mydata/dump
+echo 0 > /tmp/debug/tracing/tracing_on &&
+cat /tmp/debug/tracing/trace_pipe > /mnt/mydata/dump/trace.log || exit 1
--
1.8.5.3
--EeQfGwPcQSOJBaQU--
More information about the CRIU
mailing list