Re: [RFC v2][PATCH 08/11] perf: convert perf header build_ids intobuild_id events

From: Arnaldo Carvalho de Melo
Date: Sat Apr 03 2010 - 09:54:40 EST

Em Thu, Apr 01, 2010 at 11:59:22PM -0500, Tom Zanussi escreveu:
> Bypasses the build_id perf header code and replaces it with a
> synthesized event and processing function that accomplishes the same
> thing, used when reading/writing perf data to/from a pipe.

> static void atexit_header(void)
> {
> - session->header.data_size += bytes_written;
> + if (!pipe_output) {
> + session->header.data_size += bytes_written;
> - process_buildids();
> - perf_header__write(&session->header, output, true);
> + process_buildids();
> + perf_header__write(&session->header, output, true);
> + } else {
> + int err;
> + err = event__synthesize_build_ids(process_synthesized_event,
> + session);
> + if (err < 0)
> + pr_err("Couldn't synthesize build ids.\n");

Humm, getting everything as events looks elegant, but for the buildid
case... when processing samples we need to _first_ have the build-ids,
hence they are in the header.

We only generate them after collecting all samples because it would
disturb the system if we look at them in the ELF files when we get

In live mode we will be resolving symbols as we get samples, so I fail
to see how synthesizing the build-ids as a last step will help.

With build-ids events we can at least generate it in advance for the
kernel and modules, as it is a restriced number of DSOs and we have them
easily accessible via /sys, but for the userspace bits...

- Arnaldo
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at