From patchwork Mon Nov 30 02:14:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 7720581 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B3A239F30B for ; Mon, 30 Nov 2015 02:30:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CB9D32058E for ; Mon, 30 Nov 2015 02:30:57 +0000 (UTC) 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.kernel.org (Postfix) with ESMTPS id DBA8020573 for ; Mon, 30 Nov 2015 02:30:56 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1a3EDQ-0001nT-IG; Mon, 30 Nov 2015 02:29:20 +0000 Received: from mail-pa0-x236.google.com ([2607:f8b0:400e:c03::236]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1a3E2j-0006CV-Gr for linux-arm-kernel@lists.infradead.org; Mon, 30 Nov 2015 02:18:21 +0000 Received: by padhx2 with SMTP id hx2so168049546pad.1 for ; Sun, 29 Nov 2015 18:17:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=oxMHm8Z/W6Fxm4/FZRkofuCrWyV0UNv6GHc9bzig91U=; b=cu7CTcc4hoXDVpPzS2KQy5dH50jnHIQRjukiZIq5BlR+GBq9PP1BODNDbe+TpucidN Az+ZUZOePVwXqCDxYa4wLC6CfYyYwJYfHRfqlZJNXwmncY08o93tcwaEhI+XnGkAOBLt y7HiaoafL74qmjdti5WBdSZOLSchJs7bdWJ+z/rYoFehdyih3nxkddsa/kFF7/ZU0rYW LXY0o4zCh1y7wPG1dHjyEl2mmfHNTp9NQzv44mevI3+bvNxB5nlnF5IUfLfDUSGTk0L2 i5VG0SbpkedkEOxZt99HUxiqvptOW3OxqK5N27LPPSP2avcx3/Om5gfx5CyWQiF4BwB8 ITxQ== 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=oxMHm8Z/W6Fxm4/FZRkofuCrWyV0UNv6GHc9bzig91U=; b=GEsXDC+wu9QVMfRolC/sNbqDgnvPSt35+LslPg+w5RcsDZA77C5QFg4SPbJY/CT4vh tDHDi5bcu02K5+sfaUeOANPEthC1FrHuWxQpNT8quTFkYfC1G4vjMOUKRNq/ltN+5QLW Ck7KLhhrDw4fhUGMNPJltQ1aIrbP+uAmy8XSsuXjvt55sJ/XDBC8AXsovBT5c0+N4Fl3 WEfug/VkhgYeUIQYIsqqkwQ5HWHYx/h5sNe7bKxbXNCQZGumYRh7tTDiD/yXs7BPN+lX YTDaTpKl7s8brToVES9PU0ypfI7YBxFduWfHaYybJJIEF60rbOafHb1Vn9nuMwZLcaMF zZeg== X-Gm-Message-State: ALoCoQnihShMDvytAf12TtKO3x72KOZEJdytlgqGjYucPtWeITS7DEMM6MK/MlUrchFfFllhk63t X-Received: by 10.66.144.103 with SMTP id sl7mr72350524pab.3.1448849879215; Sun, 29 Nov 2015 18:17:59 -0800 (PST) Received: from t430.cg.shawcable.net ([184.64.168.246]) by smtp.gmail.com with ESMTPSA id n16sm47168818pfa.53.2015.11.29.18.17.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 29 Nov 2015 18:17:58 -0800 (PST) From: Mathieu Poirier To: gregkh@linuxfoundation.org, alexander.shishkin@linux.intel.com Subject: [PATCH V5 24/26] perf tools: adding perf_session to *info_prive_size() Date: Sun, 29 Nov 2015 19:14:45 -0700 Message-Id: <1448849687-5724-25-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1448849687-5724-1-git-send-email-mathieu.poirier@linaro.org> References: <1448849687-5724-1-git-send-email-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151129_181817_809501_1165F91E X-CRM114-Status: GOOD ( 12.33 ) X-Spam-Score: -2.6 (--) 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: al.grant@arm.com, Mathieu Poirier , pawel.moll@arm.com, linux-doc@vger.kernel.org, fainelli@broadcom.com, linux-kernel@vger.kernel.org, Arnaldo Carvalho de Melo , tor@ti.com, Ingo Molnar , mike.leach@arm.com, zhang.chunyan@linaro.org, linux-arm-kernel@lists.infradead.org, Peter Zijlstra MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On some architecture the size of the private header may be dependent on the number of tracers used in the session. As such adding a "struct perf_session" parameter, which should contain all the required information. Also adjusting the existing client of the interface to take the new parameter into account. Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Arnaldo Carvalho de Melo Signed-off-by: Mathieu Poirier --- tools/perf/arch/x86/util/intel-bts.c | 4 +++- tools/perf/arch/x86/util/intel-pt.c | 4 +++- tools/perf/util/auxtrace.c | 7 ++++--- tools/perf/util/auxtrace.h | 6 ++++-- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/tools/perf/arch/x86/util/intel-bts.c b/tools/perf/arch/x86/util/intel-bts.c index 9b94ce520917..6efdc5e86d97 100644 --- a/tools/perf/arch/x86/util/intel-bts.c +++ b/tools/perf/arch/x86/util/intel-bts.c @@ -60,7 +60,9 @@ struct branch { u64 misc; }; -static size_t intel_bts_info_priv_size(struct auxtrace_record *itr __maybe_unused) +static size_t +intel_bts_info_priv_size(struct auxtrace_record *itr __maybe_unused, + struct perf_session *session __maybe_unused) { return INTEL_BTS_AUXTRACE_PRIV_SIZE; } diff --git a/tools/perf/arch/x86/util/intel-pt.c b/tools/perf/arch/x86/util/intel-pt.c index b02af064f0f9..ad4e45c6eb9d 100644 --- a/tools/perf/arch/x86/util/intel-pt.c +++ b/tools/perf/arch/x86/util/intel-pt.c @@ -273,7 +273,9 @@ intel_pt_pmu_default_config(struct perf_pmu *intel_pt_pmu) return attr; } -static size_t intel_pt_info_priv_size(struct auxtrace_record *itr __maybe_unused) +static size_t +intel_pt_info_priv_size(struct auxtrace_record *itr __maybe_unused, + struct perf_session *session __maybe_unused) { return INTEL_PT_AUXTRACE_PRIV_SIZE; } diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c index 7f10430af39c..90dc11ccf929 100644 --- a/tools/perf/util/auxtrace.c +++ b/tools/perf/util/auxtrace.c @@ -478,10 +478,11 @@ void auxtrace_heap__pop(struct auxtrace_heap *heap) heap_array[last].ordinal); } -size_t auxtrace_record__info_priv_size(struct auxtrace_record *itr) +size_t auxtrace_record__info_priv_size(struct auxtrace_record *itr, + struct perf_session *session) { if (itr) - return itr->info_priv_size(itr); + return itr->info_priv_size(itr, session); return 0; } @@ -852,7 +853,7 @@ int perf_event__synthesize_auxtrace_info(struct auxtrace_record *itr, int err; pr_debug2("Synthesizing auxtrace information\n"); - priv_size = auxtrace_record__info_priv_size(itr); + priv_size = auxtrace_record__info_priv_size(itr, session); ev = zalloc(sizeof(struct auxtrace_info_event) + priv_size); if (!ev) return -ENOMEM; diff --git a/tools/perf/util/auxtrace.h b/tools/perf/util/auxtrace.h index b86f90db1352..4bace9a396a6 100644 --- a/tools/perf/util/auxtrace.h +++ b/tools/perf/util/auxtrace.h @@ -293,7 +293,8 @@ struct auxtrace_record { int (*recording_options)(struct auxtrace_record *itr, struct perf_evlist *evlist, struct record_opts *opts); - size_t (*info_priv_size)(struct auxtrace_record *itr); + size_t (*info_priv_size)(struct auxtrace_record *itr, + struct perf_session *session); int (*info_fill)(struct auxtrace_record *itr, struct perf_session *session, struct auxtrace_info_event *auxtrace_info, @@ -429,7 +430,8 @@ int auxtrace_parse_snapshot_options(struct auxtrace_record *itr, int auxtrace_record__options(struct auxtrace_record *itr, struct perf_evlist *evlist, struct record_opts *opts); -size_t auxtrace_record__info_priv_size(struct auxtrace_record *itr); +size_t auxtrace_record__info_priv_size(struct auxtrace_record *itr, + struct perf_session *session); int auxtrace_record__info_fill(struct auxtrace_record *itr, struct perf_session *session, struct auxtrace_info_event *auxtrace_info,