Skip to contentSkip to conversation

trace_kprobe: shows signs of fields in format files

PATCH In review Lai Jiangshan 2 participants 2 messages Dec 9, 2009 Tracing

lore
Share & tools
lore
#0 lore raw

PATCH 1/10 trace_kprobe: shows signs of fields in format files

format files of trace_kprobe don't shows signs, it is different from all other format files, incorrect API to user.

---

kernel/trace/trace_kprobe.c +4 -3
index e3c80e9..3ef66d4 100644
@@ -1163,10 +1163,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)
Acked-by on v1 1/10
#1 lore raw
Quoted 5 lines · Lai Jiangshan

format files of trace_kprobe don't shows signs, it is different from all other format files, incorrect API to user.

Thanks Lai!

Quoted 23 lines

---

kernel/trace/trace_kprobe.c +4 -3
index e3c80e9..3ef66d4 100644
@@ -1163,10 +1163,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 · 7 lines
Masami Hiramatsu

Software Engineer
Hitachi Computer Products (America), Inc.
Software Solutions Division

e-mail: [email protected]