diff options
Diffstat (limited to 'tools/perf/util/top.c')
-rw-r--r-- | tools/perf/util/top.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/tools/perf/util/top.c b/tools/perf/util/top.c index 7eeebcee291c..884dde9b9bc1 100644 --- a/tools/perf/util/top.c +++ b/tools/perf/util/top.c | |||
@@ -58,8 +58,7 @@ size_t perf_top__header_snprintf(struct perf_top *top, char *bf, size_t size) | |||
58 | } | 58 | } |
59 | 59 | ||
60 | if (top->evlist->nr_entries == 1) { | 60 | if (top->evlist->nr_entries == 1) { |
61 | struct perf_evsel *first; | 61 | struct perf_evsel *first = perf_evlist__first(top->evlist); |
62 | first = list_entry(top->evlist->entries.next, struct perf_evsel, node); | ||
63 | ret += SNPRINTF(bf + ret, size - ret, "%" PRIu64 "%s ", | 62 | ret += SNPRINTF(bf + ret, size - ret, "%" PRIu64 "%s ", |
64 | (uint64_t)first->attr.sample_period, | 63 | (uint64_t)first->attr.sample_period, |
65 | top->freq ? "Hz" : ""); | 64 | top->freq ? "Hz" : ""); |