Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d8b11a0c authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Ingo Molnar
Browse files

perf/x86: Clean up cap_user_time* setting



Currently the cap_user_time_zero capability has different tests than
cap_user_time; even though they expose the exact same data.

Switch from CONSTANT && NONSTOP to sched_clock_stable to also deal
with multi cabinet machines and drop the tsc_disabled() check.. non of
this will work sanely without tsc anyway.

Signed-off-by: default avatarPeter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/n/tip-nmgn0j0muo1r4c94vlfh23xy@git.kernel.org


Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 9886167d
Loading
Loading
Loading
Loading
+3 −8
Original line number Original line Diff line number Diff line
@@ -1888,10 +1888,7 @@ void arch_perf_update_userpage(struct perf_event_mmap_page *userpg, u64 now)
	userpg->cap_user_rdpmc = x86_pmu.attr_rdpmc;
	userpg->cap_user_rdpmc = x86_pmu.attr_rdpmc;
	userpg->pmc_width = x86_pmu.cntval_bits;
	userpg->pmc_width = x86_pmu.cntval_bits;


	if (!boot_cpu_has(X86_FEATURE_CONSTANT_TSC))
	if (!sched_clock_stable)
		return;

	if (!boot_cpu_has(X86_FEATURE_NONSTOP_TSC))
		return;
		return;


	userpg->cap_user_time = 1;
	userpg->cap_user_time = 1;
@@ -1899,11 +1896,9 @@ void arch_perf_update_userpage(struct perf_event_mmap_page *userpg, u64 now)
	userpg->time_shift = CYC2NS_SCALE_FACTOR;
	userpg->time_shift = CYC2NS_SCALE_FACTOR;
	userpg->time_offset = this_cpu_read(cyc2ns_offset) - now;
	userpg->time_offset = this_cpu_read(cyc2ns_offset) - now;


	if (sched_clock_stable && !check_tsc_disabled()) {
	userpg->cap_user_time_zero = 1;
	userpg->cap_user_time_zero = 1;
	userpg->time_zero = this_cpu_read(cyc2ns_offset);
	userpg->time_zero = this_cpu_read(cyc2ns_offset);
}
}
}


/*
/*
 * callchain support
 * callchain support