Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753211Ab3IZPpW (ORCPT ); Thu, 26 Sep 2013 11:45:22 -0400 Received: from mga11.intel.com ([192.55.52.93]:19220 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751129Ab3IZPpU (ORCPT ); Thu, 26 Sep 2013 11:45:20 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.90,986,1371106800"; d="scan'208";a="401438376" Date: Thu, 26 Sep 2013 08:45:19 -0700 From: Andi Kleen To: Ingo Molnar Cc: Jiri Olsa , linux-kernel@vger.kernel.org, Arnaldo Carvalho de Melo , Corey Ashford , Frederic Weisbecker , Ingo Molnar , Paul Mackerras , Peter Zijlstra , Don Zickus , Andi Kleen , Adrian Hunter , Stephane Eranian Subject: Re: [RFC 00/21] perf tools: Add toggling events support Message-ID: <20130926154519.GH2018@tassilo.jf.intel.com> References: <1380113447-17144-1-git-send-email-jolsa@redhat.com> <20130925191216.GE2018@tassilo.jf.intel.com> <20130926070307.GE19090@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130926070307.GE19090@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 906 Lines: 21 > > It would be better to keep counting and just do RDPMC on the switch > > points, and then subtract for counting. For sampling could need a MSR > > write to enable/disable. Still somewhat expensive, but nowhere near as > > bad as a full switch. > > This is essentially an optimized event switch and should probably be done > on a higher level so that other instances of event/context switching > benefit as well. Ok. Need to be a bit careful and it cannot be done in all cases. For non global counters this only works if RDPMC is disabled, otherwise it leaks counter interformation between unrelated processes, which may be a security problem. -Andu -- 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/