Hi, On 02/07, Namhyung Kim wrote: > > On Wed, 6 Feb 2013 20:42:18 +0100, Oleg Nesterov wrote: > > > > And why opts->target.system_wide is only set by OPT_BOOLEAN("all-cpus") ? > > I meant, why I can't do "perf record -e whatever -C0" to create a "global" > > counter on CPU_0? This doesn't work because __cmd_record() sees > > !.system_wide > > and assumes we need perf_event__synthesize_thread_map() which silently fail. > > > > So I am sending a single patch to fix the problem which complicated my > > testing. It is trivial but I am not sure it correct, please review. > > Yes, it's not clear how it handles above (-C0) case. I think it should > be treated as a system_wide mode like --all-cpus (-a). So we could set > ->system_wide to true if -C is given and/or test perf_target__has_cpu() > for perf_event__synthesize_thread_map() or both.
Yes, thanks... but to be honest I do not understand opts->systemwide as well. OK, both 'perf record ... sleep 1' and 'perf record ... -a sleep 1' attach the counter(s) to the child process, but opts->systemwide differs. In the latter case run_command() does perf_event__synthesize_threads(). Not sure this is right. Btw, I am just curious. You can override the target with "-p" and run the command, but it seems that it is not possible to create a global counter and run the command. Not that important, but could be handy. Oleg. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/