diff options
author | Scott Wood <scottwood@freescale.com> | 2014-04-07 23:49:35 (GMT) |
---|---|---|
committer | Scott Wood <scottwood@freescale.com> | 2014-04-07 23:49:35 (GMT) |
commit | 62b8c978ee6b8d135d9e7953221de58000dba986 (patch) | |
tree | 683b04b2e627f6710c22c151b23c8cc9a165315e /tools/perf/tests/task-exit.c | |
parent | 78fd82238d0e5716578c326404184a27ba67fd6e (diff) | |
download | linux-fsl-qoriq-62b8c978ee6b8d135d9e7953221de58000dba986.tar.xz |
Rewind v3.13-rc3+ (78fd82238d0e5716) to v3.12
Diffstat (limited to 'tools/perf/tests/task-exit.c')
-rw-r--r-- | tools/perf/tests/task-exit.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/tools/perf/tests/task-exit.c b/tools/perf/tests/task-exit.c index d09ab57..a3e6487 100644 --- a/tools/perf/tests/task-exit.c +++ b/tools/perf/tests/task-exit.c @@ -28,7 +28,7 @@ int test__task_exit(void) union perf_event *event; struct perf_evsel *evsel; struct perf_evlist *evlist; - struct target target = { + struct perf_target target = { .uid = UINT_MAX, .uses_mmap = true, }; @@ -37,11 +37,20 @@ int test__task_exit(void) signal(SIGCHLD, sig_handler); signal(SIGUSR1, sig_handler); - evlist = perf_evlist__new_default(); + evlist = perf_evlist__new(); if (evlist == NULL) { - pr_debug("perf_evlist__new_default\n"); + pr_debug("perf_evlist__new\n"); return -1; } + /* + * We need at least one evsel in the evlist, use the default + * one: "cycles". + */ + err = perf_evlist__add_default(evlist); + if (err < 0) { + pr_debug("Not enough memory to create evsel\n"); + goto out_free_evlist; + } /* * Create maps of threads and cpus to monitor. In this case @@ -108,6 +117,7 @@ out_close_evlist: perf_evlist__close(evlist); out_delete_maps: perf_evlist__delete_maps(evlist); +out_free_evlist: perf_evlist__delete(evlist); return err; } |