From patchwork Wed Nov 28 22:01:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 152349 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1632621ljp; Wed, 28 Nov 2018 14:01:23 -0800 (PST) X-Google-Smtp-Source: AFSGD/UB3+BB3Q3QDR2/b+7N3zYk50117+eEkmaqF+C/q02Kc2fEfnP2cre1OHCSpxc9ByQ6cZI8 X-Received: by 2002:a63:f658:: with SMTP id u24mr34987534pgj.267.1543442483095; Wed, 28 Nov 2018 14:01:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543442483; cv=none; d=google.com; s=arc-20160816; b=UgpdOhNa4DSjHEly5dG3Jj+ccrClHEopo1XbedyN2+thnKe5xXPsYuXpEtUh0yvyv+ fMCcYrCfNdUSKHrye1cSsK6nOtlWevuHln0r7utIewdu2NYj0AAWmvfbMyjG7/iS5ZFy OTi80j9iynHsL9ovkauT1JrEyuQf5qBdIThSMSV8EFgR/aOt3tvOlztPm9TbNQ0Mv5SD dkfmtgxUhQp537NFshm+IXWXk2tqOGgpK5Gdkq3T5lHBkMfVKPz8Nx9GHnOoa0oociGn zYtmxNq72XP2qNLZcswEj+rnciBjRK6mPZHDCRJypG+sjW1ZC7Z0LKxgJStM2cvj28rU KhYw== 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; bh=7aj3LJl/otFhIEi9eRonY/qXn3nkgbWFEKET08mBECw=; b=NOld/0HJpdukuCtRAVinJ21bfs697hWyYcALc5o4YVXM+BQFYgF83GdnlG8UTN5xc/ a0UB51Pz+rdK43+fSahrpsv6qU5b+7/Qwn6E19gsamIMIYxoo7PBUzBXw8CN/er3yRID aQ+R5CtzE5QIcPHHVW6FqW/KR2oNJqi6QlSfs+sDjJSZGjNP0s2bkv/xPzKBWIsy/0NM /dUINsTbwLR/dvfI6CgeHBfcM/NBM4JIbhkJDmuyp8hjCEW1WuP7ynzzbM0oOWBymxGO SpmdAcF4C5O2vcChQKgtfG4qDIJaJ4O8Ngd/oKOdLlL+BbcgetAnw1exKGriKlvlNX3p pQ7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="j2//ZgiJ"; 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 bd4-v6si8287137plb.353.2018.11.28.14.01.22; Wed, 28 Nov 2018 14:01:23 -0800 (PST) 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="j2//ZgiJ"; 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 S1726546AbeK2JEZ (ORCPT + 32 others); Thu, 29 Nov 2018 04:04:25 -0500 Received: from mail-pl1-f194.google.com ([209.85.214.194]:44340 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726307AbeK2JEZ (ORCPT ); Thu, 29 Nov 2018 04:04:25 -0500 Received: by mail-pl1-f194.google.com with SMTP id k8so7394007pls.11 for ; Wed, 28 Nov 2018 14:01:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=7aj3LJl/otFhIEi9eRonY/qXn3nkgbWFEKET08mBECw=; b=j2//ZgiJUWr5rpEUo9ivQshZmZbLAU665/2VlD/AG2hMmzIFFXAJ2A6uuiKt55QF9Z U0yoyfkSC8y/LYUVQmfGWn68r9+ScyzAvFlQ1xI9w2VJgmYtvbmJIKvvXm61752+w/y8 xnXpqaLZWvStAeOiuDjQyBtcE7thE/b9eoJ+M= 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=7aj3LJl/otFhIEi9eRonY/qXn3nkgbWFEKET08mBECw=; b=EBH5Fu0gXJMJJLIh8uUfq+fsDuJNRbLPDS2x3x7JKR4t255SpJjugBdnl+dPGSz1lb hlE3reu1sv5GJg7oY3MqIGYnzHip28SwhrXK92ZGUzNDfRwfHOaW78ospO+qZXYqVJWI xu3KRyg4gDGFEgZVm0keQLLaDxR2wGbY6tXSJwX7jMydaL6OO/03CtQoFGy10A2SW3U+ BW548CmlkOtYKMPqPp/fIk6jX4OU8uh4dccCrLSMjDCVrP5KZD0X6yvrcuEzRYOE/Ega a+Bv6oRToMqXO6Pa0VbyM0l5axjIiQg/LxEyVttO9zOyyDTV+xvIVSgQ7BFzzA08VLuy jiaA== X-Gm-Message-State: AA+aEWbosXEg6McqAOtPaFvucQa1G41cRN763Cye+j7wc8Yk8aoUpjwa 74lFZHryI9+KmDl0szuS00VvCw== X-Received: by 2002:a17:902:4025:: with SMTP id b34mr39017356pld.181.1543442480554; Wed, 28 Nov 2018 14:01:20 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id 12sm8698051pgd.35.2018.11.28.14.01.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 28 Nov 2018 14:01:19 -0800 (PST) From: Mathieu Poirier To: acme@kernel.org, peterz@infradead.org, mingo@redhat.com Cc: 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, suzuki.poulosi@arm.com, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v4 0/6] perf: Add ioctl for PMU driver configuration Date: Wed, 28 Nov 2018 15:01:12 -0700 Message-Id: <1543442478-31465-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 is the fourth iteration of a set that adds the capability to communicate event specific configuration to PMU kernel drivers using an ioctl(). Though targeted at the identification of CoreSight sinks when operating in CPU-wide trace scenarios the functionality is made generic enough for anyone to use. The work fits in a wider scheme to support CPU-wide trace scenarios on CoreSight that is available here[1]. If someone is to test the functionality using this branch, note that only dumping of CPU-wide trace data is working. Full decoding capability is being verified. Patch 1 to 3 deal with kernel enhancement to the perf core while patch 4 is CoreSight specific. Patches 5 and 6 concentrate on the perf tools. # Before this set: root@juno:/home/linaro# perf record -e cs_etm/@20070000.etr/ -C 2,3 sleep 1 failed to mmap with 12 (Cannot allocate memory) # After this set: root@juno:/home/linaro# perf record -e cs_etm/@20070000.etr/ -C 2,3 sleep 1 [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 4.145 MB perf.data ] Thanks, Mathieu [1]. https://git.linaro.org/people/mathieu.poirier/coresight.git/log/?h=cpu-wide-coresight --- Changes for V4: . Made passing of information between ioctl() and PMU simpler. . Rebased to 4.20-rc4 Mathieu Poirier (6): 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: 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 | 64 ++++++++++++++++------ drivers/perf/arm_spe_pmu.c | 6 +-- include/linux/perf_event.h | 40 +++++++++++++- include/uapi/linux/perf_event.h | 1 + kernel/events/core.c | 69 ++++++++++++++++++++++++ kernel/events/ring_buffer.c | 2 +- tools/include/uapi/linux/perf_event.h | 1 + tools/perf/arch/arm/util/cs-etm.c | 67 ++++++++++++++++++++++- 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 +- 16 files changed, 257 insertions(+), 52 deletions(-) -- 2.7.4