linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Adrian Hunter <adrian.hunter@intel.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>, Ian Rogers <irogers@google.com>,
	Alexey Bayduraev <alexey.v.bayduraev@linux.intel.com>,
	Namhyung Kim <namhyung@kernel.org>, Leo Yan <leo.yan@linaro.org>,
	linux-kernel@vger.kernel.org
Subject: [PATCH RFC 09/21] perf auxtrace: Record whether an auxtrace mmap is needed
Date: Fri, 22 Apr 2022 19:23:50 +0300	[thread overview]
Message-ID: <20220422162402.147958-10-adrian.hunter@intel.com> (raw)
In-Reply-To: <20220422162402.147958-1-adrian.hunter@intel.com>

Add a flag needs_auxtrace_mmap to record whether an auxtrace mmap is
needed, in preparation for correctly determining whether or not an
auxtrace mmap is needed.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
 tools/perf/arch/arm/util/cs-etm.c    | 1 +
 tools/perf/arch/arm64/util/arm-spe.c | 1 +
 tools/perf/arch/s390/util/auxtrace.c | 1 +
 tools/perf/arch/x86/util/intel-bts.c | 1 +
 tools/perf/arch/x86/util/intel-pt.c  | 1 +
 tools/perf/util/evsel.h              | 1 +
 6 files changed, 6 insertions(+)

diff --git a/tools/perf/arch/arm/util/cs-etm.c b/tools/perf/arch/arm/util/cs-etm.c
index 11c71aa219f7..1b54638d53b0 100644
--- a/tools/perf/arch/arm/util/cs-etm.c
+++ b/tools/perf/arch/arm/util/cs-etm.c
@@ -319,6 +319,7 @@ static int cs_etm_recording_options(struct auxtrace_record *itr,
 			}
 			evsel->core.attr.freq = 0;
 			evsel->core.attr.sample_period = 1;
+			evsel->needs_auxtrace_mmap = true;
 			cs_etm_evsel = evsel;
 			opts->full_auxtrace = true;
 		}
diff --git a/tools/perf/arch/arm64/util/arm-spe.c b/tools/perf/arch/arm64/util/arm-spe.c
index af4d63af8072..e24c22f187df 100644
--- a/tools/perf/arch/arm64/util/arm-spe.c
+++ b/tools/perf/arch/arm64/util/arm-spe.c
@@ -159,6 +159,7 @@ static int arm_spe_recording_options(struct auxtrace_record *itr,
 			}
 			evsel->core.attr.freq = 0;
 			evsel->core.attr.sample_period = arm_spe_pmu->default_config->sample_period;
+			evsel->needs_auxtrace_mmap = true;
 			arm_spe_evsel = evsel;
 			opts->full_auxtrace = true;
 		}
diff --git a/tools/perf/arch/s390/util/auxtrace.c b/tools/perf/arch/s390/util/auxtrace.c
index 0db5c58c98e8..5068baa3e092 100644
--- a/tools/perf/arch/s390/util/auxtrace.c
+++ b/tools/perf/arch/s390/util/auxtrace.c
@@ -98,6 +98,7 @@ struct auxtrace_record *auxtrace_record__init(struct evlist *evlist,
 	evlist__for_each_entry(evlist, pos) {
 		if (pos->core.attr.config == PERF_EVENT_CPUM_SF_DIAG) {
 			diagnose = 1;
+			pos->needs_auxtrace_mmap = true;
 			break;
 		}
 	}
diff --git a/tools/perf/arch/x86/util/intel-bts.c b/tools/perf/arch/x86/util/intel-bts.c
index d68a0f48e41e..bcccfbade5c6 100644
--- a/tools/perf/arch/x86/util/intel-bts.c
+++ b/tools/perf/arch/x86/util/intel-bts.c
@@ -129,6 +129,7 @@ static int intel_bts_recording_options(struct auxtrace_record *itr,
 			}
 			evsel->core.attr.freq = 0;
 			evsel->core.attr.sample_period = 1;
+			evsel->needs_auxtrace_mmap = true;
 			intel_bts_evsel = evsel;
 			opts->full_auxtrace = true;
 		}
