@@ -6,7 +6,7 @@
w synthesize ptwrite events
p synthesize power events (incl. PSB events for Intel PT)
o synthesize other events recorded due to the use
- of aux-output (refer to perf record)
+ of aux-output (refer to perf record) (all events for Arm SPE)
e synthesize error events
d create a debug log
f synthesize first level cache events
@@ -58,6 +58,7 @@ struct arm_spe {
u8 sample_branch;
u8 sample_remote_access;
u8 sample_memory;
+ u8 sample_other;
u64 l1d_miss_id;
u64 l1d_access_id;
@@ -68,6 +69,7 @@ struct arm_spe {
u64 branch_miss_id;
u64 remote_access_id;
u64 memory_id;
+ u64 all_id;
u64 kernel_start;
@@ -351,6 +353,23 @@ static int arm_spe__synth_branch_sample(struct arm_spe_queue *speq,
return arm_spe_deliver_synth_event(spe, speq, event, &sample);
}
+static int arm_spe__synth_other_sample(struct arm_spe_queue *speq,
+ u64 spe_events_id)
+{
+ struct arm_spe *spe = speq->spe;
+ struct arm_spe_record *record = &speq->decoder->record;
+ union perf_event *event = speq->event_buf;
+ struct perf_sample sample = { .ip = 0, };
+
+ arm_spe_prep_sample(spe, speq, event, &sample);
+
+ sample.id = spe_events_id;
+ sample.stream_id = spe_events_id;
+ sample.addr = record->to_ip;
+
+ return arm_spe_deliver_synth_event(spe, speq, event, &sample);
+}
+
#define SPE_MEM_TYPE (ARM_SPE_L1D_ACCESS | ARM_SPE_L1D_MISS | \
ARM_SPE_LLC_ACCESS | ARM_SPE_LLC_MISS | \
ARM_SPE_REMOTE_ACCESS)
@@ -480,6 +499,12 @@ static int arm_spe_sample(struct arm_spe_queue *speq)
return err;
}
+ if (spe->sample_other) {
+ err = arm_spe__synth_other_sample(speq, spe->all_id);
+ if (err)
+ return err;
+ }
+
return 0;
}
@@ -1107,6 +1132,17 @@ arm_spe_synth_events(struct arm_spe *spe, struct perf_session *session)
return err;
spe->memory_id = id;
arm_spe_set_event_name(evlist, id, "memory");
+ id += 1;
+ }
+
+ if (spe->synth_opts.other_events) {
+ spe->sample_other = true;
+
+ err = arm_spe_synth_event(session, &attr, id);
+ if (err)
+ return err;
+ spe->all_id = id;
+ arm_spe_set_event_name(evlist, id, "all");
}
return 0;
@@ -74,7 +74,7 @@ enum itrace_period_type {
* @ptwrites: whether to synthesize events for ptwrites
* @pwr_events: whether to synthesize power events
* @other_events: whether to synthesize other events recorded due to the use of
- * aux_output
+ * aux_output (all events for Arm SPE)
* @errors: whether to synthesize decoder error events
* @dont_decode: whether to skip decoding entirely
* @log: write a decoding log