perf/core, sched: Don't use clock function pointer to determine clock
authorAlexander Shishkin <alexander.shishkin@linux.intel.com>
Thu, 14 Apr 2016 11:59:49 +0000 (14:59 +0300)
committerIngo Molnar <mingo@kernel.org>
Tue, 19 Apr 2016 08:55:29 +0000 (10:55 +0200)
commitf454bfddf6ba557381d8bf5df50eff778602ff23
treee7917d396d7a87f255dc2f19e912338df3e02a0b
parentbd92883051a0228cc34996b8e766111ba10c9aac
perf/core, sched: Don't use clock function pointer to determine clock

Now that local_clock() is explicitly inlined in sched.h, taking its
pointer would uninline it in the compilation unit where it's done,
making (among other things) comparing pointers to this function
produce different results in different compilation units.

Case in point, x86 perf core's user page updating function compares
event's clock against &local_clock to see if it needs to set zero
time offset related bits in the page.

This patch fixes the latter by looking at the "use_clockid" event
attribute instead, to determine whether local clock is used. Fixing
the uninlined local_clock() in perf core is left as an exercise for
the author of the prior work.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: eranian@google.com
Cc: vince@deater.net
Fixes: http://lkml.kernel.org/r/1459541050-13654-1-git-send-email-daniel.lezcano@linaro.org
Link: http://lkml.kernel.org/r/1460635189-2320-1-git-send-email-alexander.shishkin@linux.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/events/core.c