From: tip-bot for Adrian Hunter <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: hpa@zytor.com, adrian.hunter@intel.com, jolsa@redhat.com,
linux-kernel@vger.kernel.org, tglx@linutronix.de,
mingo@kernel.org, acme@redhat.com
Subject: [tip:perf/core] perf intel-pt: Decoder to output CBR changes immediately
Date: Wed, 3 Jul 2019 07:04:08 -0700 [thread overview]
Message-ID: <tip-abe5a1d3e4bee361bd3b21b8909c8421e46911d1@git.kernel.org> (raw)
In-Reply-To: <20190622093248.581-2-adrian.hunter@intel.com>
Commit-ID: abe5a1d3e4bee361bd3b21b8909c8421e46911d1
Gitweb: https://git.kernel.org/tip/abe5a1d3e4bee361bd3b21b8909c8421e46911d1
Author: Adrian Hunter <adrian.hunter@intel.com>
AuthorDate: Sat, 22 Jun 2019 12:32:42 +0300
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Tue, 25 Jun 2019 08:47:10 -0300
perf intel-pt: Decoder to output CBR changes immediately
The core-to-bus ratio (CBR) provides the CPU frequency. With branches
enabled, the decoder was outputting CBR changes only when there was a
branch. That loses the correct time of the change if the trace is not in
context (e.g. not tracing kernel space). Change to output the CBR change
immediately.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/r/20190622093248.581-2-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/intel-pt-decoder/intel-pt-decoder.c | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c b/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c
index f8b71bf2bb4c..3d2255f284f4 100644
--- a/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c
+++ b/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c
@@ -2015,16 +2015,8 @@ next:
case INTEL_PT_CBR:
intel_pt_calc_cbr(decoder);
- if (!decoder->branch_enable &&
- decoder->cbr != decoder->cbr_seen) {
- decoder->cbr_seen = decoder->cbr;
- decoder->state.type = INTEL_PT_CBR_CHG;
- decoder->state.from_ip = decoder->ip;
- decoder->state.to_ip = 0;
- decoder->state.cbr_payload =
- decoder->packet.payload;
+ if (decoder->cbr != decoder->cbr_seen)
return 0;
- }
break;
case INTEL_PT_MODE_EXEC:
@@ -2626,8 +2618,12 @@ const struct intel_pt_state *intel_pt_decode(struct intel_pt_decoder *decoder)
decoder->sample_tot_cyc_cnt = decoder->tot_cyc_cnt;
} else {
decoder->state.err = 0;
- if (decoder->cbr != decoder->cbr_seen && decoder->state.type) {
+ if (decoder->cbr != decoder->cbr_seen) {
decoder->cbr_seen = decoder->cbr;
+ if (!decoder->state.type) {
+ decoder->state.from_ip = decoder->ip;
+ decoder->state.to_ip = 0;
+ }
decoder->state.type |= INTEL_PT_CBR_CHG;
decoder->state.cbr_payload = decoder->cbr_payload;
}
next prev parent reply other threads:[~2019-07-03 14:04 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-22 9:32 [PATCH 0/7] perf intel-pt: CBR improvements Adrian Hunter
2019-06-22 9:32 ` [PATCH 1/7] perf intel-pt: Decoder to output CBR changes immediately Adrian Hunter
2019-07-03 14:04 ` tip-bot for Adrian Hunter [this message]
2019-06-22 9:32 ` [PATCH 2/7] perf intel-pt: Cater for CBR change in PSB+ Adrian Hunter
2019-07-03 14:04 ` [tip:perf/core] " tip-bot for Adrian Hunter
2019-06-22 9:32 ` [PATCH 3/7] perf intel-pt: Add CBR value to decoder state Adrian Hunter
2019-07-03 14:05 ` [tip:perf/core] " tip-bot for Adrian Hunter
2019-06-22 9:32 ` [PATCH 4/7] perf intel-pt: Synthesize CBR events when last seen value changes Adrian Hunter
2019-07-03 14:06 ` [tip:perf/core] " tip-bot for Adrian Hunter
2019-06-22 9:32 ` [PATCH 5/7] perf db-export: Export synth events Adrian Hunter
2019-07-03 14:06 ` [tip:perf/core] " tip-bot for Adrian Hunter
2019-06-22 9:32 ` [PATCH 6/7] perf scripts python: export-to-sqlite.py: Export Intel PT power and ptwrite events Adrian Hunter
2019-07-03 14:07 ` [tip:perf/core] " tip-bot for Adrian Hunter
2019-06-22 9:32 ` [PATCH 7/7] perf scripts python: export-to-postgresql.py: " Adrian Hunter
2019-07-03 14:08 ` [tip:perf/core] " tip-bot for Adrian Hunter
2019-06-24 18:57 ` [PATCH 0/7] perf intel-pt: CBR improvements Arnaldo Carvalho de Melo
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=tip-abe5a1d3e4bee361bd3b21b8909c8421e46911d1@git.kernel.org \
--to=tipbot@zytor.com \
--cc=acme@redhat.com \
--cc=adrian.hunter@intel.com \
--cc=hpa@zytor.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=tglx@linutronix.de \
/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