Skip to contentSkip to conversation

tracing: various fixes

GIT PULL New Steven Rostedt 2 participants 5 messages Dec 30, 2009

Subsystems (3)
lore
Share & tools
lore
author maintainer
#1 lore raw

PATCH 1/3 tracing/kprobe: Show sign of fields in trace_kprobe format files

In reply to Steven Rostedt

From: Lai Jiangshan <[email protected]>

The format files of trace_kprobe do not show the sign of the fields. The other format files show the field signed type of the fields and this patch makes the trace_kprobe formats consistent with the others.

LKML-Reference: <[email protected]>

---
 kernel/trace/trace_kprobe.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
kernel/trace/trace_kprobe.c +4 -3
index 7ecab06..83f1e6e 100644
@@ -1182,10 +1182,11 @@ static int __probe_event_show_format(struct trace_seq *s,
 #undef SHOW_FIELD
 #define SHOW_FIELD(type, item, name)					\
 	do {								\
-		ret = trace_seq_printf(s, "\tfield: " #type " %s;\t"	\
-				"offset:%u;\tsize:%u;\n", name,		\
+		ret = trace_seq_printf(s, "\tfield:" #type " %s;\t"	\
+				"offset:%u;\tsize:%u;\tsigned:%d;\n", name,\
 				(unsigned int)offsetof(typeof(field), item),\
-				(unsigned int)sizeof(type));		\
+				(unsigned int)sizeof(type),		\
+				is_signed_type(type));			\
 		if (!ret)						\
 			return 0;					\
 	} while (0)
Signature · 1 line
1.6.5

Steven Rostedt

author maintainer
#0 lore raw

Ingo,

The previous pull request was a bit too much for 33-rc. I pulled out the three patches that are fixes that should definitely be in 33, and I'll save the conversion to print_fmt for 34.

When these changes are in 33-rc, I'll send out another pull request based on that 33-rc with the rest of the changes. That pull request will be for 34.

Please pull the latest tip/tracing/urgent tree, which can be found at:

git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git
tip/tracing/urgent

Lai Jiangshan (3):
tracing/kprobe: Show sign of fields in trace_kprobe format files tracing/syscalls: Fix typo in SYSCALL_DEFINE0
tracing: Fix sign fields in ftrace_define_fields_##call()

----

 include/linux/syscalls.h    |    2 +-
 include/trace/ftrace.h      |    7 ++++---
 kernel/trace/trace_export.c |    7 ++++---
 kernel/trace/trace_kprobe.c |    7 ++++---
 4 files changed, 13 insertions(+), 10 deletions(-)
author maintainer
#2 lore raw

PATCH 2/3 tracing/syscalls: Fix typo in SYSCALL_DEFINE0

From: Lai Jiangshan <[email protected]>

The struct syscall_metadata variable name in SYSCALL_DEFINE0 should be __syscall_meta__##sname instead of __syscall_meta_##sname to match the name that is in SYSCALL_DEFINE1/2/3/4/5/6.

This error causes event_enter_##sname->data to point to the wrong location, which causes syscalls which are defined by SYSCALL_DEFINE0() not to be traced.

LKML-Reference: <[email protected]>

---
 include/linux/syscalls.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
include/linux/syscalls.h +1 -1
index 65793e9..207466a 100644
@@ -195,7 +195,7 @@ struct perf_event_attr;
 	static const struct syscall_metadata __used		\
 	  __attribute__((__aligned__(4)))			\
 	  __attribute__((section("__syscalls_metadata")))	\
-	  __syscall_meta_##sname = {				\
+	  __syscall_meta__##sname = {				\
 		.name 		= "sys_"#sname,			\
 		.nb_args 	= 0,				\
 		.enter_event	= &event_enter__##sname,	\
Signature · 1 line
1.6.5
author maintainer
#3 lore raw

PATCH 3/3 tracing: Fix sign fields in ftrace_define_fields_##call()

In reply to Steven Rostedt

From: Lai Jiangshan <[email protected]>

Add is_signed_type() call to trace_define_field() in ftrace macros.

The code previously just passed in 0 (false), disregarding whether or not the field was actually a signed type.

LKML-Reference: <[email protected]>

---
 include/trace/ftrace.h      |    7 ++++---
 kernel/trace/trace_export.c |    7 ++++---
 2 files changed, 8 insertions(+), 6 deletions(-)
include/trace/ftrace.h +4 -3
index 7352315..c6fe03e 100644
@@ -414,7 +414,8 @@ ftrace_raw_output_##call(struct trace_iterator *iter, int flags)	\
 	BUILD_BUG_ON(len > MAX_FILTER_STR_VAL);				\
 	ret = trace_define_field(event_call, #type "[" #len "]", #item,	\
 				 offsetof(typeof(field), item),		\
-				 sizeof(field.item), 0, FILTER_OTHER);	\
+				 sizeof(field.item),			\
+				 is_signed_type(type), FILTER_OTHER);	\
 	if (ret)							\
 		return ret;
 
