diff options
author | Mark Brown <broonie@kernel.org> | 2020-10-28 21:37:38 +0000 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2020-10-28 21:37:38 +0000 |
commit | f59cddd8517ab880fb09bf1465b07b337e058b22 (patch) | |
tree | b8ac2b4bd99f6b4860dd403bb39b2b7149ed06e0 /tools/perf/builtin-script.c | |
parent | 43c3e148830aae5469c411a2bf951d4fe7fcea29 (diff) | |
parent | 3650b228f83adda7e5ee532e2b90429c03f7b9ec (diff) |
Merge tag 'v5.10-rc1' into regulator-5.10
Linux 5.10-rc1
Diffstat (limited to 'tools/perf/builtin-script.c')
-rw-r--r-- | tools/perf/builtin-script.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index 484ce6067d23f..48588ccf902eb 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c @@ -702,12 +702,14 @@ static int perf_sample__fprintf_start(struct perf_script *script, char tstr[128]; if (PRINT_FIELD(COMM)) { + const char *comm = thread ? thread__comm_str(thread) : ":-1"; + if (latency_format) - printed += fprintf(fp, "%8.8s ", thread__comm_str(thread)); + printed += fprintf(fp, "%8.8s ", comm); else if (PRINT_FIELD(IP) && evsel__has_callchain(evsel) && symbol_conf.use_callchain) - printed += fprintf(fp, "%s ", thread__comm_str(thread)); + printed += fprintf(fp, "%s ", comm); else - printed += fprintf(fp, "%16s ", thread__comm_str(thread)); + printed += fprintf(fp, "%16s ", comm); } if (PRINT_FIELD(PID) && PRINT_FIELD(TID)) @@ -2238,7 +2240,7 @@ static int print_event_with_time(struct perf_tool *tool, if (tid != -1) thread = machine__findnew_thread(machine, pid, tid); - if (thread && evsel) { + if (evsel) { perf_sample__fprintf_start(script, sample, thread, evsel, event->header.type, stdout); } |