Skip to contentSkip to conversation

tracing/events: fix a typo in __string() format output

PATCH In review Li Zefan 2 participants 3 messages May 29, 2009 – May 31, 2009

Subsystems (2)
lore
Share & tools
lore

Li Zefan

author
#0 lore raw

PATCH 1/1 tracing/events: fix a typo in __string() format output

It should be '\t'. Also remove the space before "__str_loc".

Before:

 # cat tracing/events/irq/irq_handler_entry/format
        ...
        field:int irq;  offset:12;      size:4;
        field: __str_loc name;  offset:16;tsize:2;
        ...

After:

 # cat tracing/events/irq/irq_handler_entry/format
	...
        field:int irq;  offset:12;      size:4;
        field:__str_loc name;   offset:16;      size:2;
	...

[ Impact: fix the output of __string field in format file ]

---
 include/trace/ftrace.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
include/trace/ftrace.h +2 -2
index edb02bc..006af4c 100644
@@ -187,8 +187,8 @@ ftrace_raw_output_##call(struct trace_iterator *iter, int flags)	\
 
 #undef __string
 #define __string(item, src)						       \
-	ret = trace_seq_printf(s, "\tfield: __str_loc " #item ";\t"	       \
-			       "offset:%u;tsize:%u;\n",			       \
+	ret = trace_seq_printf(s, "\tfield:__str_loc " #item ";\t"	       \
+			       "offset:%u;\tsize:%u;\n",		       \
 			       (unsigned int)offsetof(typeof(field),	       \
 					__str_loc_##item),		       \
 			       (unsigned int)sizeof(field.__str_loc_##item));  \
Signature · 1 line
1.5.4.rc3
author
#1 lore raw

ping..

Could someone apply this patch? I have a patchset, that introduces __dynamic_array(), based on this fix.

Or I will include this fix in the patchset.

Quoted 38 lines · Li Zefan

It should be '\t'. Also remove the space before "__str_loc".

Before:

 # cat tracing/events/irq/irq_handler_entry/format
        ...
        field:int irq;  offset:12;      size:4;
        field: __str_loc name;  offset:16;tsize:2;
        ...

After:

 # cat tracing/events/irq/irq_handler_entry/format
	...
        field:int irq;  offset:12;      size:4;
        field:__str_loc name;   offset:16;      size:2;
	...

[ Impact: fix the output of __string field in format file ]

---
 include/trace/ftrace.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
include/trace/ftrace.h +2 -2
index edb02bc..006af4c 100644
@@ -187,8 +187,8 @@ ftrace_raw_output_##call(struct trace_iterator *iter, int flags)	\
 
 #undef __string
 #define __string(item, src)						       \
-	ret = trace_seq_printf(s, "\tfield: __str_loc " #item ";\t"	       \
-			       "offset:%u;tsize:%u;\n",			       \
+	ret = trace_seq_printf(s, "\tfield:__str_loc " #item ";\t"	       \
+			       "offset:%u;\tsize:%u;\n",		       \
 			       (unsigned int)offsetof(typeof(field),	       \
 					__str_loc_##item),		       \
 			       (unsigned int)sizeof(field.__str_loc_##item));  \
#2 lore raw
Quoted 4 lines · Li Zefan

ping..

Could someone apply this patch? I have a patchset, that introduces __dynamic_array(), based on this fix.

I've applied it on
git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing.git tracing/core

Since we have doubts on the strncmp -> strcmp conversion for static string arrays. Do you think you could cut your strcmp patch in two parts:

1) fix strncmp use in __string() filters (which drops strncmp for dyn strings)
2) convert static string comparison to use strcmp()

So that I can integrate the fix from 1) and submit it to Ingo with the fix for __str_loc format I just applied.

And then we can review 2) more carefully.

Thanks,
Frederic.

Quoted 42 lines

Or I will include this fix in the patchset.

Quoted 38 lines · Li Zefan

It should be '\t'. Also remove the space before "__str_loc".

Before:

 # cat tracing/events/irq/irq_handler_entry/format
        ...
        field:int irq;  offset:12;      size:4;
        field: __str_loc name;  offset:16;tsize:2;
        ...

After:

 # cat tracing/events/irq/irq_handler_entry/format
	...
        field:int irq;  offset:12;      size:4;
        field:__str_loc name;   offset:16;      size:2;
	...

[ Impact: fix the output of __string field in format file ]

---
 include/trace/ftrace.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
include/trace/ftrace.h +2 -2
index edb02bc..006af4c 100644
@@ -187,8 +187,8 @@ ftrace_raw_output_##call(struct trace_iterator *iter, int flags)	\
 
 #undef __string
 #define __string(item, src)						       \
-	ret = trace_seq_printf(s, "\tfield: __str_loc " #item ";\t"	       \
-			       "offset:%u;tsize:%u;\n",			       \
+	ret = trace_seq_printf(s, "\tfield:__str_loc " #item ";\t"	       \
+			       "offset:%u;\tsize:%u;\n",		       \
 			       (unsigned int)offsetof(typeof(field),	       \
 					__str_loc_##item),		       \
 			       (unsigned int)sizeof(field.__str_loc_##item));  \