From patchwork Thu Jul 5 22:13:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 141233 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2427650ljj; Thu, 5 Jul 2018 15:14:07 -0700 (PDT) X-Google-Smtp-Source: AAOMgpebmprkilWg7maeU3egyZfimapdCb1JytehtwPGgWXVZMkF2ejmgoHA6HN7zEfhCppsqFJt X-Received: by 2002:a17:902:aa87:: with SMTP id d7-v6mr7834753plr.215.1530828847064; Thu, 05 Jul 2018 15:14:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530828847; cv=none; d=google.com; s=arc-20160816; b=A5SPOpy6qXVnKRrp01hpi8JDsYH0BqcZtE6jTKaUtSJ4ilIu0sT7/MmiladJaIQ2NA nB7fRJpn8YoG65N1k1YUl8zEJN6A6dCFQ3S3vmS4RnBPV8Tp2H/dyr1rZG3Txi3FtOUF BsPsYstr2/u8Ms4h1Fv/s42feIRsW+sc4/Ebs4ArYYqS2/IJueHDSIqnwW3Upz5fA+hV bbAbVBS5MIRl6/W+UEHubC96zpc5A5A9bk2kgw4BzGP9aLPpTaMlgxGZrwv3YE6/+Ort Y0rGixxdKAg9w9/qGF3fCo3agzYO7a2LsF7nz2jQ/iU/82nqD8o1j3z9/ZrGg1SF8h94 cRjg== 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=UvLGDKdO/h//3Arbt8FtlqOWoQhtL23DgvWKlB4YJmbXDONBLQ9L+2cHUIXrFnp4Um hrqdDSr7wNad0i4WbCOa/nJcC6gm5e5nib3C7ME7Ou5zbF/l+OpQN+QdMEZo1gs2u50k vXDjKDDl8Y3aTtRdK7NdXLS3/HOVexHjit3FNuw7x0MvEA+Kg3SIqZLS37KA05Mrc+De tzN8e5Bnz7adbr8lU1YDCeZ4fC1HL9PMPxoycalOqUcyuen13Dd/2F6SmZHA895o5t7h qb9nZ79Sf6BtXq6VTblAsSuDvZi+Jw0g+xHpK0c6EZwAZVbKKrC1qHs042FuUm23ADYG ppVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dQiALokg; 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 q9-v6si6575941pll.370.2018.07.05.15.14.06; Thu, 05 Jul 2018 15:14:07 -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=dQiALokg; 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 S1753870AbeGEWOF (ORCPT + 31 others); Thu, 5 Jul 2018 18:14:05 -0400 Received: from mail-pl0-f68.google.com ([209.85.160.68]:39188 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753806AbeGEWOB (ORCPT ); Thu, 5 Jul 2018 18:14:01 -0400 Received: by mail-pl0-f68.google.com with SMTP id s24-v6so1874717plq.6 for ; Thu, 05 Jul 2018 15:14:01 -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=dQiALokgXK8v8B5m27XiIPV2jXkQuoMjG/LxQNrLoJWmpqdU2+2GRo6CcYqnTNJhkl mlYzFQeuN4jRUnFk+/f64BbrXsIeRV08+p7/H4rX6HnCr0FQvU5Cksr2inOxLVsLHUh6 Z+u79nfsE7hykfUK2giLjnkVWvBjmyrVrINXc= 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=RJ1g1sxpiFHZpX4ESEpaEUUjSk3LCLXvG/SprgsceR1sghWTHbr14bkqUEkXnNG7RG r4y4bZ28okWISmd8FSAMBu9CJUMidenpkKHD0GLuucsbRcyEzMW8IZZkpzzmC6AGcFnN 1z/SDoHC76BxBvVjgdqNEn+/+HIN00nQHTHBj2E4VY7pC032XvpbvqitkhLV9cIDEJaO KBqTGSThcHaEBVFsyon0j47nEFYbMzYn87xUiOXHkm/fPCIOiVX84k8suD05NiGvs82Z aIO4gY47B6+AhzzPj2l8x6tHQP5bSTxQd3/nR3Cv76ZA9LXU9ynpG+7W+OyhTgCdJpd7 JY3A== X-Gm-Message-State: APt69E0zCcfM1OBZWFCGDNNVJs21c7zYAAanx0We29fUQtZ/sv1Dvs5A 4VZYiyOcFdLROMUiOhKoJlyOxw== X-Received: by 2002:a17:902:e101:: with SMTP id cc1-v6mr7764642plb.96.1530828841321; Thu, 05 Jul 2018 15:14:01 -0700 (PDT) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id r89-v6sm13297486pfa.75.2018.07.05.15.13.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 05 Jul 2018 15:14:00 -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, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 5/7] perf tools: Use ioctl to communicate driver configuration to kernel Date: Thu, 5 Jul 2018 16:13:45 -0600 Message-Id: <1530828827-11604-6-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1530828827-11604-1-git-send-email-mathieu.poirier@linaro.org> References: <1530828827-11604-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);