Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1645418
| From | Adrian Hunter <adrian.hunter@intel.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 14/37] perf intel-pt: Add decoder support for CBR events |
| Date | 2017-05-19 11:10 +0200 |
| Message-ID | <tIM54-8nS-27@gated-at.bofh.it> (permalink) |
| References | <tIM53-8nS-3@gated-at.bofh.it> |
| Organization | Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki |
Add decoder support for informing the tools of changes to the core-to-bus
ratio (CBR).
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
tools/perf/util/intel-pt-decoder/intel-pt-decoder.c | 19 +++++++++++++++++++
tools/perf/util/intel-pt-decoder/intel-pt-decoder.h | 2 ++
2 files changed, 21 insertions(+)
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 8062655bc112..9bb694290a28 100644
--- a/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c
+++ b/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c
@@ -121,6 +121,7 @@ struct intel_pt_decoder {
int pkt_len;
int last_packet_type;
unsigned int cbr;
+ unsigned int cbr_seen;
unsigned int max_non_turbo_ratio;
double max_non_turbo_ratio_fp;
double cbr_cyc_to_tsc;
@@ -147,6 +148,7 @@ struct intel_pt_decoder {
uint64_t fup_ptw_payload;
uint64_t fup_mwait_payload;
uint64_t fup_pwre_payload;
+ uint64_t cbr_payload;
uint64_t timestamp_insn_cnt;
uint64_t stuck_ip;
int no_progress;
@@ -1424,6 +1426,8 @@ static void intel_pt_calc_cbr(struct intel_pt_decoder *decoder)
{
unsigned int cbr = decoder->packet.payload & 0xff;
+ decoder->cbr_payload = decoder->packet.payload;
+
if (decoder->cbr == cbr)
return;
@@ -1784,6 +1788,16 @@ static int intel_pt_walk_trace(struct intel_pt_decoder *decoder)
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;
+ return 0;
+ }
break;
case INTEL_PT_MODE_EXEC:
@@ -2324,6 +2338,11 @@ const struct intel_pt_state *intel_pt_decode(struct intel_pt_decoder *decoder)
decoder->state.from_ip = decoder->ip;
} else {
decoder->state.err = 0;
+ if (decoder->cbr != decoder->cbr_seen && decoder->state.type) {
+ decoder->cbr_seen = decoder->cbr;
+ decoder->state.type |= INTEL_PT_CBR_CHG;
+ decoder->state.cbr_payload = decoder->cbr_payload;
+ }
}
return &decoder->state;
diff --git a/tools/perf/util/intel-pt-decoder/intel-pt-decoder.h b/tools/perf/util/intel-pt-decoder/intel-pt-decoder.h
index 414c88e9e0da..921b22e8ca0e 100644
--- a/tools/perf/util/intel-pt-decoder/intel-pt-decoder.h
+++ b/tools/perf/util/intel-pt-decoder/intel-pt-decoder.h
@@ -36,6 +36,7 @@ enum intel_pt_sample_type {
INTEL_PT_PWR_ENTRY = 1 << 5,
INTEL_PT_EX_STOP = 1 << 6,
INTEL_PT_PWR_EXIT = 1 << 7,
+ INTEL_PT_CBR_CHG = 1 << 8,
};
enum intel_pt_period_type {
@@ -73,6 +74,7 @@ struct intel_pt_state {
uint64_t mwait_payload;
uint64_t pwre_payload;
uint64_t pwrx_payload;
+ uint64_t cbr_payload;
uint32_t flags;
enum intel_pt_insn_op insn_op;
int insn_len;
--
1.9.1
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 00/37] perf intel-pt: Power events and PTWRITE Adrian Hunter <adrian.hunter@intel.com> - 2017-05-19 11:10 +0200
[PATCH 30/37] perf intel-pt: Factor out intel_pt_set_event_name() Adrian Hunter <adrian.hunter@intel.com> - 2017-05-19 11:10 +0200
[PATCH 14/37] perf intel-pt: Add decoder support for CBR events Adrian Hunter <adrian.hunter@intel.com> - 2017-05-19 11:10 +0200
[PATCH 27/37] perf intel-pt: Join needlessly wrapped lines Adrian Hunter <adrian.hunter@intel.com> - 2017-05-19 11:10 +0200
[PATCH 17/37] perf tools: Fix message because cpu list option is -C not -c Adrian Hunter <adrian.hunter@intel.com> - 2017-05-19 11:10 +0200
[PATCH 07/37] perf intel-pt: Ensure never to set 'last_ip' when packet 'count' is zero Adrian Hunter <adrian.hunter@intel.com> - 2017-05-19 11:10 +0200
[PATCH 37/37] perf intel-pt: Improve sample timestamp Adrian Hunter <adrian.hunter@intel.com> - 2017-05-19 11:10 +0200
Re: [PATCH 37/37] perf intel-pt: Improve sample timestamp Andi Kleen <ak@linux.intel.com> - 2017-05-19 16:40 +0200
[PATCH 09/37] perf intel-pt: Add missing __fallthrough Adrian Hunter <adrian.hunter@intel.com> - 2017-05-19 11:10 +0200
[PATCH 19/37] perf script: Add 'synth' event type for synthesized events Adrian Hunter <adrian.hunter@intel.com> - 2017-05-19 11:10 +0200
[PATCH 35/37] perf intel-pt: Do not use TSC packets for calculating CPU cycles to TSC Adrian Hunter <adrian.hunter@intel.com> - 2017-05-19 11:10 +0200
[PATCH 05/37] perf intel-pt: Ensure IP is zero when state is INTEL_PT_STATE_NO_IP Adrian Hunter <adrian.hunter@intel.com> - 2017-05-19 11:10 +0200
[PATCH 03/37] perf intel-pt: Add documentation for new config terms Adrian Hunter <adrian.hunter@intel.com> - 2017-05-19 11:10 +0200
[PATCH 26/37] perf intel-pt: Remove unused instructions_sample_period Adrian Hunter <adrian.hunter@intel.com> - 2017-05-19 11:10 +0200
[PATCH 11/37] perf intel-pt: Add decoder support for ptwrite and power event packets Adrian Hunter <adrian.hunter@intel.com> - 2017-05-19 11:10 +0200
[PATCH 18/37] perf script: Fix message because field list option is -F not -f Adrian Hunter <adrian.hunter@intel.com> - 2017-05-19 11:10 +0200
[PATCH 13/37] perf intel-pt: Move decoder error setting into one condition Adrian Hunter <adrian.hunter@intel.com> - 2017-05-19 11:10 +0200
[PATCH 32/37] perf intel-pt: Synthesize new power and ptwrite events Adrian Hunter <adrian.hunter@intel.com> - 2017-05-19 11:10 +0200
[PATCH 15/37] perf intel-pt: Remove redundant initial_skip checks Adrian Hunter <adrian.hunter@intel.com> - 2017-05-19 11:10 +0200
[PATCH 24/37] perf script: Add synthesized Intel PT power and ptwrite events Adrian Hunter <adrian.hunter@intel.com> - 2017-05-19 11:10 +0200
[PATCH 36/37] perf auxtrace: Add CPU filter support Adrian Hunter <adrian.hunter@intel.com> - 2017-05-19 11:10 +0200
[PATCH 23/37] perf auxtrace: Add itrace option to output power events Adrian Hunter <adrian.hunter@intel.com> - 2017-05-19 11:10 +0200
[PATCH 25/37] perf intel-pt: Factor out common code synthesizing event samples Adrian Hunter <adrian.hunter@intel.com> - 2017-05-19 11:10 +0200
[PATCH 04/37] perf intel-pt: Fix missing stack clear Adrian Hunter <adrian.hunter@intel.com> - 2017-05-19 11:10 +0200
[PATCH 20/37] perf script: Add 'synth' field for synthesized event payloads Adrian Hunter <adrian.hunter@intel.com> - 2017-05-19 11:10 +0200
[PATCH 34/37] perf intel-pt: Update documentation to include new ptwrite and power events Adrian Hunter <adrian.hunter@intel.com> - 2017-05-19 11:10 +0200
[PATCH 10/37] perf intel-pt: Clear FUP flag on error Adrian Hunter <adrian.hunter@intel.com> - 2017-05-19 11:10 +0200
[PATCH 28/37] perf intel-pt: Tidy Intel PT evsel lookup into separate function Adrian Hunter <adrian.hunter@intel.com> - 2017-05-19 11:10 +0200
[PATCH 16/37] perf intel-pt: Fix transactions_sample_type Adrian Hunter <adrian.hunter@intel.com> - 2017-05-19 11:10 +0200
[PATCH 01/37] perf intel-pt: Allow decoding with branch tracing disabled Adrian Hunter <adrian.hunter@intel.com> - 2017-05-19 11:20 +0200
[PATCH 02/37] perf intel-pt: Add default config for pass-through branch enable Adrian Hunter <adrian.hunter@intel.com> - 2017-05-19 11:20 +0200
csiph-web