Re: [PATCH 1/5] perf tools: Fix -C option for record command

From: David Ahern
Date: Mon Feb 25 2013 - 13:56:46 EST


On 2/25/13 11:39 AM, Oleg Nesterov wrote:
To clarify, I am not trying to review this patch, I'd like to ask
the question...

On 02/25, Jiri Olsa wrote:

Currently the -C option does not work for record command,
because of the targets mismatch when synthesizing threads.

Fixing this by using proper target interface for the
synthesize decision.

OK, but my fix had the different goal. I thought that

$ perf ... record -C0 sleep 1

should attach the counter to the child process (workload) and set
event->cpu = 0 (instead of -1). With this patch we create the cpu

If a target is given (-a, -C, -p or -t) that is what the data is collected for -- all cpus, a cpu, or one or more task ids. The workload in that case becomes a means for bounding the data collection (start and end points).

If you want to collect events for a workload you just run perf-record -- workload.

Last time I dug into it (which was 8-12 months ago) -C required -a to work properly. -a (system_wide) meaning collect events for all cpus and then -C meaning but only for this cpu. Perhaps Namyhung's target changes may have simplified fixing that as Jiri's patch suggests.

David
--
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/