@@ -422,8 +423,8 @@ ftrace_raw_output_##call(struct trace_iterator *iter, int flags)	\
 #define __dynamic_array(type, item, len)				       \
 	ret = trace_define_field(event_call, "__data_loc " #type "[]", #item,  \
 				 offsetof(typeof(field), __data_loc_##item),   \
-				 sizeof(field.__data_loc_##item), 0,	       \
-				 FILTER_OTHER);
+				 sizeof(field.__data_loc_##item),	       \
+				 is_signed_type(type), FILTER_OTHER);
 
 #undef __string
 #define __string(item, src) __dynamic_array(char, item, -1)
kernel/trace/trace_export.c +4 -3
index 458e5bf..d4fa5dc 100644
@@ -158,7 +158,8 @@ ftrace_format_##name(struct ftrace_event_call *unused,			\
 	BUILD_BUG_ON(len > MAX_FILTER_STR_VAL);				\
 	ret = trace_define_field(event_call, #type "[" #len "]", #item,	\
 				 offsetof(typeof(field), item),		\
-				 sizeof(field.item), 0, FILTER_OTHER);	\
+				 sizeof(field.item),			\
+				 is_signed_type(type), FILTER_OTHER);	\
 	if (ret)							\
 		return ret;
 
@@ -168,8 +169,8 @@ ftrace_format_##name(struct ftrace_event_call *unused,			\
 	ret = trace_define_field(event_call, #type "[" #len "]", #item,	\
 				 offsetof(typeof(field),		\
 					  container.item),		\
-				 sizeof(field.container.item), 0,	\
-				 FILTER_OTHER);				\
+				 sizeof(field.container.item),		\
+				 is_signed_type(type), FILTER_OTHER);	\
 	if (ret)							\
 		return ret;
 
Signature · 1 line
1.6.5
#4 lore raw
In reply to Steven Rostedt
Quoted 21 lines · Steven Rostedt

Ingo,

The previous pull request was a bit too much for 33-rc. I pulled out the three patches that are fixes that should definitely be in 33, and I'll save the conversion to print_fmt for 34.

When these changes are in 33-rc, I'll send out another pull request based on that 33-rc with the rest of the changes. That pull request will be for 34.

Please pull the latest tip/tracing/urgent tree, which can be found at:

git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git
tip/tracing/urgent

Lai Jiangshan (3):
tracing/kprobe: Show sign of fields in trace_kprobe format files tracing/syscalls: Fix typo in SYSCALL_DEFINE0
tracing: Fix sign fields in ftrace_define_fields_##call()

Quoted 6 lines

----

 include/linux/syscalls.h    |    2 +-
 include/trace/ftrace.h      |    7 ++++---
 kernel/trace/trace_export.c |    7 ++++---
 kernel/trace/trace_kprobe.c |    7 ++++---
 4 files changed, 13 insertions(+), 10 deletions(-)

Pulled, thanks a lot Steve!

Ingo