All of lore.kernel.org
 help / color / mirror / Atom feed
From: Adrian Hunter <adrian.hunter@intel.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>,
	Jiri Olsa <jolsa@redhat.com>, Andi Kleen <ak@linux.intel.com>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 02/12] perf intel-pt: Move synth_opts initialization earlier
Date: Thu, 29 Apr 2021 15:58:44 +0300	[thread overview]
Message-ID: <20210429125854.13905-3-adrian.hunter@intel.com> (raw)
In-Reply-To: <20210429125854.13905-1-adrian.hunter@intel.com>

Move synth_opts initialization earlier, so it can be used earlier.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
 tools/perf/util/intel-pt.c | 29 ++++++++++++++---------------
 1 file changed, 14 insertions(+), 15 deletions(-)

diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c
index 8658d42ce57a..eef8970d98fe 100644
--- a/tools/perf/util/intel-pt.c
+++ b/tools/perf/util/intel-pt.c
@@ -3479,6 +3479,20 @@ int intel_pt_process_auxtrace_info(union perf_event *event,
 
 	intel_pt_log_set_name(INTEL_PT_PMU_NAME);
 
+	if (session->itrace_synth_opts->set) {
+		pt->synth_opts = *session->itrace_synth_opts;
+	} else {
+		struct itrace_synth_opts *opts = session->itrace_synth_opts;
+
+		itrace_synth_opts__set_default(&pt->synth_opts, opts->default_no_sample);
+		if (!opts->default_no_sample && !opts->inject) {
+			pt->synth_opts.branches = false;
+			pt->synth_opts.callchain = true;
+			pt->synth_opts.add_callchain = true;
+		}
+		pt->synth_opts.thread_stack = opts->thread_stack;
+	}
+
 	pt->session = session;
 	pt->machine = &session->machines.host; /* No kvm support */
 	pt->auxtrace_type = auxtrace_info->type;
@@ -3609,21 +3623,6 @@ int intel_pt_process_auxtrace_info(union perf_event *event,
 		goto err_delete_thread;
 	}
 
-	if (session->itrace_synth_opts->set) {
-		pt->synth_opts = *session->itrace_synth_opts;
-	} else {
-		itrace_synth_opts__set_default(&pt->synth_opts,
-				session->itrace_synth_opts->default_no_sample);
-		if (!session->itrace_synth_opts->default_no_sample &&
-		    !session->itrace_synth_opts->inject) {
-			pt->synth_opts.branches = false;
-			pt->synth_opts.callchain = true;
-			pt->synth_opts.add_callchain = true;
-		}
-		pt->synth_opts.thread_stack =
-				session->itrace_synth_opts->thread_stack;
-	}
-
 	if (pt->synth_opts.log)
 		intel_pt_log_enable();
 
-- 
2.17.1


  parent reply	other threads:[~2021-04-29 12:58 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-29 12:58 [PATCH 00/12] perf intel-pt: Add more support for VMs Adrian Hunter
2021-04-29 12:58 ` [PATCH 01/12] perf auxtrace: Add Z itrace option for timeless decoding Adrian Hunter
2021-04-29 12:58 ` Adrian Hunter [this message]
2021-04-29 12:58 ` [PATCH 03/12] perf intel-pt: Support " Adrian Hunter
2021-04-29 12:58 ` [PATCH 04/12] perf inject: Add facility to do in place update Adrian Hunter
2021-04-29 14:31   ` Arnaldo Carvalho de Melo
2021-04-29 16:00   ` Andi Kleen
2021-04-29 16:22     ` Adrian Hunter
2021-04-29 12:58 ` [PATCH 05/12] perf inject: Add --vm-time-correlation option Adrian Hunter
2021-04-29 18:46   ` Andi Kleen
2021-04-29 12:58 ` [PATCH 06/12] perf auxtrace: Allow buffers to be mapped read / write Adrian Hunter
2021-04-29 12:58 ` [PATCH 07/12] perf intel-pt: Let overlap detection handle VM timestamps Adrian Hunter
2021-04-29 12:58 ` [PATCH 08/12] perf intel-pt: Add a tree for VMCS information Adrian Hunter
2021-04-29 14:39   ` Arnaldo Carvalho de Melo
2021-04-29 12:58 ` [PATCH 09/12] perf intel-pt: Pass the first timestamp to the decoder Adrian Hunter
2021-04-29 12:58 ` [PATCH 10/12] perf intel-pt: Better 7-byte timestamp wraparound logic Adrian Hunter
2021-04-29 12:58 ` [PATCH 11/12] perf intel-pt: Add VM Time Correlation to decoder Adrian Hunter
2021-04-29 21:21   ` Andi Kleen
2021-04-30  5:02     ` Adrian Hunter
2021-04-29 12:58 ` [PATCH 12/12] perf intel-pt: Parse VM Time Correlation options and set up decoding Adrian Hunter
2021-04-29 21:24   ` Andi Kleen

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=20210429125854.13905-3-adrian.hunter@intel.com \
    --to=adrian.hunter@intel.com \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.