[CRIU] [RFC PATCHv2 27/32] zdtm: lib: include tid in debug messages

Ivan Shapovalov intelfx at intelfx.name
Sat Mar 12 00:42:26 PST 2016


Signed-off-by: Ivan Shapovalov <intelfx at intelfx.name>
---
 test/zdtm/lib/msg.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/test/zdtm/lib/msg.c b/test/zdtm/lib/msg.c
index 7b8d74d..757f063 100644
--- a/test/zdtm/lib/msg.c
+++ b/test/zdtm/lib/msg.c
@@ -8,9 +8,15 @@
 #include <linux/limits.h>
 #include <sys/time.h>
 #include <time.h>
+#include <sys/syscall.h>
 
 #include "zdtmtst.h"
 
+static long sys_gettid(void)
+{
+	return syscall(__NR_gettid);
+}
+
 int test_log_init(const char *fname, const char *suffix)
 {
 	char path[PATH_MAX];
@@ -58,6 +64,7 @@ void test_msg(const char *format, ...)
 
 	off += sprintf(buf + off, ".%.3ld: ", tv.tv_usec / 1000);
 	off += sprintf(buf + off, "%5d: ", getpid());
+	off += sprintf(buf + off, "tid %5d: ", sys_gettid());
 
 skip:
 	va_start(arg, format);
-- 
2.7.2



More information about the CRIU mailing list