From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753556AbbLKOUx (ORCPT ); Fri, 11 Dec 2015 09:20:53 -0500 Received: from mga03.intel.com ([134.134.136.65]:55595 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751887AbbLKOUw (ORCPT ); Fri, 11 Dec 2015 09:20:52 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,413,1444719600"; d="scan'208";a="616439735" From: Alexander Shishkin To: Peter Zijlstra Cc: Ingo Molnar , linux-kernel@vger.kernel.org, vince@deater.net, eranian@google.com, Arnaldo Carvalho de Melo , Mathieu Poirier , mark.rutland@arm.com Subject: Re: [PATCH v0 3/5] perf: Introduce instruction trace filtering In-Reply-To: <20151211140201.GQ6356@twins.programming.kicks-ass.net> References: <1449840998-29902-1-git-send-email-alexander.shishkin@linux.intel.com> <1449840998-29902-4-git-send-email-alexander.shishkin@linux.intel.com> <20151211140201.GQ6356@twins.programming.kicks-ass.net> User-Agent: Notmuch/0.21 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-pc-linux-gnu) Date: Fri, 11 Dec 2015 16:20:48 +0200 Message-ID: <87bn9xcbi7.fsf@ashishki-desk.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Peter Zijlstra writes: > On Fri, Dec 11, 2015 at 03:36:36PM +0200, Alexander Shishkin wrote: > >> The pmu driver interface basically adds an extra callback to the >> pmu driver structure, which validates the filter configuration proposed >> by the user against what the hardware is actually capable of doing >> and translates it into something that pmu::start can program into >> hardware. > >> @@ -388,12 +393,38 @@ struct pmu { >> void (*free_aux) (void *aux); /* optional */ >> >> /* >> + * Validate instruction tracing filters: make sure hw supports the >> + * requested configuration and number of filters. >> + * >> + * Configure instruction tracing filters: translate hw-agnostic filter >> + * into hardware configuration in event::hw::itrace_filters >> + */ >> + int (*itrace_filter_setup) (struct perf_event *event); /* optional */ >> + >> + /* >> * Filter events for PMU-specific reasons. >> */ >> int (*filter_match) (struct perf_event *event); /* optional */ >> }; > > Any reason you cannot use pmu::filter_match ? It's for filtering out events that we want to skip over while iterating various event lists, it's also used in quite a few places (which are also relevant to our pmus), so I couldn't see how to re-use it. Thanks, -- Alex