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


Groups > linux.kernel > #1297710

Re: [PATCH 02/13] perf hist: Save raw_data/size for tracepoint events

From Arnaldo Carvalho de Melo <acme@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH 02/13] perf hist: Save raw_data/size for tracepoint events
Date 2015-12-24 02:20 +0100
Message-ID <qJ2Jr-em-3@gated-at.bofh.it> (permalink)
References <qIyBH-6Kl-3@gated-at.bofh.it> <qIyLo-6NF-13@gated-at.bofh.it> <qIZsd-6sP-1@gated-at.bofh.it> <qJ2gp-8gT-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Em Thu, Dec 24, 2015 at 09:45:45AM +0900, Namhyung Kim escreveu:
> Hi Arnaldo,
> 
> On Wed, Dec 23, 2015 at 06:43:35PM -0300, Arnaldo Carvalho de Melo wrote:
> > Em Wed, Dec 23, 2015 at 02:06:59AM +0900, Namhyung Kim escreveu:
> > > The raw_data and raw_size fields are to provide tracepoint specific
> > > information.  They will be used by dynamic sort keys later.
> > > 
> > > Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> > > ---
> > >  tools/perf/util/hist.c | 4 ++++
> > >  tools/perf/util/sort.h | 2 ++
> > >  2 files changed, 6 insertions(+)
> > > 
> > > diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
> > > index 039bb91d0a92..c0c92a3daa69 100644
> > > --- a/tools/perf/util/hist.c
> > > +++ b/tools/perf/util/hist.c
> > > @@ -487,6 +487,8 @@ struct hist_entry *__hists__add_entry(struct hists *hists,
> > >  		.branch_info = bi,
> > >  		.mem_info = mi,
> > >  		.transaction = sample->transaction,
> > > +		.raw_data = sample->raw_data,
> > > +		.raw_size = sample->raw_size,
> > 
> > So, sample->raw_data is just a pointer to perf_event_sample->array, that
> > may be overwritten, no?
> 
> I couldn't find where the array data is overwritten.  The
> __perf_session__process_events() mmaps with PROT_READ basically.  But
> the mmap can be munmapped on 32 bit systems.  I'll keep a copy then.

perf top, aka mmap with overwrite mode? 

I think we should always think first at how to make such new features to
work on 'perf top', where there is no such thing as a "file", but a
_ring_ buffer, where we reuse that buffer when we fill it up, so we
should not keep any pointers to past events, just use what in the
currently being processed.

Haven't looked, do we need to access it after we add the hist, or just
after the perf_sample is parsed?

> > Looking at the other patches.
> 
> Thanks,
> Namhyung
> 
> > 
> > - Arnaldo
> > 
> > >  	};
> > >  
> > >  	return hists__findnew_entry(hists, &entry, al, sample_self);
> > > @@ -801,6 +803,8 @@ iter_add_next_cumulative_entry(struct hist_entry_iter *iter,
> > >  			.sym = al->sym,
> > >  		},
> > >  		.parent = iter->parent,
> > > +		.raw_data = sample->raw_data,
> > > +		.raw_size = sample->raw_size,
> > >  	};
> > >  	int i;
> > >  	struct callchain_cursor cursor;
> > > diff --git a/tools/perf/util/sort.h b/tools/perf/util/sort.h
> > > index 86f05e7a5566..d29898708dbd 100644
> > > --- a/tools/perf/util/sort.h
> > > +++ b/tools/perf/util/sort.h
> > > @@ -122,6 +122,8 @@ struct hist_entry {
> > >  	struct branch_info	*branch_info;
> > >  	struct hists		*hists;
> > >  	struct mem_info		*mem_info;
> > > +	void			*raw_data;
> > > +	u32			raw_size;
> > >  	struct callchain_root	callchain[0]; /* must be last member */
> > >  };
> > >  
> > > -- 
> > > 2.6.4
--
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/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCHSET 00/10] perf tools: Support dynamic sort keys for tracepoints (v4) Namhyung Kim <namhyung@kernel.org> - 2015-12-22 18:10 +0100
  [PATCH 13/13] perf tools: Make 'trace' or 'trace_fields' sort key default for tracepoint events Namhyung Kim <namhyung@kernel.org> - 2015-12-22 18:10 +0100
  [PATCH 09/13] perf tools: Support shortcuts for events in dynamic sort keys Namhyung Kim <namhyung@kernel.org> - 2015-12-22 18:10 +0100
  [PATCH 04/13] perf tools: Pass evlist to setup_sorting() Namhyung Kim <namhyung@kernel.org> - 2015-12-22 18:10 +0100
  [PATCH 10/13] perf tools: Support '<event>.*' dynamic sort key Namhyung Kim <namhyung@kernel.org> - 2015-12-22 18:10 +0100
  [PATCH 01/13] perf hist: Pass struct sample to __hists__add_entry() Namhyung Kim <namhyung@kernel.org> - 2015-12-22 18:10 +0100
  [PATCH 11/13] perf tools: Skip dynamic fields not defined for current event Namhyung Kim <namhyung@kernel.org> - 2015-12-22 18:10 +0100
  [PATCH 07/13] perf tools: Add 'trace' sort key Namhyung Kim <namhyung@kernel.org> - 2015-12-22 18:10 +0100
  [PATCH 12/13] perf tools: Add 'trace_fields' dynamic sort key Namhyung Kim <namhyung@kernel.org> - 2015-12-22 18:10 +0100
  [PATCH 06/13] perf tools: Try to show pretty printed output for dynamic sort keys Namhyung Kim <namhyung@kernel.org> - 2015-12-22 18:10 +0100
  [PATCH 08/13] perf tools: Add --raw-trace option Namhyung Kim <namhyung@kernel.org> - 2015-12-22 18:20 +0100
  [PATCH 02/13] perf hist: Save raw_data/size for tracepoint events Namhyung Kim <namhyung@kernel.org> - 2015-12-22 18:20 +0100
    Re: [PATCH 02/13] perf hist: Save raw_data/size for tracepoint events Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-12-23 22:50 +0100
      Re: [PATCH 02/13] perf hist: Save raw_data/size for tracepoint events Namhyung Kim <namhyung@kernel.org> - 2015-12-24 01:50 +0100
        Re: [PATCH 02/13] perf hist: Save raw_data/size for tracepoint events Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-12-24 02:20 +0100
      [PATCH v4.1 02/13] perf hist: Save raw_data/size for tracepoint events Namhyung Kim <namhyung@kernel.org> - 2015-12-24 02:10 +0100
        Re: [PATCH v4.1 02/13] perf hist: Save raw_data/size for tracepoint  events Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-12-24 02:40 +0100
          [PATCH v4.2 02/13] perf hist: Save raw_data/size for tracepoint events Namhyung Kim <namhyung@kernel.org> - 2015-12-24 03:20 +0100
  [PATCH 05/13] perf tools: Add dynamic sort key for tracepoint events Namhyung Kim <namhyung@kernel.org> - 2015-12-22 18:20 +0100
  Re: [PATCHSET 00/10] perf tools: Support dynamic sort keys for  tracepoints (v4) Jiri Olsa <jolsa@redhat.com> - 2015-12-23 09:50 +0100
    Re: [PATCHSET 00/10] perf tools: Support dynamic sort keys for  tracepoints (v4) Namhyung Kim <namhyung@kernel.org> - 2015-12-23 14:20 +0100

csiph-web