From patchwork Fri Sep 16 15:49:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 76395 Delivered-To: patch@linaro.org Received: by 10.140.106.72 with SMTP id d66csp564990qgf; Fri, 16 Sep 2016 08:50:46 -0700 (PDT) X-Received: by 10.98.96.193 with SMTP id u184mr24039486pfb.85.1474041045967; Fri, 16 Sep 2016 08:50:45 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x25si8254798pfa.224.2016.09.16.08.50.45; Fri, 16 Sep 2016 08:50:45 -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; 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 dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964917AbcIPPu3 (ORCPT + 27 others); Fri, 16 Sep 2016 11:50:29 -0400 Received: from mail-it0-f49.google.com ([209.85.214.49]:38155 "EHLO mail-it0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758321AbcIPPuM (ORCPT ); Fri, 16 Sep 2016 11:50:12 -0400 Received: by mail-it0-f49.google.com with SMTP id n143so19932883ita.1 for ; Fri, 16 Sep 2016 08:50: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:in-reply-to:references; bh=AGudutHi1PK/FGGwl1hB9p/+yvdMUtXwYwj4a7owm0U=; b=WuI987+cxHnOyMXhGwQ2o0bz3Sebw5WGqnYAhAY7hOGYyTfGfl8tHNdKcz4rGiQwN6 ZADBLxpxAnvjKXcrSgQNdL/zrAeilyyjB04ffBAf2bCsiFON7rMMWMtNPBsQPA+D4NzY H9dAgUmtemxHenUmUCbUDEijbncmLxfl99Oz0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=AGudutHi1PK/FGGwl1hB9p/+yvdMUtXwYwj4a7owm0U=; b=IIjCQTqZUYhGUVK0HUG2fg19fpztycF43o3ppub020C9+arX51meBaTJlz7hPoWh5l XsbKKfQ2/EEfdN+pxMGJ6pmAGmAolbPxW7M84vfYjxxyKCYVOF6JjLQ6CbX0wMrNrusZ 8mYFrw6TNDk/iFyOAu1AXtiKxXmXzYUv5x4mx3nJpA2CpXXLAiwtTYeTytoCMnKDZdSX 1oKCrPtVcL04IV0XtUjYP8dtDZ8MlJ1yQHa8iFibHMzQGkTXiDXDo5S4siYmoeWmtlzC ONQFTUG3MmsHvHaQ1s6/UxaUBcMMfOAMNkLX358/ovzDM2syG1hdCIHXSpeoAS2CH5/b x4NA== X-Gm-Message-State: AE9vXwPn9AkPxjThQ6PNA8xQWbMpk8sLRpqhAvn4hPgdcfkZQuGyrURcJY8m5a1/btNZHEWF X-Received: by 10.36.71.73 with SMTP id t70mr6106468itb.47.1474041011319; Fri, 16 Sep 2016 08:50:11 -0700 (PDT) Received: from t430.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id h63sm3177750ita.12.2016.09.16.08.50.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 16 Sep 2016 08:50:10 -0700 (PDT) From: Mathieu Poirier To: acme@kernel.org Cc: acme@infradead.org, peterz@infradead.org, jolsa@kernel.org, mingo@redhat.com, alexander.shishkin@linux.intel.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH V8 2/7] perf tools: making coresight PMU listable Date: Fri, 16 Sep 2016 09:49:59 -0600 Message-Id: <1474041004-13956-3-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1474041004-13956-1-git-send-email-mathieu.poirier@linaro.org> References: <1474041004-13956-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 Adding the required mechanic allowing 'perf list pmu' to discover coresight ETM/PTM tracers. Signed-off-by: Mathieu Poirier Acked-by: Adrian Hunter Acked-by: Jiri Olsa --- MAINTAINERS | 1 + tools/perf/arch/arm/util/Build | 2 ++ tools/perf/arch/arm/util/pmu.c | 34 ++++++++++++++++++++++++++++++++++ tools/perf/arch/arm64/util/Build | 2 ++ 4 files changed, 39 insertions(+) create mode 100644 tools/perf/arch/arm/util/pmu.c -- 2.7.4 diff --git a/MAINTAINERS b/MAINTAINERS index 6781a3febd59..3ff44a5aa539 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1123,6 +1123,7 @@ F: drivers/hwtracing/coresight/* F: Documentation/trace/coresight.txt F: Documentation/devicetree/bindings/arm/coresight.txt F: Documentation/ABI/testing/sysfs-bus-coresight-devices-* +F: tools/perf/arch/arm/util/pmu.c ARM/CORGI MACHINE SUPPORT M: Richard Purdie diff --git a/tools/perf/arch/arm/util/Build b/tools/perf/arch/arm/util/Build index f98da17357c0..4093fd146f46 100644 --- a/tools/perf/arch/arm/util/Build +++ b/tools/perf/arch/arm/util/Build @@ -2,3 +2,5 @@ libperf-$(CONFIG_DWARF) += dwarf-regs.o libperf-$(CONFIG_LOCAL_LIBUNWIND) += unwind-libunwind.o libperf-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o + +libperf-$(CONFIG_AUXTRACE) += pmu.o diff --git a/tools/perf/arch/arm/util/pmu.c b/tools/perf/arch/arm/util/pmu.c new file mode 100644 index 000000000000..af9fb666b44f --- /dev/null +++ b/tools/perf/arch/arm/util/pmu.c @@ -0,0 +1,34 @@ +/* + * Copyright(C) 2015 Linaro Limited. All rights reserved. + * Author: Mathieu Poirier + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ + +#include +#include +#include + +#include "../../util/pmu.h" + +struct perf_event_attr +*perf_pmu__get_default_config(struct perf_pmu *pmu __maybe_unused) +{ +#ifdef HAVE_AUXTRACE_SUPPORT + if (!strcmp(pmu->name, CORESIGHT_ETM_PMU_NAME)) { + /* add ETM default config here */ + pmu->selectable = true; + } +#endif + return NULL; +} diff --git a/tools/perf/arch/arm64/util/Build b/tools/perf/arch/arm64/util/Build index 02f41dba4f4f..3876dd05bb8b 100644 --- a/tools/perf/arch/arm64/util/Build +++ b/tools/perf/arch/arm64/util/Build @@ -1,2 +1,4 @@ libperf-$(CONFIG_DWARF) += dwarf-regs.o libperf-$(CONFIG_LOCAL_LIBUNWIND) += unwind-libunwind.o + +libperf-$(CONFIG_AUXTRACE) += ../../arm/util/pmu.o