Skip to content

Commit

Permalink
perf evsel: perf_evsel__name(NULL) is valid, no need to check evsel
Browse files Browse the repository at this point in the history
It'll return "unknown", no need to open code it.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lkml.kernel.org/n/tip-4okvjmm18arjrcyfhuahgfxm@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
  • Loading branch information
Arnaldo Carvalho de Melo committed Jul 9, 2019
1 parent f3c8d90 commit fc50e0b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tools/perf/builtin-report.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ static int process_read_event(struct perf_tool *tool,
struct report *rep = container_of(tool, struct report, tool);

if (rep->show_threads) {
const char *name = evsel ? perf_evsel__name(evsel) : "unknown";
const char *name = perf_evsel__name(evsel);
int err = perf_read_values_add_value(&rep->show_threads_values,
event->read.pid, event->read.tid,
evsel->idx,
Expand Down
2 changes: 1 addition & 1 deletion tools/perf/util/session.c
Original file line number Diff line number Diff line change
Expand Up @@ -1246,7 +1246,7 @@ static void dump_read(struct perf_evsel *evsel, union perf_event *event)
return;

printf(": %d %d %s %" PRIu64 "\n", event->read.pid, event->read.tid,
evsel ? perf_evsel__name(evsel) : "FAIL",
perf_evsel__name(evsel),
event->read.value);

if (!evsel)
Expand Down

0 comments on commit fc50e0b

Please sign in to comment.