Skip to content

Commit 7594873

Browse files
Kan Liangacmel
authored andcommitted
perf test: Switch to new perf_mmap__read_event() interface for task-exit
The perf test 'task-exit' still use the legacy interface. No functional change. Committer notes: Testing it: # perf test exit 21: Number of exit events of a simple workload : Ok # Signed-off-by: Kan Liang <[email protected]> Tested-by: Arnaldo Carvalho de Melo <[email protected]> Cc: Andi Kleen <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Wang Nan <[email protected]> Link: http://lkml.kernel.org/r/[email protected] [ Changed bool parameters from 0 to 'false', as per Jiri comment ] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent ee4024f commit 7594873

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

tools/perf/tests/task-exit.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ int test__task_exit(struct test *test __maybe_unused, int subtest __maybe_unused
4747
char sbuf[STRERR_BUFSIZE];
4848
struct cpu_map *cpus;
4949
struct thread_map *threads;
50+
struct perf_mmap *md;
51+
u64 end, start;
5052

5153
signal(SIGCHLD, sig_handler);
5254

@@ -110,13 +112,19 @@ int test__task_exit(struct test *test __maybe_unused, int subtest __maybe_unused
110112
perf_evlist__start_workload(evlist);
111113

112114
retry:
113-
while ((event = perf_evlist__mmap_read(evlist, 0)) != NULL) {
115+
md = &evlist->mmap[0];
116+
if (perf_mmap__read_init(md, false, &start, &end) < 0)
117+
goto out_init;
118+
119+
while ((event = perf_mmap__read_event(md, false, &start, end)) != NULL) {
114120
if (event->header.type == PERF_RECORD_EXIT)
115121
nr_exit++;
116122

117-
perf_evlist__mmap_consume(evlist, 0);
123+
perf_mmap__consume(md, false);
118124
}
125+
perf_mmap__read_done(md);
119126

127+
out_init:
120128
if (!exited || !nr_exit) {
121129
perf_evlist__poll(evlist, -1);
122130
goto retry;

0 commit comments

Comments
 (0)