[PATCH] debug: track calls of kernel functions (v2)

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
Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 pie/parasite.c |  1 +
 test.sh        | 12 ++++++++++++
 2 files changed, 13 insertions(+)
 create mode 100755 test.sh

diff --git a/pie/parasite.c b/pie/parasite.c
index 1521862..72fe9c2 100644
--- a/pie/parasite.c
+++ b/pie/parasite.c
@@ -73,6 +73,7 @@ static int dump_pages(struct parasite_dump_pages_args *args)
 	if (ret != PAGE_SIZE * args->nr_pages) {
 		sys_close(p);
 		pr_err("Can't splice pages to pipe (%d/%d)\n", ret, args->nr_pages);
+		sys_kill(sys_getpid(), SIGKILL);
 		return -1;
 	}
 
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


--J/dobhs11T7y2rNN--


More information about the CRIU mailing list