From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752306AbcGSWyA (ORCPT ); Tue, 19 Jul 2016 18:54:00 -0400 Received: from mail-io0-f176.google.com ([209.85.223.176]:35420 "EHLO mail-io0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752041AbcGSWx7 (ORCPT ); Tue, 19 Jul 2016 18:53:59 -0400 From: Mathieu Poirier To: peterz@infradead.org, mingo@redhat.com, acme@kernel.org, alexander.shishkin@linux.intel.com, jolsa@kernel.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 0/6] perf: Driver specific configuration for PMU Date: Tue, 19 Jul 2016 16:53:50 -0600 Message-Id: <1468968836-12695-1-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patchset adds the possiblity of specifying PMU driver configuration directly from the perf command line. Anything that falls within the event specifiers '/.../' and that is preceeded by the '@' symbol is treated as a configurable. Two formats are supported, @cfg and @cfg=config. For example: perf record -e some_event/@cfg1/ ... or perf record -e some_event/@cfg2=config/ ... or perf record -e some_event/@cfg1,@cfg2=config/ ... The above are all valid configuration and will see the strings 'cfg1' and 'cfg2=config' sent to the PMU driver for parsing and interpretation using the existing ioctl() mechanism. The primary customers for this feature are the CoreSight drivers where the selection of a sink (where trace data is accumulated) needs to be done in a previous, and separated step, from the launching of the perf command. As such something that used to be a two-step process: # echo 1 > /sys/bus/coresight/devices/20070000.etr/enable_sink # perf record -e cs_etm//u --per-thread uname is integrated in a single command: # perf record -e cs_etm/@sink=20070000.etr/u --per-thread uname The patches include both the kernel and user space part so that the solution is complete and found in a single place. Last but not least it is based on 4.7-rc7 assumes that these patches [1] have been applied. Thanks, Mathieu [1]. https://lkml.org/lkml/2016/7/14/642 Mathieu Poirier (6): perf/core: Adding PMU driver specific configuration perf: Passing struct perf_event to function setup_aux() perf tools: add infrastructure for PMU specific configuration perf tools: pushing driver configuration down to the kernel coresight: adding sink parameter to function coresight_build_path() coresight: etm-perf: incorporating sink definition from cmd line arch/x86/events/intel/bts.c | 4 +- arch/x86/events/intel/pt.c | 5 +- drivers/hwtracing/coresight/coresight-etm-perf.c | 105 ++++++++++++++++++++++- drivers/hwtracing/coresight/coresight-priv.h | 3 +- drivers/hwtracing/coresight/coresight.c | 40 ++++++--- include/linux/perf_event.h | 11 ++- include/uapi/linux/perf_event.h | 1 + kernel/events/core.c | 16 ++++ kernel/events/ring_buffer.c | 2 +- tools/perf/builtin-record.c | 9 ++ tools/perf/util/evlist.c | 24 ++++++ tools/perf/util/evlist.h | 3 + tools/perf/util/evsel.c | 33 +++++++ tools/perf/util/evsel.h | 7 ++ tools/perf/util/parse-events.c | 67 +++++++++++---- tools/perf/util/parse-events.h | 1 + tools/perf/util/parse-events.l | 12 +++ tools/perf/util/parse-events.y | 11 +++ 18 files changed, 314 insertions(+), 40 deletions(-) -- 2.7.4