Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1290751 > unrolled thread

Re: [PATCH/RFC 09/16] perf tools: Update hist entry's hists pointer

Started byJiri Olsa <jolsa@redhat.com>
First post2015-12-14 00:30 +0100
Last post2015-12-14 03:00 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH/RFC 09/16] perf tools: Update hist entry's hists pointer Jiri Olsa <jolsa@redhat.com> - 2015-12-14 00:30 +0100
    Re: [PATCH/RFC 09/16] perf tools: Update hist entry's hists pointer Namhyung Kim <namhyung@kernel.org> - 2015-12-14 03:00 +0100

#1290751 — Re: [PATCH/RFC 09/16] perf tools: Update hist entry's hists pointer

FromJiri Olsa <jolsa@redhat.com>
Date2015-12-14 00:30 +0100
SubjectRe: [PATCH/RFC 09/16] perf tools: Update hist entry's hists pointer
Message-ID<qFofw-6tv-17@gated-at.bofh.it>
On Mon, Dec 14, 2015 at 12:23:30AM +0100, Jiri Olsa wrote:
> On Thu, Dec 10, 2015 at 04:53:28PM +0900, Namhyung Kim wrote:
> > When sample is processed using multi-thread, each sample is gathered on
> > each thread's hist tree and then merged into the real hist tree.  But
> > hist_entry->hists pointer was not updated so it could refer wrong hists
> > resulted in missing outputs.
> > 
> > Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> > ---
> >  tools/perf/util/hist.c | 8 ++++++++
> >  1 file changed, 8 insertions(+)
> > 
> > diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
> > index ea4f3ad978b0..a12e5022fe04 100644
> > --- a/tools/perf/util/hist.c
> > +++ b/tools/perf/util/hist.c
> > @@ -1008,6 +1008,14 @@ bool hists__collapse_insert_entry(struct hists *hists __maybe_unused,
> 
> there's 'struct hists *hists __maybe_unused' in hists__collapse_insert_entry def..

also hists__collapse_insert_entry is global which seems unnecessary

jirka

> 
> jirka
> 
> >  	}
> >  	hists->nr_entries++;
> >  
> > +	/*
> > +	 * If a hist entry is processed in multi-threaded environment,
> > +	 * it points to a dummy local hists which was used only for
> > +	 * intermidate processing.  So update it to a real one so that
> > +	 * it can find the correct info later.
> > +	 */
> > +	he->hists = hists;
> > +
> >  	rb_link_node(&he->rb_node_in, parent, p);
> >  	rb_insert_color(&he->rb_node_in, root);
> >  	return true;
> > -- 
> > 2.6.2
> > 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1290781

FromNamhyung Kim <namhyung@kernel.org>
Date2015-12-14 03:00 +0100
Message-ID<qFqAF-7R7-11@gated-at.bofh.it>
In reply to#1290751
On Mon, Dec 14, 2015 at 12:28:12AM +0100, Jiri Olsa wrote:
> On Mon, Dec 14, 2015 at 12:23:30AM +0100, Jiri Olsa wrote:
> > On Thu, Dec 10, 2015 at 04:53:28PM +0900, Namhyung Kim wrote:
> > > When sample is processed using multi-thread, each sample is gathered on
> > > each thread's hist tree and then merged into the real hist tree.  But
> > > hist_entry->hists pointer was not updated so it could refer wrong hists
> > > resulted in missing outputs.
> > > 
> > > Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> > > ---
> > >  tools/perf/util/hist.c | 8 ++++++++
> > >  1 file changed, 8 insertions(+)
> > > 
> > > diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
> > > index ea4f3ad978b0..a12e5022fe04 100644
> > > --- a/tools/perf/util/hist.c
> > > +++ b/tools/perf/util/hist.c
> > > @@ -1008,6 +1008,14 @@ bool hists__collapse_insert_entry(struct hists *hists __maybe_unused,
> > 
> > there's 'struct hists *hists __maybe_unused' in hists__collapse_insert_entry def..

OK, will remove.

> 
> also hists__collapse_insert_entry is global which seems unnecessary

What do you mean?  The hists__collapse_insert_entry() will be used by
collect_worker thread.

Thanks,
Namhyung


> 
> jirka
> 
> > 
> > jirka
> > 
> > >  	}
> > >  	hists->nr_entries++;
> > >  
> > > +	/*
> > > +	 * If a hist entry is processed in multi-threaded environment,
> > > +	 * it points to a dummy local hists which was used only for
> > > +	 * intermidate processing.  So update it to a real one so that
> > > +	 * it can find the correct info later.
> > > +	 */
> > > +	he->hists = hists;
> > > +
> > >  	rb_link_node(&he->rb_node_in, parent, p);
> > >  	rb_insert_color(&he->rb_node_in, root);
> > >  	return true;
> > > -- 
> > > 2.6.2
> > > 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web