diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-08-14 21:42:15 +0200 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-08-15 15:14:18 +0200 |
commit | 0c21f736e0a37c50f66ab248d2a52f711b28a4e4 (patch) | |
tree | a7278af4aff1948ad56475a3ddd6917557be6a2d /tools/perf/util/top.c | |
parent | perf evlist: Rename __group method to __set_leader (diff) | |
download | linux-0c21f736e0a37c50f66ab248d2a52f711b28a4e4.tar.xz linux-0c21f736e0a37c50f66ab248d2a52f711b28a4e4.zip |
perf evlist: Introduce evsel list accessors
To replace the longer list_entry constructs for things that are widely
used:
perf_evlist__{first,last}(evlist)
perf_evsel__next(evsel)
Acked-by: Jiri Olsa <jolsa@redhat.com>
Acked-by: Namhyung Kim <namhyung@gmail.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-ng7azq26wg1jd801qqpcozwp@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
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) } if (top->evlist->nr_entries == 1) { - struct perf_evsel *first; - first = list_entry(top->evlist->entries.next, struct perf_evsel, node); + struct perf_evsel *first = perf_evlist__first(top->evlist); ret += SNPRINTF(bf + ret, size - ret, "%" PRIu64 "%s ", (uint64_t)first->attr.sample_period, top->freq ? "Hz" : ""); |