From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756030AbbLXAqx (ORCPT ); Wed, 23 Dec 2015 19:46:53 -0500 Received: from mail-pa0-f41.google.com ([209.85.220.41]:36195 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753671AbbLXAqc (ORCPT ); Wed, 23 Dec 2015 19:46:32 -0500 Date: Thu, 24 Dec 2015 09:45:45 +0900 From: Namhyung Kim To: Arnaldo Carvalho de Melo Cc: Ingo Molnar , Peter Zijlstra , Jiri Olsa , LKML , David Ahern , Steven Rostedt , Frederic Weisbecker , Andi Kleen , Wang Nan Subject: Re: [PATCH 02/13] perf hist: Save raw_data/size for tracepoint events Message-ID: <20151224004545.GA9554@danjae.kornet> References: <1450804030-29193-1-git-send-email-namhyung@kernel.org> <1450804030-29193-3-git-send-email-namhyung@kernel.org> <20151223214335.GN19926@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20151223214335.GN19926@kernel.org> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > > --- > > 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. > > 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