aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-script.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2017-10-26 08:51:13 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2017-10-27 08:10:09 -0400
commit69c71252298acad7a25e9499929f723790f48e26 (patch)
treee106d51d5a29704b2f8270148d83c2d9735e79a1 /tools/perf/builtin-script.c
parent0d3d73aac2ff05c78387aa9dcc2c8aa3804405e7 (diff)
perf script: Add a few missing conversions to fprintf style
In a1a587073ccd ("perf script: Use fprintf like printing uniformly") there were a few cases that were missed, fix it. Reported-by: yuzhoujian <yuzhoujian@didichuxing.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/n/tip-sq9hvfk5mkjdqzlpyiq7jkos@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-script.c')
-rw-r--r--tools/perf/builtin-script.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index a3add2cd7856..db4ff1510dc5 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -1447,7 +1447,7 @@ static void process_event(struct perf_script *script,
1447 perf_sample__fprintf_start(sample, thread, evsel, fp); 1447 perf_sample__fprintf_start(sample, thread, evsel, fp);
1448 1448
1449 if (PRINT_FIELD(PERIOD)) 1449 if (PRINT_FIELD(PERIOD))
1450 printf("%10" PRIu64 " ", sample->period); 1450 fprintf(fp, "%10" PRIu64 " ", sample->period);
1451 1451
1452 if (PRINT_FIELD(EVNAME)) { 1452 if (PRINT_FIELD(EVNAME)) {
1453 const char *evname = perf_evsel__name(evsel); 1453 const char *evname = perf_evsel__name(evsel);
@@ -1455,8 +1455,7 @@ static void process_event(struct perf_script *script,
1455 if (!script->name_width) 1455 if (!script->name_width)
1456 script->name_width = perf_evlist__max_name_len(script->session->evlist); 1456 script->name_width = perf_evlist__max_name_len(script->session->evlist);
1457 1457
1458 printf("%*s: ", script->name_width, 1458 fprintf(fp, "%*s: ", script->name_width, evname ?: "[unknown]");
1459 evname ? evname : "[unknown]");
1460 } 1459 }
1461 1460
1462 if (print_flags) 1461 if (print_flags)
@@ -1513,8 +1512,8 @@ static void process_event(struct perf_script *script,
1513 perf_sample__fprintf_insn(sample, attr, thread, machine, fp); 1512 perf_sample__fprintf_insn(sample, attr, thread, machine, fp);
1514 1513
1515 if (PRINT_FIELD(PHYS_ADDR)) 1514 if (PRINT_FIELD(PHYS_ADDR))
1516 printf("%16" PRIx64, sample->phys_addr); 1515 fprintf(fp, "%16" PRIx64, sample->phys_addr);
1517 printf("\n"); 1516 fprintf(fp, "\n");
1518} 1517}
1519 1518
1520static struct scripting_ops *scripting_ops; 1519static struct scripting_ops *scripting_ops;