Exactly.+static int process_sample_event(event_t *event __unused,
+ struct sample_data *sample, struct perf_session *session __unused)
+{
+ /* sample->ip is 'from address', sample->addr is 'to address' */
+ printf(FMT_ADDR " => " FMT_ADDR "\n", sample->ip, sample->addr);
It seems this unconditionally prints out the event, but a sample
event can be about anything. If you recorded only branches it's fine,
but if there were other events this will mess up.
Agreed.
Well, when you launch the tool you can iterate into the session->header.attr
and check if there is something else than a branch perf event. And then emit
a warning if so.
That doesn't solve the problem but the user will know there is one.
Actually the best would be to select PERF_SAMPLE_ID in the sample_type
on record and also PERF_FORMAT_ID in the read_format.
Then you can find the PERF_SAMPLE_ID that matches your event. If we
record that in the perf headers we can retrieve which events id are the
branch ones.
Thank you for your advise!
But well, that's a secondary problem for now.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/