aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace
diff options
context:
space:
mode:
authorLi Zefan <lizf@cn.fujitsu.com>2009-04-22 04:53:34 -0400
committerIngo Molnar <mingo@elte.hu>2009-04-22 05:36:38 -0400
commit7a4f453b6d7379a7c380825949977c5a838aa012 (patch)
tree9f5450c7a1abc865b998885affe964d4670a08bc /kernel/trace
parent3554228d4289098a8fe5cfd87512ec32a19bbe5a (diff)
tracing/events: make struct trace_entry->type to be int type
struct trace_entry->type is unsigned char, while trace event's id is int type, thus for a event with id >= 256, it's entry->type is cast to (id % 256), and then we can't see the trace output of this event. # insmod trace-events-sample.ko # echo foo_bar > /mnt/tracing/set_event # cat /debug/tracing/events/trace-events-sample/foo_bar/id 256 # cat /mnt/tracing/trace_pipe <...>-3548 [001] 215.091142: Unknown type 0 <...>-3548 [001] 216.089207: Unknown type 0 <...>-3548 [001] 217.087271: Unknown type 0 <...>-3548 [001] 218.085332: Unknown type 0 [ Impact: fix output for trace events with id >= 256 ] Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Acked-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Tom Zanussi <tzanussi@gmail.com> LKML-Reference: <49EEDB0E.5070207@cn.fujitsu.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/trace')
-rw-r--r--kernel/trace/trace.c4
-rw-r--r--kernel/trace/trace.h2
-rw-r--r--kernel/trace/trace_events.c2
3 files changed, 4 insertions, 4 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index b9a3adce9221..b6183bc9ecae 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -838,7 +838,7 @@ tracing_generic_entry_update(struct trace_entry *entry, unsigned long flags,
838} 838}
839 839
840struct ring_buffer_event *trace_buffer_lock_reserve(struct trace_array *tr, 840struct ring_buffer_event *trace_buffer_lock_reserve(struct trace_array *tr,
841 unsigned char type, 841 int type,
842 unsigned long len, 842 unsigned long len,
843 unsigned long flags, int pc) 843 unsigned long flags, int pc)
844{ 844{
@@ -881,7 +881,7 @@ void trace_buffer_unlock_commit(struct trace_array *tr,
881} 881}
882 882
883struct ring_buffer_event * 883struct ring_buffer_event *
884trace_current_buffer_lock_reserve(unsigned char type, unsigned long len, 884trace_current_buffer_lock_reserve(int type, unsigned long len,
885 unsigned long flags, int pc) 885 unsigned long flags, int pc)
886{ 886{
887 return trace_buffer_lock_reserve(&global_trace, 887 return trace_buffer_lock_reserve(&global_trace,
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index 247948e81b08..7d55bcf50e49 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -422,7 +422,7 @@ void init_tracer_sysprof_debugfs(struct dentry *d_tracer);
422struct ring_buffer_event; 422struct ring_buffer_event;
423 423
424struct ring_buffer_event *trace_buffer_lock_reserve(struct trace_array *tr, 424struct ring_buffer_event *trace_buffer_lock_reserve(struct trace_array *tr,
425 unsigned char type, 425 int type,
426 unsigned long len, 426 unsigned long len,
427 unsigned long flags, 427 unsigned long flags,
428 int pc); 428 int pc);
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index 9ea55a7dfdec..5d6e879cf875 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -398,7 +398,7 @@ static int trace_write_header(struct trace_seq *s)
398 "\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n" 398 "\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n"
399 "\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n" 399 "\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n"
400 "\n", 400 "\n",
401 FIELD(unsigned char, type), 401 FIELD(int, type),
402 FIELD(unsigned char, flags), 402 FIELD(unsigned char, flags),
403 FIELD(unsigned char, preempt_count), 403 FIELD(unsigned char, preempt_count),
404 FIELD(int, pid), 404 FIELD(int, pid),