aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/tests/perf-record.c
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@redhat.com>2013-09-01 06:36:14 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2013-10-09 10:24:34 -0400
commitb22d54b09a5448d3706929c6f0eae36429f4ec5d (patch)
tree4e4f20ae238ad857dd6543ab380c24b5ae064725 /tools/perf/tests/perf-record.c
parent27050f530dc4fd88dc93d85c177e000efe970d12 (diff)
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/tests/perf-record.c')
-rw-r--r--tools/perf/tests/perf-record.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/tools/perf/tests/perf-record.c b/tools/perf/tests/perf-record.c
index b8a7056519ac..82ac71550091 100644
--- a/tools/perf/tests/perf-record.c
+++ b/tools/perf/tests/perf-record.c
@@ -45,7 +45,7 @@ int test__PERF_RECORD(void)
45 }; 45 };
46 cpu_set_t cpu_mask; 46 cpu_set_t cpu_mask;
47 size_t cpu_mask_size = sizeof(cpu_mask); 47 size_t cpu_mask_size = sizeof(cpu_mask);
48 struct perf_evlist *evlist = perf_evlist__new(); 48 struct perf_evlist *evlist = perf_evlist__new_default();
49 struct perf_evsel *evsel; 49 struct perf_evsel *evsel;
50 struct perf_sample sample; 50 struct perf_sample sample;
51 const char *cmd = "sleep"; 51 const char *cmd = "sleep";
@@ -66,16 +66,6 @@ int test__PERF_RECORD(void)
66 } 66 }
67 67
68 /* 68 /*
69 * We need at least one evsel in the evlist, use the default
70 * one: "cycles".
71 */
72 err = perf_evlist__add_default(evlist);
73 if (err < 0) {
74 pr_debug("Not enough memory to create evsel\n");
75 goto out_delete_evlist;
76 }
77
78 /*
79 * Create maps of threads and cpus to monitor. In this case 69 * Create maps of threads and cpus to monitor. In this case
80 * we start with all threads and cpus (-1, -1) but then in 70 * we start with all threads and cpus (-1, -1) but then in
81 * perf_evlist__prepare_workload we'll fill in the only thread 71 * perf_evlist__prepare_workload we'll fill in the only thread