Re: [PATCH 02/14] perf tools: Introduce struct add_entry_iter
On Fri, 1 Nov 2013 13:09:09 +0100, Jiri Olsa wrote: > On Thu, Oct 31, 2013 at 03:56:04PM +0900, Namhyung Kim wrote: >> From: Namhyung Kim > > SNIP > >> +} >> + >> +static int >> +iter_add_next_nop_entry(struct add_entry_iter *iter __maybe_unused, >> +struct addr_location *al __maybe_unused) >> +{ >> +return 0; >> +} >> + >> +static int >> +iter_prepare_mem_entry(struct add_entry_iter *iter, struct machine *machine, >> + struct perf_evsel *evsel, struct addr_location *al, >> + struct perf_sample *sample) >> +{ >> +union perf_event *event = iter->priv; >> +struct mem_info *mi; >> +u8 cpumode; >> + >> +BUG_ON(event == NULL); > > the priv does not get assigned.. 'perf mem rep' aborts > > [jolsa@krava perf]$ ./perf mem rep --stdio > Aborted > perf: builtin-report.c:120: iter_prepare_mem_entry: Assertion `!(event == > ((void *)0))' failed. Argh... forgot to set it for mem entries after code refactoring, sorry. :-/ Will fix in v3. Thanks, Namhyung -- 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/
Re: [PATCH 02/14] perf tools: Introduce struct add_entry_iter
Hi Jiri, On Fri, 1 Nov 2013 13:07:35 +0100, Jiri Olsa wrote: > On Thu, Oct 31, 2013 at 03:56:04PM +0900, Namhyung Kim wrote: >> From: Namhyung Kim > > SNIP > >> + >> +static int >> +perf_evsel__add_entry(struct perf_evsel *evsel, struct addr_location *al, >> + struct perf_sample *sample, struct machine *machine, >> + struct add_entry_iter *iter) >> +{ >> +int err; >> + >> +if ((sort__has_parent || symbol_conf.use_callchain) && >> sample->callchain) { >> +err = machine__resolve_callchain(machine, evsel, al->thread, >> + sample, >parent, al, >> + iter->rep->max_stack); >> +if (err) >> +return err; >> +} >> + >> +err = iter->prepare_entry(iter, machine, evsel, al, sample); >> +if (err) >> +return err; >> + >> +err = iter->add_single_entry(iter, al); >> +if (err) >> +return err; >> + >> +while (iter->next_entry(iter, al)) { >> +err = iter->add_next_entry(iter, al); >> +if (err) >> +break; >> +} >> + >> +err = iter->finish_entry(iter, al); >> + >> +return err; > > return iter->finish_entry(iter, al); ? Right. Will fix in v3. Thanks, Namhyung -- 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/
Re: [PATCH 02/14] perf tools: Introduce struct add_entry_iter
Hi Jiri, On Fri, 1 Nov 2013 13:07:35 +0100, Jiri Olsa wrote: On Thu, Oct 31, 2013 at 03:56:04PM +0900, Namhyung Kim wrote: From: Namhyung Kim namhyung@lge.com SNIP + +static int +perf_evsel__add_entry(struct perf_evsel *evsel, struct addr_location *al, + struct perf_sample *sample, struct machine *machine, + struct add_entry_iter *iter) +{ +int err; + +if ((sort__has_parent || symbol_conf.use_callchain) sample-callchain) { +err = machine__resolve_callchain(machine, evsel, al-thread, + sample, iter-parent, al, + iter-rep-max_stack); +if (err) +return err; +} + +err = iter-prepare_entry(iter, machine, evsel, al, sample); +if (err) +return err; + +err = iter-add_single_entry(iter, al); +if (err) +return err; + +while (iter-next_entry(iter, al)) { +err = iter-add_next_entry(iter, al); +if (err) +break; +} + +err = iter-finish_entry(iter, al); + +return err; return iter-finish_entry(iter, al); ? Right. Will fix in v3. Thanks, Namhyung -- 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/
Re: [PATCH 02/14] perf tools: Introduce struct add_entry_iter
On Fri, 1 Nov 2013 13:09:09 +0100, Jiri Olsa wrote: On Thu, Oct 31, 2013 at 03:56:04PM +0900, Namhyung Kim wrote: From: Namhyung Kim namhyung@lge.com SNIP +} + +static int +iter_add_next_nop_entry(struct add_entry_iter *iter __maybe_unused, +struct addr_location *al __maybe_unused) +{ +return 0; +} + +static int +iter_prepare_mem_entry(struct add_entry_iter *iter, struct machine *machine, + struct perf_evsel *evsel, struct addr_location *al, + struct perf_sample *sample) +{ +union perf_event *event = iter-priv; +struct mem_info *mi; +u8 cpumode; + +BUG_ON(event == NULL); the priv does not get assigned.. 'perf mem rep' aborts [jolsa@krava perf]$ ./perf mem rep --stdio Aborted perf: builtin-report.c:120: iter_prepare_mem_entry: Assertion `!(event == ((void *)0))' failed. Argh... forgot to set it for mem entries after code refactoring, sorry. :-/ Will fix in v3. Thanks, Namhyung -- 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/
Re: [PATCH 02/14] perf tools: Introduce struct add_entry_iter
On Thu, Oct 31, 2013 at 03:56:04PM +0900, Namhyung Kim wrote: > From: Namhyung Kim SNIP > +} > + > +static int > +iter_add_next_nop_entry(struct add_entry_iter *iter __maybe_unused, > + struct addr_location *al __maybe_unused) > +{ > + return 0; > +} > + > +static int > +iter_prepare_mem_entry(struct add_entry_iter *iter, struct machine *machine, > +struct perf_evsel *evsel, struct addr_location *al, > +struct perf_sample *sample) > +{ > + union perf_event *event = iter->priv; > + struct mem_info *mi; > + u8 cpumode; > + > + BUG_ON(event == NULL); the priv does not get assigned.. 'perf mem rep' aborts [jolsa@krava perf]$ ./perf mem rep --stdio Aborted perf: builtin-report.c:120: iter_prepare_mem_entry: Assertion `!(event == ((void *)0))' failed. jirka -- 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/
Re: [PATCH 02/14] perf tools: Introduce struct add_entry_iter
On Thu, Oct 31, 2013 at 03:56:04PM +0900, Namhyung Kim wrote: > From: Namhyung Kim SNIP > + > +static int > +perf_evsel__add_entry(struct perf_evsel *evsel, struct addr_location *al, > + struct perf_sample *sample, struct machine *machine, > + struct add_entry_iter *iter) > +{ > + int err; > + > + if ((sort__has_parent || symbol_conf.use_callchain) && > sample->callchain) { > + err = machine__resolve_callchain(machine, evsel, al->thread, > + sample, >parent, al, > + iter->rep->max_stack); > + if (err) > + return err; > + } > + > + err = iter->prepare_entry(iter, machine, evsel, al, sample); > + if (err) > + return err; > + > + err = iter->add_single_entry(iter, al); > + if (err) > + return err; > + > + while (iter->next_entry(iter, al)) { > + err = iter->add_next_entry(iter, al); > + if (err) > + break; > + } > + > + err = iter->finish_entry(iter, al); > + > + return err; return iter->finish_entry(iter, al); ? -- 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/
Re: [PATCH 02/14] perf tools: Introduce struct add_entry_iter
On Thu, Oct 31, 2013 at 03:56:04PM +0900, Namhyung Kim wrote: From: Namhyung Kim namhyung@lge.com SNIP + +static int +perf_evsel__add_entry(struct perf_evsel *evsel, struct addr_location *al, + struct perf_sample *sample, struct machine *machine, + struct add_entry_iter *iter) +{ + int err; + + if ((sort__has_parent || symbol_conf.use_callchain) sample-callchain) { + err = machine__resolve_callchain(machine, evsel, al-thread, + sample, iter-parent, al, + iter-rep-max_stack); + if (err) + return err; + } + + err = iter-prepare_entry(iter, machine, evsel, al, sample); + if (err) + return err; + + err = iter-add_single_entry(iter, al); + if (err) + return err; + + while (iter-next_entry(iter, al)) { + err = iter-add_next_entry(iter, al); + if (err) + break; + } + + err = iter-finish_entry(iter, al); + + return err; return iter-finish_entry(iter, al); ? -- 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/
Re: [PATCH 02/14] perf tools: Introduce struct add_entry_iter
On Thu, Oct 31, 2013 at 03:56:04PM +0900, Namhyung Kim wrote: From: Namhyung Kim namhyung@lge.com SNIP +} + +static int +iter_add_next_nop_entry(struct add_entry_iter *iter __maybe_unused, + struct addr_location *al __maybe_unused) +{ + return 0; +} + +static int +iter_prepare_mem_entry(struct add_entry_iter *iter, struct machine *machine, +struct perf_evsel *evsel, struct addr_location *al, +struct perf_sample *sample) +{ + union perf_event *event = iter-priv; + struct mem_info *mi; + u8 cpumode; + + BUG_ON(event == NULL); the priv does not get assigned.. 'perf mem rep' aborts [jolsa@krava perf]$ ./perf mem rep --stdio Aborted perf: builtin-report.c:120: iter_prepare_mem_entry: Assertion `!(event == ((void *)0))' failed. jirka -- 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/