From patchwork Sun Oct 18 18:24:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 55192 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by patches.linaro.org (Postfix) with ESMTPS id 5A7A222FFA for ; Sun, 18 Oct 2015 18:26:48 +0000 (UTC) Received: by wikv3 with SMTP id v3sf10444324wik.1 for ; Sun, 18 Oct 2015 11:26:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=mOzgWPdf+1uJ4m1tkaGSB/JeTg3EB++HPXPl7PPou38=; b=J1x2tuIlJqNkzN3SZv2zOk8emE8wSyjCG9trruA6AOs3CVBU+Om+la68a1t9dWkLzT 2KIQQFPo4Dlntta4YWV1rZj8ps2W/0OcFLI+YNNYcAgk8E2KDXaa/gNZovNahfAaK61e l3r0+8QK9nUhObCCEpsr6RU6WhU6ZMzwu5YjZ1qMbfk91UzpZkV4RlkWC4f0QPYQQ+f3 54i1aOC9LQffcW/ikfc5qkVvGo0sKI0YDN0/1V6XYpidnJT0srFFU0a/4lB09sRgoyXI H6/n5Zt9Ms3FGlSqZKgk6KOW4Veuyk83kOrBpdBi0lwpiecF93a0ra0Gt6w6GnoB0Qew eGXQ== X-Gm-Message-State: ALoCoQnnPN+nOQb7akevLy/oNP6dSQpzTTwPjH3x0KMDDpUqsBaj2Ny8m0z3INkXRSaZS5hSZ2Sf X-Received: by 10.194.192.71 with SMTP id he7mr5918670wjc.2.1445192807691; Sun, 18 Oct 2015 11:26:47 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.80.140 with SMTP id e134ls515044lfb.42.gmail; Sun, 18 Oct 2015 11:26:47 -0700 (PDT) X-Received: by 10.112.62.194 with SMTP id a2mr11836220lbs.80.1445192807512; Sun, 18 Oct 2015 11:26:47 -0700 (PDT) Received: from mail-lf0-f47.google.com (mail-lf0-f47.google.com. [209.85.215.47]) by mx.google.com with ESMTPS id m198si17821487lfb.78.2015.10.18.11.26.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 18 Oct 2015 11:26:47 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 as permitted sender) client-ip=209.85.215.47; Received: by lffy185 with SMTP id y185so97440436lff.2 for ; Sun, 18 Oct 2015 11:26:47 -0700 (PDT) X-Received: by 10.25.207.82 with SMTP id f79mr8452588lfg.73.1445192807147; Sun, 18 Oct 2015 11:26:47 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp1078110lbq; Sun, 18 Oct 2015 11:26:46 -0700 (PDT) X-Received: by 10.67.3.2 with SMTP id bs2mr29695225pad.118.1445192805980; Sun, 18 Oct 2015 11:26:45 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id rq7si46463946pab.73.2015.10.18.11.26.45; Sun, 18 Oct 2015 11:26: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; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752752AbbJRS01 (ORCPT + 28 others); Sun, 18 Oct 2015 14:26:27 -0400 Received: from mail-pa0-f49.google.com ([209.85.220.49]:33037 "EHLO mail-pa0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752617AbbJRS0T (ORCPT ); Sun, 18 Oct 2015 14:26:19 -0400 Received: by pabrc13 with SMTP id rc13so167573099pab.0 for ; Sun, 18 Oct 2015 11:26:18 -0700 (PDT) X-Received: by 10.66.221.104 with SMTP id qd8mr30428935pac.155.1445192778717; Sun, 18 Oct 2015 11:26:18 -0700 (PDT) Received: from t430.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [184.64.168.246]) by smtp.gmail.com with ESMTPSA id hq1sm20402076pbb.43.2015.10.18.11.26.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 18 Oct 2015 11:26:18 -0700 (PDT) From: Mathieu Poirier To: gregkh@linuxfoundation.org, a.p.zijlstra@chello.nl, alexander.shishkin@linux.intel.com, acme@kernel.org, mingo@redhat.com, corbet@lwn.net, nicolas.pitre@linaro.org Cc: adrian.hunter@intel.com, zhang.chunyan@linaro.org, mike.leach@arm.com, tor@ti.com, al.grant@arm.com, pawel.moll@arm.com, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, mathieu.poirier@linaro.org Subject: [PATCH V2 27/30] perf build: adding X86 auxiliary specific flags Date: Sun, 18 Oct 2015 12:24:44 -0600 Message-Id: <1445192687-24112-28-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1445192687-24112-1-git-send-email-mathieu.poirier@linaro.org> References: <1445192687-24112-1-git-send-email-mathieu.poirier@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: mathieu.poirier@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Adding an X86 specific flag to split AUX components that are generic and specific to architectures. That way the auxiliary area mechanic can be compiled in for other architecture without including X86 specific code. Signed-off-by: Mathieu Poirier --- tools/perf/arch/x86/util/Build | 6 +++--- tools/perf/arch/x86/util/pmu.c | 2 +- tools/perf/builtin-inject.c | 2 +- tools/perf/builtin-record.c | 2 +- tools/perf/config/Makefile | 3 ++- tools/perf/util/Build | 6 +++--- tools/perf/util/auxtrace.h | 2 +- tools/perf/util/intel-bts.h | 11 +++++++++++ tools/perf/util/intel-pt-decoder/Build | 2 +- tools/perf/util/intel-pt.h | 15 +++++++++++++++ 10 files changed, 39 insertions(+), 12 deletions(-) diff --git a/tools/perf/arch/x86/util/Build b/tools/perf/arch/x86/util/Build index ff63649fa9ac..f6b1ba8b6aad 100644 --- a/tools/perf/arch/x86/util/Build +++ b/tools/perf/arch/x86/util/Build @@ -9,6 +9,6 @@ libperf-$(CONFIG_DWARF) += dwarf-regs.o libperf-$(CONFIG_LIBUNWIND) += unwind-libunwind.o libperf-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o -libperf-$(CONFIG_AUXTRACE) += auxtrace.o -libperf-$(CONFIG_AUXTRACE) += intel-pt.o -libperf-$(CONFIG_AUXTRACE) += intel-bts.o +libperf-$(CONFIG_AUXTRACE_X86) += auxtrace.o +libperf-$(CONFIG_AUXTRACE_X86) += intel-pt.o +libperf-$(CONFIG_AUXTRACE_X86) += intel-bts.o diff --git a/tools/perf/arch/x86/util/pmu.c b/tools/perf/arch/x86/util/pmu.c index 79fe07158d00..eef512b9a1bf 100644 --- a/tools/perf/arch/x86/util/pmu.c +++ b/tools/perf/arch/x86/util/pmu.c @@ -8,7 +8,7 @@ struct perf_event_attr *perf_pmu__get_default_config(struct perf_pmu *pmu __maybe_unused) { -#ifdef HAVE_AUXTRACE_SUPPORT +#ifdef HAVE_AUXTRACE_SUPPORT_X86 if (!strcmp(pmu->name, INTEL_PT_PMU_NAME)) return intel_pt_pmu_default_config(pmu); if (!strcmp(pmu->name, INTEL_BTS_PMU_NAME)) diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c index f62c49b35be0..c19e034b4023 100644 --- a/tools/perf/builtin-inject.c +++ b/tools/perf/builtin-inject.c @@ -95,7 +95,7 @@ static int perf_event__repipe_attr(struct perf_tool *tool, return perf_event__repipe_synth(tool, event); } -#ifdef HAVE_AUXTRACE_SUPPORT +#ifdef HAVE_AUXTRACE_SUPPORT_X86 static int copy_bytes(struct perf_inject *inject, int fd, off_t size) { diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 142eeb341b29..39cbbdb07891 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -141,7 +141,7 @@ static void record__sig_exit(void) raise(signr); } -#ifdef HAVE_AUXTRACE_SUPPORT +#ifdef HAVE_AUXTRACE_SUPPORT_X86 static int record__process_auxtrace(struct perf_tool *tool, union perf_event *event, void *data1, diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile index 38a08539f4bf..5fd4843c691d 100644 --- a/tools/perf/config/Makefile +++ b/tools/perf/config/Makefile @@ -631,7 +631,8 @@ ifndef NO_AUXTRACE NO_AUXTRACE := 1 else $(call detected,CONFIG_AUXTRACE) - CFLAGS += -DHAVE_AUXTRACE_SUPPORT + $(call detected,CONFIG_AUXTRACE_X86) + CFLAGS += -DHAVE_AUXTRACE_SUPPORT_X86 endif endif diff --git a/tools/perf/util/Build b/tools/perf/util/Build index e5f18a288b74..448d83b00925 100644 --- a/tools/perf/util/Build +++ b/tools/perf/util/Build @@ -80,9 +80,9 @@ libperf-$(CONFIG_AUXTRACE) += tsc.o libperf-y += cloexec.o libperf-y += thread-stack.o libperf-$(CONFIG_AUXTRACE) += auxtrace.o -libperf-$(CONFIG_AUXTRACE) += intel-pt-decoder/ -libperf-$(CONFIG_AUXTRACE) += intel-pt.o -libperf-$(CONFIG_AUXTRACE) += intel-bts.o +libperf-$(CONFIG_AUXTRACE_X86) += intel-pt-decoder/ +libperf-$(CONFIG_AUXTRACE_X86) += intel-pt.o +libperf-$(CONFIG_AUXTRACE_X86) += intel-bts.o libperf-y += parse-branch-options.o libperf-y += parse-regs-options.o diff --git a/tools/perf/util/auxtrace.h b/tools/perf/util/auxtrace.h index d76177169484..b9ac99fb5a17 100644 --- a/tools/perf/util/auxtrace.h +++ b/tools/perf/util/auxtrace.h @@ -309,7 +309,7 @@ struct auxtrace_record { unsigned int alignment; }; -#ifdef HAVE_AUXTRACE_SUPPORT +#ifdef HAVE_AUXTRACE_SUPPORT_X86 /* * In snapshot mode the mmapped page is read-only which makes using diff --git a/tools/perf/util/intel-bts.h b/tools/perf/util/intel-bts.h index ca65e21b3e83..1ef679a9e9c2 100644 --- a/tools/perf/util/intel-bts.h +++ b/tools/perf/util/intel-bts.h @@ -35,9 +35,20 @@ struct perf_tool; union perf_event; struct perf_session; +#ifdef HAVE_AUXTRACE_SUPPORT_X86 struct auxtrace_record *intel_bts_recording_init(int *err); int intel_bts_process_auxtrace_info(union perf_event *event, struct perf_session *session); +#else +static inline +struct auxtrace_record *intel_bts_recording_init(int *err __maybe_unused) +{ return NULL; } + +static inline int +intel_bts_process_auxtrace_info(union perf_event *event __maybe_unused, + struct perf_session *session __maybe_unused) +{ return -EINVAL; } +#endif #endif diff --git a/tools/perf/util/intel-pt-decoder/Build b/tools/perf/util/intel-pt-decoder/Build index 2386322ece4f..76437e99c659 100644 --- a/tools/perf/util/intel-pt-decoder/Build +++ b/tools/perf/util/intel-pt-decoder/Build @@ -1,4 +1,4 @@ -libperf-$(CONFIG_AUXTRACE) += intel-pt-pkt-decoder.o intel-pt-insn-decoder.o intel-pt-log.o intel-pt-decoder.o +libperf-$(CONFIG_AUXTRACE_X86) += intel-pt-pkt-decoder.o intel-pt-insn-decoder.o intel-pt-log.o intel-pt-decoder.o inat_tables_script = util/intel-pt-decoder/gen-insn-attr-x86.awk inat_tables_maps = util/intel-pt-decoder/x86-opcode-map.txt diff --git a/tools/perf/util/intel-pt.h b/tools/perf/util/intel-pt.h index 0065949df693..94dd268718f6 100644 --- a/tools/perf/util/intel-pt.h +++ b/tools/perf/util/intel-pt.h @@ -46,11 +46,26 @@ struct perf_session; struct perf_event_attr; struct perf_pmu; +#ifdef HAVE_AUXTRACE_SUPPORT_X86 struct auxtrace_record *intel_pt_recording_init(int *err); int intel_pt_process_auxtrace_info(union perf_event *event, struct perf_session *session); struct perf_event_attr *intel_pt_pmu_default_config(struct perf_pmu *pmu); +#else +static inline +struct auxtrace_record *intel_pt_recording_init(int *err __maybe_unused) +{ return NULL; } + +static inline +int intel_pt_process_auxtrace_info(union perf_event *event __maybe_unused, + struct perf_session *session __maybe_unused) +{ return -EINVAL; } + +static inline struct perf_event_attr +*intel_pt_pmu_default_config(struct perf_pmu *pmu __maybe_unused) +{ return NULL; } +#endif #endif