From patchwork Thu Aug 11 16:20:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 73792 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp191636qga; Thu, 11 Aug 2016 09:21:56 -0700 (PDT) X-Received: by 10.66.155.129 with SMTP id vw1mr18492945pab.148.1470932510687; Thu, 11 Aug 2016 09:21:50 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id wn3si3883113pab.33.2016.08.11.09.21.50; Thu, 11 Aug 2016 09:21:50 -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 S932827AbcHKQVc (ORCPT + 27 others); Thu, 11 Aug 2016 12:21:32 -0400 Received: from mail-io0-f176.google.com ([209.85.223.176]:34110 "EHLO mail-io0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932567AbcHKQV0 (ORCPT ); Thu, 11 Aug 2016 12:21:26 -0400 Received: by mail-io0-f176.google.com with SMTP id q83so735459iod.1 for ; Thu, 11 Aug 2016 09:21:26 -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=j48kBKZSW+v+AqpVi+kSHUNvzZjeWx7NpiRIVntgsak=; b=hulEPriAO8VWOmxlGTlYXvpPRFaptEElmgJjHjJ9u1NuDsHvxLYfXjU3HrXHiARgAF GRsKRtTY9PQshCMB1Y6goyuePtO61a2zBgWimMf9uXB4l7FzTgZ4NzTEGkzss6FBNsaw 7iy8t6RUtd0w6ARllzNqpyrwrBogOt9xBs1H4= 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=j48kBKZSW+v+AqpVi+kSHUNvzZjeWx7NpiRIVntgsak=; b=cPnhMZsCQQiCS8vTShgSYHhQdlUSeKeAfl0NlvcyRepHulPX/+onburi1w8oAUuiiL Lz8RM0IE0issDuigHXVZURiNh7kumTyEgPVpWNaU1tE4Uvl9JuRZDoz/02EKfnV/KcLl hBpSNIB15Rw6fw/Z2IOJEE/hZo4M36rhxDnxhmJCXCg5Qfk3XhKp+Ipu7J9mImog8yTe alobXkN507ZDe50Gyd3/4tARH0Bq9VXOyON6FK87nxLCCwfZFdq36p9Z71BCbk7viDJv yqtB8SShOms+V1PBFqGdnEVEqoATk6BZEEihWRUQkmE64N10vhNmdbrkKnH02W0vKZ/F 5ySQ== X-Gm-Message-State: AEkoouunjgHfVxUUdpgof6KKiRgITz00Bn4faAp0h7p1mvscelQJmmgVTNtSqzABFt+02QO4 X-Received: by 10.107.4.17 with SMTP id 17mr12710236ioe.57.1470932469098; Thu, 11 Aug 2016 09:21:09 -0700 (PDT) Received: from t430.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id d71sm1605485ioj.33.2016.08.11.09.21.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 11 Aug 2016 09:21:08 -0700 (PDT) From: Mathieu Poirier To: peterz@infradead.org Cc: acme@kernel.org, jolsa@kernel.org, mingo@redhat.com, vince@deater.net, mtk.manpages@gmail.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Mathieu Poirier Subject: [PATCH V5 1/9] tools: Copy the header file needed by perf tools Date: Thu, 11 Aug 2016 10:20:56 -0600 Message-Id: <1470932464-726-2-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1470932464-726-1-git-send-email-mathieu.poirier@linaro.org> References: <1470932464-726-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 Directly accessing kernel files is not allowed anymore. As such making file coresight-pmu.h accessible by the perf tools and complain if this copy strays from the one found in the main kernel tree. Signed-off-by: Mathieu Poirier --- tools/include/linux/coresight-pmu.h | 39 +++++++++++++++++++++++++++++++++++++ tools/perf/MANIFEST | 1 + tools/perf/Makefile.perf | 3 +++ 3 files changed, 43 insertions(+) create mode 100644 tools/include/linux/coresight-pmu.h -- 2.7.4 diff --git a/tools/include/linux/coresight-pmu.h b/tools/include/linux/coresight-pmu.h new file mode 100644 index 000000000000..7d410260661b --- /dev/null +++ b/tools/include/linux/coresight-pmu.h @@ -0,0 +1,39 @@ +/* + * 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 . + */ + +#ifndef _LINUX_CORESIGHT_PMU_H +#define _LINUX_CORESIGHT_PMU_H + +#define CORESIGHT_ETM_PMU_NAME "cs_etm" +#define CORESIGHT_ETM_PMU_SEED 0x10 + +/* ETMv3.5/PTM's ETMCR config bit */ +#define ETM_OPT_CYCACC 12 +#define ETM_OPT_TS 28 + +static inline int coresight_get_trace_id(int cpu) +{ + /* + * A trace ID of value 0 is invalid, so let's start at some + * random value that fits in 7 bits and go from there. Since + * the common convention is to have data trace IDs be I(N) + 1, + * set instruction trace IDs as a function of the CPU number. + */ + return (CORESIGHT_ETM_PMU_SEED + (cpu * 2)); +} + +#endif diff --git a/tools/perf/MANIFEST b/tools/perf/MANIFEST index ad2534df4ba6..f181c613d9aa 100644 --- a/tools/perf/MANIFEST +++ b/tools/perf/MANIFEST @@ -77,4 +77,5 @@ tools/include/linux/stringify.h tools/include/linux/types.h tools/include/linux/err.h tools/include/linux/bitmap.h +tools/include/linux/coresight-pmu.h tools/arch/*/include/uapi/asm/perf_regs.h diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index 2d9087501633..aa7ab23fbc9f 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -429,6 +429,9 @@ $(PERF_IN): prepare FORCE @(test -f ../../include/asm-generic/bitops/fls64.h && ( \ (diff -B ../include/asm-generic/bitops/fls64.h ../../include/asm-generic/bitops/fls64.h >/dev/null) \ || echo "Warning: tools/include/asm-generic/bitops/fls64.h differs from kernel" >&2 )) || true + @(test -f ../../include/linux/coresight-pmu.h && ( \ + (diff -B ../include/linux/coresight-pmu.h ../../include/linux/coresight-pmu.h >/dev/null) \ + || echo "Warning: tools/include/linux/coresight-pmu.h differs from kernel" >&2 )) || true $(Q)$(MAKE) $(build)=perf $(OUTPUT)perf: $(PERFLIBS) $(PERF_IN) $(LIBTRACEEVENT_DYNAMIC_LIST)