diff --git a/tools/perf/util/arm-spe.c b/tools/perf/util/arm-spe.c index 52ba76a6fc17b9818f1dd26f4fa634cc960cc389..f62cd5a1b9e107650631670ea564ba271ed8d927 100644 --- a/tools/perf/util/arm-spe.c +++ b/tools/perf/util/arm-spe.c @@ -751,8 +751,10 @@ static void arm_spe_c2c_get_samples(void *arg) struct rb_root *listB = ((struct spe_c2c_compare_lists *)arg)->listB; struct spe_c2c_sample_queues *queues = ((struct spe_c2c_compare_lists *)arg)->queues; struct spe_c2c_sample_queues *oppoqs = ((struct spe_c2c_compare_lists *)arg)->oppoqs; + struct arm_spe_queue *speq = queues->speq; struct rb_node *nodeA, *nodeB; struct spe_c2c_sample *sampleA, *sampleB; + bool tshare = speq->spe->synth_opts.c2c_tshare; uint64_t xor; for (nodeA = rb_first(listA); nodeA; nodeA = rb_next(nodeA)) { @@ -761,8 +763,9 @@ static void arm_spe_c2c_get_samples(void *arg) sampleB = rb_entry(nodeB, struct spe_c2c_sample, rb_node); xor = sampleA->state.phys_addr ^ sampleB->state.phys_addr; - if (!(xor & 0xFFFFFFFFFFFFFFC0) && (xor & 0x3F) - && sampleA->tid != sampleB->tid) { + if (!(xor & 0xFFFFFFFFFFFFFFC0) + && (tshare || (xor & 0x3F)) + && (sampleA->tid != sampleB->tid)) { pthread_mutex_lock(&mut); arm_spe_c2c_sample(queues, sampleA); arm_spe_c2c_sample(oppoqs, sampleB); diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c index 4a06986856594aa60b2bc466891baea9867e8005..aa6dff2083d66f301f69f9e9ba968e124ebe043b 100644 --- a/tools/perf/util/auxtrace.c +++ b/tools/perf/util/auxtrace.c @@ -1144,6 +1144,7 @@ void arm_spe_synth_opts__set_default(struct arm_spe_synth_opts *synth_opts) synth_opts->remote_access = true; synth_opts->c2c_remote = false; synth_opts->c2c_store = false; + synth_opts->c2c_tshare = false; } int arm_spe_parse_synth_opts(const struct option *opt, const char *str, @@ -1165,7 +1166,10 @@ int arm_spe_parse_synth_opts(const struct option *opt, const char *str, synth_opts->llc_miss = true; break; case 't': - synth_opts->tlb_miss = true; + if (synth_opts->c2c_mode) + synth_opts->c2c_tshare = true; + else + synth_opts->tlb_miss = true; break; case 'b': synth_opts->branch_miss = true; diff --git a/tools/perf/util/auxtrace.h b/tools/perf/util/auxtrace.h index 615f42d8c694bfc9a7b30adca960575132d6a06b..70eb94251d45fc4a276d97dc2cc57fb1180310c9 100644 --- a/tools/perf/util/auxtrace.h +++ b/tools/perf/util/auxtrace.h @@ -121,6 +121,7 @@ struct arm_spe_synth_opts { bool c2c_mode; bool c2c_remote; bool c2c_store; + bool c2c_tshare; }; /**