Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756696AbZJVQeG (ORCPT ); Thu, 22 Oct 2009 12:34:06 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756385AbZJVQeG (ORCPT ); Thu, 22 Oct 2009 12:34:06 -0400 Received: from nfitmail.nfit.au.dk ([130.225.31.129]:21804 "EHLO smtp.nfit.au.dk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756230AbZJVQeF convert rfc822-to-8bit (ORCPT ); Thu, 22 Oct 2009 12:34:05 -0400 To: linux-kernel@vger.kernel.org Cc: Ingo Molnar , Peter Zijlstra , Fr??d??ric Weisbecker , Thomas Gleixner , Arnaldo Carvalho de Melo , Steven Rostedt Subject: [PATCH 2/2 -tip] perf: Don't generate events for the idle task when exclude_idle is set. References: From: Soeren Sandmann Date: 22 Oct 2009 18:34:08 +0200 In-Reply-To: Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8BIT X-NFIT-RelayAddr: 130.225.16.135 X-NFIT-Solido-Score: 0. Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1109 Lines: 27 Getting samples for the idle task is often not interesting, so don't generate them when exclude_idle is set for the event in question. Signed-off-by: Søren Sandmann Pedersen --- kernel/perf_event.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/kernel/perf_event.c b/kernel/perf_event.c index b492c55..7bc84cb 100644 --- a/kernel/perf_event.c +++ b/kernel/perf_event.c @@ -3959,8 +3959,9 @@ static enum hrtimer_restart perf_swevent_hrtimer(struct hrtimer *hrtimer) regs = task_pt_regs(current); if (regs) { - if (perf_event_overflow(event, 0, &data, regs)) - ret = HRTIMER_NORESTART; + if (!(event->attr.exclude_idle && current->pid == 0)) + if (perf_event_overflow(event, 0, &data, regs)) + ret = HRTIMER_NORESTART; } period = max_t(u64, 10000, event->hw.sample_period); -- 1.6.5.rc2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/