From patchwork Wed Jul 18 21:48:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 142302 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1022277ljj; Wed, 18 Jul 2018 14:48:15 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdKErJ1ImRsulpqXQnzd1ke8qc4lC/fceiADhLhT6i5cIZg1u47N8H1mrGxMx0hnr3ce7+L X-Received: by 2002:a65:5304:: with SMTP id m4-v6mr7260386pgq.250.1531950495302; Wed, 18 Jul 2018 14:48:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531950495; cv=none; d=google.com; s=arc-20160816; b=FNJLArXdPOqLi0jLbu6Xm0dF4k8ZQstf/FgvxDabNwIp4di2GIouNB7CCmXQ4/wko7 usQRxBp/05d1X91bv5MU62HspFQFNZwgnk36ZRiR/PW0+2LuJzNuqq7P6r1UEKtUJtKv qWyiiDKgbWXGK7IG7nfandNqLhQ1u8kb/hnehhtrskHHASmozzBagCY5GyDqRlsftwPM UQEJYW9PskEIpZr1pwwDSBxhzrtXzSDk6HMDjoWwhxkaybOveRQuB7xQuX5wbKM4QlDE jvPwGv1LjOzspha0xsgcDa8EYRts30AM4hYMNEBSulJH2Gl5U1Ih/pB3sujy+TYSmb4g jXpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=eDmaDWioT7P5gzCyidheXSXPLvDRrL2xsDJugt3KQ+g=; b=JqzT5JmMIzNxa7CTRLXZhLP6t3nH2dqWFCP1tv4DWUOjvB6Jpu1nSfdcVWRlYYv8Jp GMKCCs6exiLejsF5yC7Hy3QtlERCgKwQDlpoRiagDaefEjfPKL4NICoJGNbDdWn92xrY V/9hY1WMPoOSsgRMaav+sP/o32ZIBzg6hwv0teeViBZyetRGuhk0pMqF2nPTb3f3AA7b rg8RvXJdW7FBhmaTD6/FzFVXJCLAovze41oNDXVx9ntE2C9EiZB71LT/rK6jM2ZoI9nu 5gY13YONoLZ+zlH4a/6oum/6YVcMYuMXj//nUGqB9MQJijYYiN6V9w+5BtcHiAXb4dMR 0wTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jlY2g2p1; 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 z72-v6si3805613pgd.646.2018.07.18.14.48.14; Wed, 18 Jul 2018 14:48:15 -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=jlY2g2p1; 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 S1729706AbeGRW2C (ORCPT + 31 others); Wed, 18 Jul 2018 18:28:02 -0400 Received: from mail-it0-f65.google.com ([209.85.214.65]:35044 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726834AbeGRW2C (ORCPT ); Wed, 18 Jul 2018 18:28:02 -0400 Received: by mail-it0-f65.google.com with SMTP id q20-v6so6510898ith.0 for ; Wed, 18 Jul 2018 14:48:11 -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; bh=eDmaDWioT7P5gzCyidheXSXPLvDRrL2xsDJugt3KQ+g=; b=jlY2g2p1YPJL4xcZkNG9D2sPx1IcjBVCaUPvZU0Ui4LSHnoc2I3RRLWINKA5OP3MO6 0FBmdASaZ+5a4L+e+nEyd6SqX2xMGSFoorY098BjVv4Z6bInH+XHE2xmW4upXq0bjjZG CsKOvdOzoYt7e2B03wsInk8caF83nN90r5ONA= 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; bh=eDmaDWioT7P5gzCyidheXSXPLvDRrL2xsDJugt3KQ+g=; b=F3GB6fCCEcxwBtOnMA/eHs8p3iuK7juaJiYqJhYHcGM1VaShq3LKT+Hybs3dp7brfU 7g9zXnn3rBmY9VX3yzSM8o19A4A6f8PboCM0X2K3ejw/2Tn7gn/9WQ+BMAGp95hGBPO3 7rzwKMpFymeYCr5IVyL4YFyBH//v7CspoHoAAzbq5JJrQ//tbkPFRYJ1FRy0sO+qp8LG q72+/t/AQvNuZySEOaUcq5gzh8MARc8wivVhMZDlvRm3mwSAWgFKIu81w8dzLOg1Stu/ jbtAII0qRMyhDxR4E+zWb9HuqjoHY1KF/cdgc1t00vfnu9o5bVIo+HgJ8ZgI21BlT77s iD1w== X-Gm-Message-State: AOUpUlFr1f4Cz8WFl6Pl60rdBLlKRbPcaUDkBMd2LCZbn/wrYVY3NmIt vZvCFsEiADoKHdRYgv2FnO/vqg== X-Received: by 2002:a02:3b55:: with SMTP id i21-v6mr7191248jaf.118.1531950490893; Wed, 18 Jul 2018 14:48:10 -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.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 18 Jul 2018 14:48:10 -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 0/7] perf: Add ioctl for PMU driver configuration Date: Wed, 18 Jul 2018 15:48:00 -0600 Message-Id: <1531950487-24554-1-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This set adds the capability to communiate event specific configuration to the PMU kernel driver using an ioctl(). The functionatlity is made generic enough for anyone to use but is targeted at the identification of CoreSight sinks when operating in CPU-wide trace scenarios. Applies cleanly on v4.18-rc5. Thanks, Mathieu --- Changes for V3: . Return an error for CPU-wide scenarios while the feature is being implemented (Kim) . Proper initialisation for event::hw::drv_config::lock (Kim) Changes for V2: . Fixed s390 problem reported by buildbot. . Removed uneeded check in perf_event_process_drv_config() (Jiri) . Reordered data copy in perf_event_set_drv_config() (Jiri) . Went from 2 to 1 step driver configuration process (Alex) . Moved structure name "perf_drv_config" to "pmu_drv_config". V1: https://lkml.org/lkml/2018/7/2/1008 Mathieu Poirier (7): perf: Introduce ioctl to communicate driver configuration to kernel perf/core: Use ioctl to communicate driver configuration to kernel perf/aux: Make perf_event accessible to setup_aux() coresight: Use PMU driver configuration for sink selection perf tools: Use ioctl to communicate driver configuration to kernel perf tools: Make perf_evsel accessible to PMU driver configuration code perf tools: Use ioctl function to send sink configuration to kernel arch/s390/kernel/perf_cpum_sf.c | 6 +- arch/x86/events/intel/bts.c | 4 +- arch/x86/events/intel/pt.c | 5 +- drivers/hwtracing/coresight/coresight-etm-perf.c | 140 ++++++++++++++++++++--- drivers/hwtracing/coresight/coresight-etm-perf.h | 4 + drivers/perf/arm_spe_pmu.c | 6 +- include/linux/perf_event.h | 47 +++++++- include/uapi/linux/perf_event.h | 1 + kernel/events/core.c | 78 +++++++++++++ kernel/events/ring_buffer.c | 2 +- tools/include/uapi/linux/perf_event.h | 1 + tools/perf/arch/arm/util/cs-etm.c | 60 +++------- tools/perf/arch/arm/util/cs-etm.h | 3 +- tools/perf/util/drv_configs.c | 30 ++--- tools/perf/util/evsel.c | 7 ++ tools/perf/util/evsel.h | 1 + tools/perf/util/pmu.h | 3 +- 17 files changed, 305 insertions(+), 93 deletions(-) -- 2.7.4