From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753848AbcDSJfy (ORCPT ); Tue, 19 Apr 2016 05:35:54 -0400 Received: from terminus.zytor.com ([198.137.202.10]:56572 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753320AbcDSJfw (ORCPT ); Tue, 19 Apr 2016 05:35:52 -0400 Date: Tue, 19 Apr 2016 02:34:50 -0700 From: tip-bot for Alexander Shishkin Message-ID: Cc: daniel.lezcano@linaro.org, tglx@linutronix.de, bp@alien8.de, peterz@infradead.org, torvalds@linux-foundation.org, mingo@kernel.org, linux-kernel@vger.kernel.org, alexander.shishkin@linux.intel.com, hpa@zytor.com, a.p.zijlstra@chello.nl, acme@infradead.org Reply-To: torvalds@linux-foundation.org, daniel.lezcano@linaro.org, tglx@linutronix.de, bp@alien8.de, peterz@infradead.org, alexander.shishkin@linux.intel.com, linux-kernel@vger.kernel.org, mingo@kernel.org, acme@infradead.org, hpa@zytor.com, a.p.zijlstra@chello.nl In-Reply-To: <1460635189-2320-1-git-send-email-alexander.shishkin@linux.intel.com> References: <1460635189-2320-1-git-send-email-alexander.shishkin@linux.intel.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:sched/core] perf/core, sched: Don't use clock function pointer to determine clock Git-Commit-ID: f454bfddf6ba557381d8bf5df50eff778602ff23 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: f454bfddf6ba557381d8bf5df50eff778602ff23 Gitweb: http://git.kernel.org/tip/f454bfddf6ba557381d8bf5df50eff778602ff23 Author: Alexander Shishkin AuthorDate: Thu, 14 Apr 2016 14:59:49 +0300 Committer: Ingo Molnar CommitDate: Tue, 19 Apr 2016 10:55:29 +0200 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 Cc: Arnaldo Carvalho de Melo Cc: Borislav Petkov Cc: Daniel Lezcano Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Peter Zijlstra Cc: Thomas Gleixner 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 --- arch/x86/events/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c index 041e442..dd39fde 100644 --- a/arch/x86/events/core.c +++ b/arch/x86/events/core.c @@ -2177,7 +2177,7 @@ void arch_perf_update_userpage(struct perf_event *event, * cap_user_time_zero doesn't make sense when we're using a different * time base for the records. */ - if (event->clock == &local_clock) { + if (!event->attr.use_clockid) { userpg->cap_user_time_zero = 1; userpg->time_zero = data->cyc2ns_offset; }