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: 9275571 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9A599600CB for ; Thu, 11 Aug 2016 16:23:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8D9D42871C for ; Thu, 11 Aug 2016 16:23:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 825062871E; Thu, 11 Aug 2016 16:23:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DF08F2871C for ; Thu, 11 Aug 2016 16:23:37 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bXsjw-000363-NH; Thu, 11 Aug 2016 16:21:52 +0000 Received: from mail-io0-x235.google.com ([2607:f8b0:4001:c06::235]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bXsja-0002zC-3W for linux-arm-kernel@lists.infradead.org; Thu, 11 Aug 2016 16:21:31 +0000 Received: by mail-io0-x235.google.com with SMTP id b62so634022iod.3 for ; Thu, 11 Aug 2016 09:21:09 -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=Bx/AM7y2y8IuupL+m9IOelhBdsmkoenKbIWnyamT0DcCtEbhtebVKXQJS36kH+bdrh 4h6J3F41cDQP18oF/YnlTFyfd7g4TboZNfgTxmdateTHHT5n0DeJpHAdZABiWua/NuZ6 yaxtTcsFXZsszUrUlaUZinG3aJbDkkJ5zxmjrvimHpiB8k2ZJ4BUqLWGGYYlJtNWvyJT cpGkHLs+aP2m8VwyGoFtb97+gNTy1mAjaOMLOIeucWt/4VjncXWMMNE6s2ZzmV4n1ghD 4+gy4xnbLYgxFh9tSJIgbPG3Oedi2C6mgNuYSHc0qEvYu9gsFylfuVPeRQfAiCyy20JS r9rw== X-Gm-Message-State: AEkoousae3NyUytGKRPgbMvK5VIoiEzhkeRw3owL0Zk7GdYDAXAdsZsXHXQsMoemthpcSxeE 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160811_092130_233902_8AC30131 X-CRM114-Status: GOOD ( 16.29 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mathieu Poirier , linux-kernel@vger.kernel.org, acme@kernel.org, vince@deater.net, mingo@redhat.com, mtk.manpages@gmail.com, jolsa@kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 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)