diff options
Diffstat (limited to 'tools/perf/tests/perf-time-to-tsc.c')
| -rw-r--r-- | tools/perf/tests/perf-time-to-tsc.c | 15 | 
1 files changed, 5 insertions, 10 deletions
diff --git a/tools/perf/tests/perf-time-to-tsc.c b/tools/perf/tests/perf-time-to-tsc.c index 0ab61b1f408..3b7cd4d32dc 100644 --- a/tools/perf/tests/perf-time-to-tsc.c +++ b/tools/perf/tests/perf-time-to-tsc.c @@ -1,7 +1,6 @@  #include <stdio.h> -#include <sys/types.h>  #include <unistd.h> -#include <inttypes.h> +#include <linux/types.h>  #include <sys/prctl.h>  #include "parse-events.h" @@ -46,7 +45,7 @@ static u64 rdtsc(void)   */  int test__perf_time_to_tsc(void)  { -	struct perf_record_opts opts = { +	struct record_opts opts = {  		.mmap_pages	     = UINT_MAX,  		.user_freq	     = UINT_MAX,  		.user_interval	     = ULLONG_MAX, @@ -122,7 +121,7 @@ int test__perf_time_to_tsc(void)  			if (event->header.type != PERF_RECORD_COMM ||  			    (pid_t)event->comm.pid != getpid() ||  			    (pid_t)event->comm.tid != getpid()) -				continue; +				goto next_event;  			if (strcmp(event->comm.comm, comm1) == 0) {  				CHECK__(perf_evsel__parse_sample(evsel, event, @@ -134,6 +133,8 @@ int test__perf_time_to_tsc(void)  								 &sample));  				comm2_time = sample.time;  			} +next_event: +			perf_evlist__mmap_consume(evlist, i);  		}  	} @@ -164,14 +165,8 @@ int test__perf_time_to_tsc(void)  out_err:  	if (evlist) {  		perf_evlist__disable(evlist); -		perf_evlist__munmap(evlist); -		perf_evlist__close(evlist);  		perf_evlist__delete(evlist);  	} -	if (cpus) -		cpu_map__delete(cpus); -	if (threads) -		thread_map__delete(threads);  	return err;  }  | 
