[PATCH 2/2] perf tool: Fix missing string field printing in perf trace

From: Frederic Weisbecker
Date: Thu Aug 27 2009 - 22:46:20 EST


Some string fields are not printed because of a missing printf
in the post-processing.

Before:
perf-10070 [000] 0.000000: sched_switch: task :10070 [120] (R) ==> :5720 [120]
geany-5720 [000] 0.000000: sched_switch: task :5720 [120] (S) ==> :10070 [120]
perf-10070 [000] 0.000000: sched_switch: task :10070 [120] (R) ==> :5720 [120]
geany-5720 [000] 0.000000: sched_switch: task :5720 [120] (S) ==> :10070 [120]
<idle>-0 [000] 0.000000: sched_switch: task :0 [140] (R) ==> :361 [115]

After:
perf-10070 [000] 0.000000: sched_switch: task perf:10070 [120] (R) ==> geany:5720 [120]
geany-5720 [000] 0.000000: sched_switch: task geany:5720 [120] (S) ==> perf:10070 [120]
perf-10070 [000] 0.000000: sched_switch: task perf:10070 [120] (R) ==> geany:5720 [120]
geany-5720 [000] 0.000000: sched_switch: task geany:5720 [120] (S) ==> perf:10070 [120]
<idle>-0 [000] 0.000000: sched_switch: task swapper:0 [140] (R) ==> kondemand/1:361 [115]

Signed-off-by: Frederic Weisbecker <fweisbec@xxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
Cc: Steven Rostedt <rostedt@xxxxxxxxxxx>
---
tools/perf/util/trace-event-parse.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/perf/util/trace-event-parse.c b/tools/perf/util/trace-event-parse.c
index a2de650..769c405 100644
--- a/tools/perf/util/trace-event-parse.c
+++ b/tools/perf/util/trace-event-parse.c
@@ -1990,6 +1990,7 @@ static void print_str_arg(void *data, int size,
memcpy(str, data + arg->field.field->offset,
arg->field.field->size);
str[arg->field.field->size] = 0;
+ printf("%s", str);
free(str);
break;
case PRINT_FLAGS:
--
1.6.2.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/