diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-08-14 15:42:15 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-08-15 09:14:18 -0400 |
commit | 0c21f736e0a37c50f66ab248d2a52f711b28a4e4 (patch) | |
tree | a7278af4aff1948ad56475a3ddd6917557be6a2d /tools/perf/builtin-top.c | |
parent | 63dab225f334e0e21f7106aed8d888b500b53ce6 (diff) |
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/builtin-top.c')
-rw-r--r-- | tools/perf/builtin-top.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 5a097beb8685..0513aaa659f9 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c | |||
@@ -509,7 +509,7 @@ static void perf_top__handle_keypress(struct perf_top *top, int c) | |||
509 | prompt_integer(&counter, "Enter details event counter"); | 509 | prompt_integer(&counter, "Enter details event counter"); |
510 | 510 | ||
511 | if (counter >= top->evlist->nr_entries) { | 511 | if (counter >= top->evlist->nr_entries) { |
512 | top->sym_evsel = list_entry(top->evlist->entries.next, struct perf_evsel, node); | 512 | top->sym_evsel = perf_evlist__first(top->evlist); |
513 | fprintf(stderr, "Sorry, no such event, using %s.\n", perf_evsel__name(top->sym_evsel)); | 513 | fprintf(stderr, "Sorry, no such event, using %s.\n", perf_evsel__name(top->sym_evsel)); |
514 | sleep(1); | 514 | sleep(1); |
515 | break; | 515 | break; |
@@ -518,7 +518,7 @@ static void perf_top__handle_keypress(struct perf_top *top, int c) | |||
518 | if (top->sym_evsel->idx == counter) | 518 | if (top->sym_evsel->idx == counter) |
519 | break; | 519 | break; |
520 | } else | 520 | } else |
521 | top->sym_evsel = list_entry(top->evlist->entries.next, struct perf_evsel, node); | 521 | top->sym_evsel = perf_evlist__first(top->evlist); |
522 | break; | 522 | break; |
523 | case 'f': | 523 | case 'f': |
524 | prompt_integer(&top->count_filter, "Enter display event count filter"); | 524 | prompt_integer(&top->count_filter, "Enter display event count filter"); |
@@ -1326,7 +1326,7 @@ int cmd_top(int argc, const char **argv, const char *prefix __used) | |||
1326 | pos->attr.sample_period = top.default_interval; | 1326 | pos->attr.sample_period = top.default_interval; |
1327 | } | 1327 | } |
1328 | 1328 | ||
1329 | top.sym_evsel = list_entry(top.evlist->entries.next, struct perf_evsel, node); | 1329 | top.sym_evsel = perf_evlist__first(top.evlist); |
1330 | 1330 | ||
1331 | symbol_conf.priv_size = sizeof(struct annotation); | 1331 | symbol_conf.priv_size = sizeof(struct annotation); |
1332 | 1332 | ||