diff options
author | Jiri Olsa <jolsa@redhat.com> | 2013-09-01 12:36:14 +0200 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-10-09 11:24:34 -0300 |
commit | b22d54b09a5448d3706929c6f0eae36429f4ec5d (patch) | |
tree | 4e4f20ae238ad857dd6543ab380c24b5ae064725 /tools/perf/util/evlist.c | |
parent | 27050f530dc4fd88dc93d85c177e000efe970d12 (diff) | |
download | lwn-b22d54b09a5448d3706929c6f0eae36429f4ec5d.tar.gz lwn-b22d54b09a5448d3706929c6f0eae36429f4ec5d.zip |
perf evlist: Introduce perf_evlist__new_default function
Adding new common function to create evlist with default event. It
spares some code lines in automated tests.
Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1378031796-17892-4-git-send-email-jolsa@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/evlist.c')
-rw-r--r-- | tools/perf/util/evlist.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index d21ab0812926..f0d71a9d49f4 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c @@ -50,6 +50,18 @@ struct perf_evlist *perf_evlist__new(void) return evlist; } +struct perf_evlist *perf_evlist__new_default(void) +{ + struct perf_evlist *evlist = perf_evlist__new(); + + if (evlist && perf_evlist__add_default(evlist)) { + perf_evlist__delete(evlist); + evlist = NULL; + } + + return evlist; +} + /** * perf_evlist__set_id_pos - set the positions of event ids. * @evlist: selected event list |