diff --git a/tools/perf/arch/x86/util/intel-pt.c b/tools/perf/arch/x86/util/intel-pt.c
index 38ec2666ec12..2eaac4638aab 100644
--- a/tools/perf/arch/x86/util/intel-pt.c
+++ b/tools/perf/arch/x86/util/intel-pt.c
@@ -649,6 +649,7 @@ static int intel_pt_recording_options(struct auxtrace_record *itr,
 			evsel->core.attr.freq = 0;
 			evsel->core.attr.sample_period = 1;
 			evsel->no_aux_samples = true;
+			evsel->needs_auxtrace_mmap = true;
 			intel_pt_evsel = evsel;
 			opts->full_auxtrace = true;
 		}
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h
index 041b42d33bf5..1a07694afbdd 100644
--- a/tools/perf/util/evsel.h
+++ b/tools/perf/util/evsel.h
@@ -120,6 +120,7 @@ struct evsel {
 	bool			merged_stat;
 	bool			reset_group;
 	bool			errored;
+	bool			needs_auxtrace_mmap;
 	struct hashmap		*per_pkg_mask;
 	int			err;
 	struct {
-- 
2.25.1


  parent reply	other threads:[~2022-04-22 16:25 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-22 16:23 [PATCH RFC 00/21] perf intel-pt: Better support for perf record --cpu Adrian Hunter
2022-04-22 16:23 ` [PATCH RFC 01/21] libperf evsel: Factor out perf_evsel__ioctl() Adrian Hunter
2022-04-22 19:05   ` Arnaldo Carvalho de Melo
2022-04-22 16:23 ` [PATCH RFC 02/21] libperf evsel: Add perf_evsel__enable_thread() Adrian Hunter
2022-04-27 21:48   ` Namhyung Kim
2022-04-28  4:15     ` Adrian Hunter
2022-04-28 23:50       ` Namhyung Kim
2022-05-03 16:45   ` Ian Rogers
2022-04-22 16:23 ` [PATCH RFC 03/21] perf evlist: Use libperf functions in evlist__enable_event_idx() Adrian Hunter
2022-04-22 16:23 ` [PATCH RFC 04/21] perf auxtrace: Move evlist__enable_event_idx() to auxtrace.c Adrian Hunter
2022-04-22 16:23 ` [PATCH RFC 05/21] perf auxtrace: Do not mix up mmap idx Adrian Hunter
2022-04-27 21:54   ` Namhyung Kim
2022-04-28  4:29     ` Adrian Hunter
2022-04-22 16:23 ` [PATCH RFC 06/21] libperf evlist: Remove ->idx() per_cpu parameter Adrian Hunter
2022-04-22 16:23 ` [PATCH RFC 07/21] libperf evlist: Move ->idx() into mmap_per_evsel() Adrian Hunter
2022-04-22 16:23 ` [PATCH RFC 08/21] libperf evlist: Add evsel as a parameter to ->idx() Adrian Hunter
2022-04-22 16:23 ` Adrian Hunter [this message]
2022-04-22 16:23 ` [PATCH RFC 10/21] perf auxctrace: Add mmap_needed to auxtrace_mmap_params Adrian Hunter
2022-04-22 16:23 ` [PATCH RFC 11/21] perf auxtrace: Remove auxtrace_mmap_params__set_idx() per_cpu parameter Adrian Hunter
2022-04-22 16:23 ` [PATCH RFC 12/21] perf evlist: Factor out evlist__dummy_event() Adrian Hunter
2022-04-22 16:23 ` [PATCH RFC 13/21] perf evlist: Add evlist__add_system_wide_dummy() Adrian Hunter
2022-04-22 16:23 ` [PATCH RFC 14/21] perf record: Use evlist__add_system_wide_dummy() in record__config_text_poke() Adrian Hunter
2022-04-22 16:23 ` [PATCH RFC 15/21] perf intel-pt: Use evlist__add_system_wide_dummy() for switch tracking Adrian Hunter
2022-04-22 16:23 ` [PATCH RFC 16/21] perf intel-pt: Track sideband system-wide when needed Adrian Hunter
2022-04-22 16:23 ` [PATCH RFC 17/21] perf tools: Allow all_cpus to be a superset of user_requested_cpus Adrian Hunter
2022-05-03 17:41   ` Ian Rogers
2022-04-22 16:23 ` [PATCH RFC 18/21] libperf evlist: Allow mixing per-thread and per-cpu mmaps Adrian Hunter
2022-05-03 20:29   ` Namhyung Kim
2022-05-04  9:56     ` Adrian Hunter
2022-04-22 16:24 ` [PATCH RFC 19/21] perf stat: Add requires_cpu flag for uncore Adrian Hunter
2022-04-29 22:57   ` Namhyung Kim
2022-04-30  1:10     ` Ian Rogers
2022-04-22 16:24 ` [PATCH RFC 20/21] perf tools: Allow system-wide events to keep their own CPUs Adrian Hunter
2022-04-22 16:24 ` [PATCH RFC 21/21] perf tools: Allow system-wide events to keep their own threads Adrian Hunter
2022-05-03 18:09 ` [PATCH RFC 00/21] perf intel-pt: Better support for perf record --cpu Ian Rogers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220422162402.147958-10-adrian.hunter@intel.com \
    --to=adrian.hunter@intel.com \
    --cc=acme@kernel.org \
    --cc=alexey.v.bayduraev@linux.intel.com \
    --cc=irogers@google.com \
    --cc=jolsa@redhat.com \
    --cc=leo.yan@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=namhyung@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).