From patchwork Wed Nov 11 22:18:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 7598641 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 584FCBF90C for ; Wed, 11 Nov 2015 22:32:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 61A53205F5 for ; Wed, 11 Nov 2015 22:32:55 +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 7E9FD205BA for ; Wed, 11 Nov 2015 22:32:54 +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 1Zwduf-000334-7F; Wed, 11 Nov 2015 22:30:45 +0000 Received: from merlin.infradead.org ([2001:4978:20e::2]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zwdkb-0007H0-RW for linux-arm-kernel@bombadil.infradead.org; Wed, 11 Nov 2015 22:20:21 +0000 Received: from mail-pa0-x236.google.com ([2607:f8b0:400e:c03::236]) by merlin.infradead.org with esmtps (Exim 4.85 #2 (Red Hat Linux)) id 1Zwdka-0004GY-Ef for linux-arm-kernel@lists.infradead.org; Wed, 11 Nov 2015 22:20:20 +0000 Received: by pacdm15 with SMTP id dm15so42819679pac.3 for ; Wed, 11 Nov 2015 14:19:58 -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=kzzyp1zBClbEIXtatP9/PSc3su2k169fo/9iB0O7dws=; b=hR8o6rnAvOq/B69u+FcWhHOPDKLOQLdhtkfv/cj59ZK1Kp3G8apBV5Ru2i+UN2BWkV nTL2/rCai1Da7mXJZUQ8Lk+P3f0OY1i7eHWZ70+BypvjzzTjkNPLTWDqmNSr6SN3Nwxv u7Ht7CBqNP95sCvZkALFQR7pwwMhznRwgLMjbUA9YKNZxcaH/yMHZDE/4HUEvM/SxyuN vHuAFI9Iwu6rhX5HKVL7wo68a1dyW+rTLSqLAEGaQ2/76ELgW64th4Z/6+p8Hz6rMGq5 m9qyiRG9Iie5h+IGWIH6lYbzYlBGxMXBYpZfqzaX4doZ1M8gjc75V2Af4RD9O7Eh7W8w jM/w== 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=kzzyp1zBClbEIXtatP9/PSc3su2k169fo/9iB0O7dws=; b=Gmi329uGTxW3wctDUMjlz//oqwBIeUKYTIZvT9FymQ8n2Ix+ZSJi1MQNYdCYxVRP1Y T2R3pl/7dU7t/LdLhiWcjyqXi8twq48zQoZ8zcxCVHKCHu9gEOPtckRj9Y1zf0Po9YMa 9UAFPG3Wld2nLygiNPUzQMSu43wR1mu4Rp52XAAzudQ+8UOJpTR0mN7CA+3t/AGfWtQP fP0gHH7X8ZnhFz8ctZvWtALgKKPc/I/JpQlSrpiPtiX6UV6GryGE8AEpFxZve3iIeZxY bGQWtOJCVDW7Rh+d6S4i+1r5YFXBjJfrwJXUfr+nHxHo+acjJMVLWTfig1Hl2WYeuS3M 4DjQ== X-Gm-Message-State: ALoCoQn67LqxfmqrQkeps1D+Y7nbz29RoRUYemcKf3yYSgdVKXvZRcC3scNQHGeZJhMR+tV6XqGA X-Received: by 10.66.156.1 with SMTP id wa1mr18335427pab.84.1447280398630; Wed, 11 Nov 2015 14:19:58 -0800 (PST) Received: from t430.cg.shawcable.net ([184.64.168.246]) by smtp.gmail.com with ESMTPSA id h10sm11156697pat.7.2015.11.11.14.19.57 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 11 Nov 2015 14:19:58 -0800 (PST) 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 Subject: [PATCH V3 24/26] perf tools: adding perf_session to *info_prive_size() Date: Wed, 11 Nov 2015 15:18:14 -0700 Message-Id: <1447280296-19147-25-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1447280296-19147-1-git-send-email-mathieu.poirier@linaro.org> References: <1447280296-19147-1-git-send-email-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151111_172020_638064_31AFFDB2 X-CRM114-Status: GOOD ( 14.44 ) 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@linaro.org, pawel.moll@arm.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, fainelli@broadcom.com, adrian.hunter@intel.com, tor@ti.com, mike.leach@arm.com, zhang.chunyan@linaro.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-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,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. 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 2ca10d796c0b..1fd9a16f668c 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 a980e7c50ee0..430df9575dbe 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 bf72b77a588a..d76177169484 100644 --- a/tools/perf/util/auxtrace.h +++ b/tools/perf/util/auxtrace.h @@ -289,7 +289,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, @@ -425,7 +426,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,