From patchwork Wed Jul 18 21:48:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 142307 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1022405ljj; Wed, 18 Jul 2018 14:48:27 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd9zt39hNgiz3fPzmr0qkj+KwnyyD2EUwzNYSbYiNyW5JrkTCbUUJWWTUnSBm9EDOCqFTqI X-Received: by 2002:a65:64d7:: with SMTP id t23-v6mr7474022pgv.207.1531950507255; Wed, 18 Jul 2018 14:48:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531950507; cv=none; d=google.com; s=arc-20160816; b=gzWCgxmg+EEGUwMpT3xbDy6w1N+ouGhcUKlY1PTa5RUoqRRUjKNGDDw5HJcnhnBRuv yW/i9eg6drd0w3Jn0EGebKuiHg0jVbXT68J6S9cJJPMzBzAek13oyzoLhSfw5d2m12RX rzoiZnGis50I4ebO0p6kmJbZkGrtIOIVQrtIKEFpUCLhF0CppRCGLLLfcFKexk2LQyS5 DSeG3w/1FdTEap84Usa355fIW2Nl9qXV0vY8bPW5oAlsUCPDhk4tNCFUlef09H32Scxp BNPXUX3bA+wSOpNfylnF8Of/Vmm1sCnqwmlJ/H7XU6J2jnMKEO96+9L+3/71LcnRMBC8 6lgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=rzK96jeA/4D0TqFmCbkbkljgpAZZ6IWuPjpeEQCo8Fg=; b=VKVSzOV2kLpTCpQYHF05ZwC5rnKgX7K7o3EVS4OLGujgbdSzzIWT4ldRM4fMGgTEu7 nB8L3D2RkjgQByK82HsYi8vJtVMPGB9P8uaAX3UR0iByQkSnM8v4Cw5ILrQoXJq4LaRL uwbNh7LTrnEDELVdCp3p10NgDBwYBSxxfCBQ3KwbRBjNvsIFYdGhreNZwaHvjx4U8Mx0 Hv0sA4MYNXkqB/HtTRPjs+UD8/wpe8LyPvc6cPCJlecmbU+jIikglnO0ukyOiE7b0f0Q 8Cn6d9aDjDlon1OLgfZOdqotmHkcvKr0X+bR/c3YDaNvcKKO4ZvYfkzTRDyQTlYTN630 B6Dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Vx0Upq58; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x19-v6si4263678pgf.477.2018.07.18.14.48.27; Wed, 18 Jul 2018 14:48:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Vx0Upq58; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730889AbeGRW2P (ORCPT + 31 others); Wed, 18 Jul 2018 18:28:15 -0400 Received: from mail-io0-f196.google.com ([209.85.223.196]:37327 "EHLO mail-io0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730821AbeGRW2P (ORCPT ); Wed, 18 Jul 2018 18:28:15 -0400 Received: by mail-io0-f196.google.com with SMTP id z19-v6so5375329ioh.4 for ; Wed, 18 Jul 2018 14:48:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=rzK96jeA/4D0TqFmCbkbkljgpAZZ6IWuPjpeEQCo8Fg=; b=Vx0Upq58oqevY3SqboDQJX1fA3xSX2npr5PrLEOKB8M9FghncKRiO0iKyekvaENNfz WAnEBn1VTZLtHjIGMf46eEoSxVTfv4q4VvS4xiIp4XV3e8AH8JKM83swgDGOQqtp3eWz T882tnnaP6Us+IWEgbLXmypBYppuKqwirvmBU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=rzK96jeA/4D0TqFmCbkbkljgpAZZ6IWuPjpeEQCo8Fg=; b=CuHXqnAwKj8pjTPuRaQzIhKal2eE1UZKFPFNnHW5NkNFOZgp5f/UZgz8AnwfYSGc7c 21L/jxOlByEWcZllRXNvH4ngtnu7X1N1aBHtpTa7jKL6kqWu298tP7ML0NMvu42dgXun p21jq1nSqOC0zoCA772bdnBrGEDCI719/cBMTT9JjQM8mLlMkzE4HAJWQZYmG7FKLtB2 21ABDcJtdLotEBULDEvOudeva9qTmKXMJ2Jyey1dIvgWzvGEv/6cQh+sLX3zCldLQ64J TwFJFTVc1uD/qt0+r+yCUo12/7tpiIIIRSl5v4jFy6zPld69YIKHFFXxvwWmPIKQ1CPR bH9Q== X-Gm-Message-State: AOUpUlFgWcRadMChVGJh2XF9FZxWFXXY+WLFDzo/MxZmLdqNn06G86BH i2uphsFU25RzxggRRf8KTJa/lQ== X-Received: by 2002:a6b:4f03:: with SMTP id d3-v6mr6822623iob.176.1531950503608; Wed, 18 Jul 2018 14:48:23 -0700 (PDT) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id w193-v6sm2093386ita.35.2018.07.18.14.48.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 18 Jul 2018 14:48:22 -0700 (PDT) From: Mathieu Poirier To: peterz@infradead.org, acme@kernel.org Cc: mingo@redhat.com, tglx@linutronix.de, alexander.shishkin@linux.intel.com, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com, will.deacon@arm.com, mark.rutland@arm.com, jolsa@redhat.com, namhyung@kernel.org, adrian.hunter@intel.com, ast@kernel.org, gregkh@linuxfoundation.org, hpa@zytor.com, kim.phillips@arm.com, suzuki.poulosi@arm.com, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 5/7] perf tools: Use ioctl to communicate driver configuration to kernel Date: Wed, 18 Jul 2018 15:48:05 -0600 Message-Id: <1531950487-24554-6-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1531950487-24554-1-git-send-email-mathieu.poirier@linaro.org> References: <1531950487-24554-1-git-send-email-mathieu.poirier@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Following in the footsteps of what was done for filters, adding the necessary mechanic needed to push down driver specific configuration to the kernel using an ioctl. By proceeding this way PMU specific configuration such as CoreSight sink specification can be communicated to each event. Signed-off-by: Mathieu Poirier --- tools/perf/util/evsel.c | 7 +++++++ tools/perf/util/evsel.h | 1 + 2 files changed, 8 insertions(+) -- 2.7.4 diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 94fce4f537e9..534aca4c642c 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -1162,6 +1162,13 @@ static int perf_evsel__append_filter(struct perf_evsel *evsel, return -1; } +int perf_evsel__apply_drv_config(struct perf_evsel *evsel, const char *config) +{ + return perf_evsel__run_ioctl(evsel, + PERF_EVENT_IOC_SET_DRV_CONFIG, + (void *)config); +} + int perf_evsel__append_tp_filter(struct perf_evsel *evsel, const char *filter) { return perf_evsel__append_filter(evsel, "(%s) && (%s)", filter); diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index d277930b19a1..0f671bd2a988 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h @@ -271,6 +271,7 @@ int perf_evsel__append_tp_filter(struct perf_evsel *evsel, const char *filter); int perf_evsel__append_addr_filter(struct perf_evsel *evsel, const char *filter); int perf_evsel__apply_filter(struct perf_evsel *evsel, const char *filter); +int perf_evsel__apply_drv_config(struct perf_evsel *evsel, const char *config); int perf_evsel__enable(struct perf_evsel *evsel); int perf_evsel__disable(struct perf_evsel *evsel);