From patchwork Fri Nov 13 18:45:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 56538 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp1213921lbb; Fri, 13 Nov 2015 10:47:42 -0800 (PST) X-Received: by 10.66.153.166 with SMTP id vh6mr34600035pab.83.1447440462036; Fri, 13 Nov 2015 10:47:42 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id qg3si28931527pbb.100.2015.11.13.10.47.41; Fri, 13 Nov 2015 10:47:42 -0800 (PST) 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; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dkim=neutral (body hash did not verify) header.i=@linaro_org.20150623.gappssmtp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755108AbbKMSrk (ORCPT + 28 others); Fri, 13 Nov 2015 13:47:40 -0500 Received: from mail-pa0-f45.google.com ([209.85.220.45]:34679 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755014AbbKMSqy (ORCPT ); Fri, 13 Nov 2015 13:46:54 -0500 Received: by padhx2 with SMTP id hx2so107760451pad.1 for ; Fri, 13 Nov 2015 10:46:54 -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=Nd4sfxsZkmL2+CCTz6hbO0jRegl1NSzFGpJqqScNZoah4M8pSRIq6lGEd4QMwPv8bQ STHgGKC5T097Pke8/G39MouFy20ltzOm6dgXQ5ff3ZsnvyJaTH/1AEgGWXqKdTe4ILNZ aH5w8M53PLFA8WDEs9BUT6LIQuIkns0mCZZIfBQeFSFiuA3VRYqEP3bwSmj3WXXy8wvZ edTtFzRl5NZVEX6QhHhAcnu+YA+O9v7CjIVm00YDhfyZzGxEshZwS900/83ni5AGxopi 4R/MYrYA027OJVED6bPumV/WnOFYY+8UtLBUjojwafnDh6/V8VJcxktHZAngd7unnKgf OsPw== 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=ig/H4D11gT9IwKv+iaLikcELEPMkeNZW3fuAfz9NDjRs3pKVOHohROeNeXQP4hXvr5 vHih27f7W+bB22An2iYKUvMsPPOyBJAzy44WF/nFTf2cR/qoE/Mn3KdNSnqXcOtYLNo3 0AjfODCs1qIihA9vdIGTbPRMwcfxfAgSmDW7GgzZ8hNBYu82l9hn+3fCjwM/FeU7UusQ TpgOeAGj5EYK8T6QneyKYWyTNQqWr8RKVCAnwD2NSJQMETaDJ/LHImPkoB43yOG0Vi7a nGGBGZq+22SmxZNz1xmEtrZqp/MrU97K+cstVluvuziNRUtpP99NBrirdi2+sXeAV0Pm iyvw== X-Gm-Message-State: ALoCoQnYWYisF+I3vzmdrbLB7yRskIcQqIpOQuM7Ofh06qRNIoyXHCpMNk6DvT/yNYX9jlvZZ9OG X-Received: by 10.68.135.199 with SMTP id pu7mr33998307pbb.98.1447440414355; Fri, 13 Nov 2015 10:46:54 -0800 (PST) Received: from t430.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [184.64.168.246]) by smtp.gmail.com with ESMTPSA id xi7sm21737967pbc.56.2015.11.13.10.46.52 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 13 Nov 2015 10:46:53 -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 Cc: adrian.hunter@intel.com, zhang.chunyan@linaro.org, mike.leach@arm.com, tor@ti.com, al.grant@arm.com, pawel.moll@arm.com, fainelli@broadcom.com, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, mathieu.poirier@linaro.org Subject: [PATCH V4 24/26] perf tools: adding perf_session to *info_prive_size() Date: Fri, 13 Nov 2015 11:45:15 -0700 Message-Id: <1447440317-1977-25-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1447440317-1977-1-git-send-email-mathieu.poirier@linaro.org> References: <1447440317-1977-1-git-send-email-mathieu.poirier@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ 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,