diff options
Diffstat (limited to 'tools/lib/perf')
| -rw-r--r-- | tools/lib/perf/tests/test-evlist.c | 6 | ||||
| -rw-r--r-- | tools/lib/perf/tests/test-evsel.c | 7 | 
2 files changed, 7 insertions, 6 deletions
| diff --git a/tools/lib/perf/tests/test-evlist.c b/tools/lib/perf/tests/test-evlist.c index c67c83399170..ce91a582f0e4 100644 --- a/tools/lib/perf/tests/test-evlist.c +++ b/tools/lib/perf/tests/test-evlist.c @@ -40,7 +40,7 @@ static int test_stat_cpu(void)  		.type	= PERF_TYPE_SOFTWARE,  		.config	= PERF_COUNT_SW_TASK_CLOCK,  	}; -	int err, cpu, tmp; +	int err, idx;  	cpus = perf_cpu_map__new(NULL);  	__T("failed to create cpus", cpus); @@ -70,10 +70,10 @@ static int test_stat_cpu(void)  	perf_evlist__for_each_evsel(evlist, evsel) {  		cpus = perf_evsel__cpus(evsel); -		perf_cpu_map__for_each_cpu(cpu, tmp, cpus) { +		for (idx = 0; idx < perf_cpu_map__nr(cpus); idx++) {  			struct perf_counts_values counts = { .val = 0 }; -			perf_evsel__read(evsel, cpu, 0, &counts); +			perf_evsel__read(evsel, idx, 0, &counts);  			__T("failed to read value for evsel", counts.val != 0);  		}  	} diff --git a/tools/lib/perf/tests/test-evsel.c b/tools/lib/perf/tests/test-evsel.c index a184e4861627..33ae9334861a 100644 --- a/tools/lib/perf/tests/test-evsel.c +++ b/tools/lib/perf/tests/test-evsel.c @@ -22,7 +22,7 @@ static int test_stat_cpu(void)  		.type	= PERF_TYPE_SOFTWARE,  		.config	= PERF_COUNT_SW_CPU_CLOCK,  	}; -	int err, cpu, tmp; +	int err, idx;  	cpus = perf_cpu_map__new(NULL);  	__T("failed to create cpus", cpus); @@ -33,10 +33,10 @@ static int test_stat_cpu(void)  	err = perf_evsel__open(evsel, cpus, NULL);  	__T("failed to open evsel", err == 0); -	perf_cpu_map__for_each_cpu(cpu, tmp, cpus) { +	for (idx = 0; idx < perf_cpu_map__nr(cpus); idx++) {  		struct perf_counts_values counts = { .val = 0 }; -		perf_evsel__read(evsel, cpu, 0, &counts); +		perf_evsel__read(evsel, idx, 0, &counts);  		__T("failed to read value for evsel", counts.val != 0);  	} @@ -148,6 +148,7 @@ static int test_stat_user_read(int event)  	__T("failed to mmap evsel", err == 0);  	pc = perf_evsel__mmap_base(evsel, 0, 0); +	__T("failed to get mmapped address", pc);  #if defined(__i386__) || defined(__x86_64__)  	__T("userspace counter access not supported", pc->cap_user_rdpmc); |