[PATCH] debug: track calls of kernel functions

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.

Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 pie/parasite.c |  1 +
 test.sh        | 13 +++++++++++++
 2 files changed, 14 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..b6742db
--- /dev/null
+++ b/test.sh
@@ -0,0 +1,13 @@
+#!/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 &&
+cat /tmp/debug/tracing/trace_pipe > /dev/null &&
+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


--tKW2IUtsqtDRztdT--


More information about the CRIU mailing list