perf tools: Fix missing string field printing in perf trace
authorFrederic Weisbecker <fweisbec@gmail.com>
Fri, 28 Aug 2009 02:46:07 +0000 (04:46 +0200)
committerIngo Molnar <mingo@elte.hu>
Fri, 28 Aug 2009 05:58:11 +0000 (07:58 +0200)
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@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
LKML-Reference: <1251427567-10551-2-git-send-email-fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
tools/perf/util/trace-event-parse.c

index a6577cdd9afd138d24ee27bc5d01a8878f329657..96c5e97ffe7bdb782f96b7964a9ca349bc79cd5d 100644 (file)
@@ -1997,6 +1997,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: