On Tue, Jan 16, 2018 at 05:05:20PM -0300, Arnaldo Carvalho de Melo wrote: SNIP
> > > > > > +/* > > > + * Are there any events usind DWARF callchains? > > > + * > > > + * I.e. > > > + * > > > + * -e cycles/call-graph=dwarf/ > > > + */ > > > +bool dwarf_callchain_users; > > > > hum, I don't follow.. this bool seems to mirror the usage of > > 'param->record_mode = CALLCHAIN_DWARF', whats the difference? > > > > also, the patch title says 'Do not look at globals', while inside you > > The first version didn't look at globals, the second one doesn't look at > an _specific_ global variable, the global config for --call-graph, which > is a global variable, callchain_param, which _we_ can't touch at > apply_config_terms(), since that is about _just_ that event, not all of > them. > > > add new global dwarf_callchain_users and work with it.. what do I miss? > > > > I'll check tomorrow with clean head ;-) > > Look closely at apply_config_terms() it passes a _local_ variable to > > perf_evsel__config_callchain(evsel, opts, ¶m); > > It will not affect any globals that tools/perf/util/unwind-libunwind-local.c > could possibly use... and that is the problem. :-) ah ok, that one is local.. just to set up the attrs then adding that new variable is ok, though it could be aded inside struct callchain_param, to keep callchain config stuff together thanks, jirka