From patchwork Thu Jul 14 18:35:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 9230415 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 066AB607D0 for ; Thu, 14 Jul 2016 18:37:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F1191281DB for ; Thu, 14 Jul 2016 18:37:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E5A2A28305; Thu, 14 Jul 2016 18:37:39 +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 5C3FA281DB for ; Thu, 14 Jul 2016 18:37:39 +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 1bNlUk-0002m6-N7; Thu, 14 Jul 2016 18:36:22 +0000 Received: from mail-it0-x236.google.com ([2607:f8b0:4001:c0b::236]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bNlUW-0002ck-Gj for linux-arm-kernel@lists.infradead.org; Thu, 14 Jul 2016 18:36:09 +0000 Received: by mail-it0-x236.google.com with SMTP id h190so79703101ith.1 for ; Thu, 14 Jul 2016 11:35:47 -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=tWORCiKUZnGN31gNaCWM39EWVDgQOUlyIFql2vBu3oI=; b=Lf5DloTrth3fOPbewmHmVCGQNB1ww9yrOMRjcJIEPbBc0IdxAScLy5QiY+C9JmmY4I Tq14tmnJI9uCO8jTt3jqNauIKENIivgk8iillKxZx1iY62X9kCzdRUoCS3iFV7Kha9Y5 QdV4fxESm1c0VL6JNoMQmboczz38t6Cs81LZw= 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=tWORCiKUZnGN31gNaCWM39EWVDgQOUlyIFql2vBu3oI=; b=GdZmTHKoSemhl/8vDP9oYpMM+Kyw82nHPnePdAn9CM9wT1O5oB/vB4OMTtHfg0WQPG WLSUwxd/zdV46yMbiqBoMJwqVdGS5pVgMYe77XRQrX1cPlrpPwwIjiYVVXAeHSQkMqnL vJLktYOkZDmmBKStWz3J//ufDAY/zbz7q7IJgGElc4SWEGQmUMQv1a2mOm9hE4d0BAj3 SU8jAvwe+jHz8XthvZwp2HaaXNsx4c/5ZzQOKeN9Fulq3aL08n/wOB34wa8Bjr5n/mHe 1E0gEtlmRJ3dDHzU9kxPgASaAHHfWXqSOl+iYh+QxZihuqB/sCAoMMYdVaEywoqBCtuK gR3A== X-Gm-Message-State: ALyK8tLs9x3hiEYN9jD1lJpIWoKwmbHhxhOvM4c9+8JUbYdQF4rZf/UBLEkSiYK54+cATo1N X-Received: by 10.36.60.148 with SMTP id m142mr15123316ita.96.1468521347403; Thu, 14 Jul 2016 11:35:47 -0700 (PDT) Received: from t430.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id j12sm1700916ioi.36.2016.07.14.11.35.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 14 Jul 2016 11:35:47 -0700 (PDT) From: Mathieu Poirier To: acme@kernel.org Subject: [PATCH V2 1/3] tools: Copy the header file needed by perf tools Date: Thu, 14 Jul 2016 12:35:42 -0600 Message-Id: <1468521344-15047-2-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1468521344-15047-1-git-send-email-mathieu.poirier@linaro.org> References: <1468521344-15047-1-git-send-email-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160714_113608_692297_FCFBA03E X-CRM114-Status: GOOD ( 16.65 ) 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: adrian.hunter@intel.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.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 923eda2e7d52..475e6304db18 100644 --- a/tools/perf/MANIFEST +++ b/tools/perf/MANIFEST @@ -77,6 +77,7 @@ 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 include/asm-generic/bitops/arch_hweight.h include/asm-generic/bitops/const_hweight.h include/asm-generic/bitops/fls64.h diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index a129fbc1ed37..739af9493e14 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -411,6 +411,9 @@ $(PERF_IN): prepare FORCE @(test -f ../../arch/arm64/include/uapi/asm/kvm.h && ( \ (diff -B ../arch/arm64/include/uapi/asm/kvm.h ../../arch/arm64/include/uapi/asm/kvm.h >/dev/null) \ || echo "Warning: tools/arch/arm64/include/uapi/asm/kvm.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)