From patchwork Thu May 26 08:34:13 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhang Rui X-Patchwork-Id: 820092 Received: from smtp1.linux-foundation.org (smtp1.linux-foundation.org [140.211.169.13]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p4Q8dM6d000547 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Thu, 26 May 2011 08:39:44 GMT Received: from daredevil.linux-foundation.org (localhost [127.0.0.1]) by smtp1.linux-foundation.org (8.14.2/8.13.5/Debian-3ubuntu1.1) with ESMTP id p4Q8aQG9024571; Thu, 26 May 2011 01:36:56 -0700 Received: from mga14.intel.com (mga14.intel.com [143.182.124.37]) by smtp1.linux-foundation.org (8.14.2/8.13.5/Debian-3ubuntu1.1) with ESMTP id p4Q8ZtcZ024530 for ; Thu, 26 May 2011 01:35:56 -0700 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga102.ch.intel.com with ESMTP; 26 May 2011 01:35:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.65,272,1304319600"; d="scan'208";a="2115340" Received: from rui.sh.intel.com (HELO [10.239.36.62]) ([10.239.36.62]) by azsmga001.ch.intel.com with ESMTP; 26 May 2011 01:35:52 -0700 From: Zhang Rui To: LKML , linux-pm Date: Thu, 26 May 2011 16:34:13 +0800 Message-ID: <1306398853.2207.155.camel@rui> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Received-SPF: pass (localhost is always allowed.) X-Spam-Status: No, hits=-104.195 required=5 tests=AWL, BAYES_00, OSDL_HEADER_SUBJECT_BRACKETED, USER_IN_WHITELIST X-Spam-Checker-Version: SpamAssassin 3.2.4-osdl_revision__1.47__ X-MIMEDefang-Filter: lf$Revision: 1.188 $ X-Scanned-By: MIMEDefang 2.63 on 140.211.169.21 Cc: acme@redhat.com, mingo@elte.hu, a.p.zijlstra@chello.nl, ming.m.lin@intel.com Subject: [linux-pm] [PATCH 1/3] export some perf interfaces X-BeenThere: linux-pm@lists.linux-foundation.org X-Mailman-Version: 2.1.9 Precedence: list List-Id: Linux power management List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-pm-bounces@lists.linux-foundation.org Errors-To: linux-pm-bounces@lists.linux-foundation.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Thu, 26 May 2011 08:39:44 +0000 (UTC) Export perf interfaces. Needed by the next patch, which exports the Package/Core/Uncore/DRAM energy consumption via perf tool. Singed-off-by: Zhang Rui --- include/linux/perf_event.h | 3 +++ kernel/events/core.c | 11 ++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) Index: linux-2.6/include/linux/perf_event.h =================================================================== --- linux-2.6.orig/include/linux/perf_event.h +++ linux-2.6/include/linux/perf_event.h @@ -1153,6 +1153,9 @@ extern void perf_swevent_put_recursion_c extern void perf_event_enable(struct perf_event *event); extern void perf_event_disable(struct perf_event *event); extern void perf_event_task_tick(void); +extern void perf_swevent_init_hrtimer(struct perf_event *event); +extern void perf_swevent_start_hrtimer(struct perf_event *event); +extern void perf_swevent_cancel_hrtimer(struct perf_event *event); #else static inline void perf_event_task_sched_in(struct task_struct *task) { } Index: linux-2.6/kernel/events/core.c =================================================================== --- linux-2.6.orig/kernel/events/core.c +++ linux-2.6/kernel/events/core.c @@ -5648,7 +5648,7 @@ static enum hrtimer_restart perf_swevent return ret; } -static void perf_swevent_start_hrtimer(struct perf_event *event) +void perf_swevent_start_hrtimer(struct perf_event *event) { struct hw_perf_event *hwc = &event->hw; s64 period; @@ -5669,8 +5669,9 @@ static void perf_swevent_start_hrtimer(s ns_to_ktime(period), 0, HRTIMER_MODE_REL_PINNED, 0); } +EXPORT_SYMBOL_GPL(perf_swevent_start_hrtimer); -static void perf_swevent_cancel_hrtimer(struct perf_event *event) +void perf_swevent_cancel_hrtimer(struct perf_event *event) { struct hw_perf_event *hwc = &event->hw; @@ -5681,8 +5682,9 @@ static void perf_swevent_cancel_hrtimer( hrtimer_cancel(&hwc->hrtimer); } } +EXPORT_SYMBOL_GPL(perf_swevent_cancel_hrtimer); -static void perf_swevent_init_hrtimer(struct perf_event *event) +void perf_swevent_init_hrtimer(struct perf_event *event) { struct hw_perf_event *hwc = &event->hw; @@ -5705,6 +5707,7 @@ static void perf_swevent_init_hrtimer(st event->attr.freq = 0; } } +EXPORT_SYMBOL_GPL(perf_swevent_init_hrtimer); /* * Software event: cpu wall time clock @@ -6077,6 +6080,7 @@ free_pdc: free_percpu(pmu->pmu_disable_count); goto unlock; } +EXPORT_SYMBOL_GPL(perf_pmu_register); void perf_pmu_unregister(struct pmu *pmu) { @@ -6098,6 +6102,7 @@ void perf_pmu_unregister(struct pmu *pmu put_device(pmu->dev); free_pmu_context(pmu); } +EXPORT_SYMBOL_GPL(perf_pmu_unregister); struct pmu *perf_init_event(struct perf_event *event) {