lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20180306140158.GC10176@kernel.org>
Date:   Tue, 6 Mar 2018 11:01:58 -0300
From:   Arnaldo Carvalho de Melo <acme@...nel.org>
To:     "Liang, Kan" <kan.liang@...ux.intel.com>
Cc:     Jiri Olsa <jolsa@...hat.com>, mingo@...hat.com,
        linux-kernel@...r.kernel.org, namhyung@...nel.org,
        wangnan0@...wei.com, ak@...ux.intel.com
Subject: Re: [PATCH 7/7] perf tools: Refine perf_mmap__read_init

Em Tue, Mar 06, 2018 at 08:29:03AM -0500, Liang, Kan escreveu:
> 
> 
> On 3/5/2018 5:25 PM, Jiri Olsa wrote:
> > On Mon, Mar 05, 2018 at 02:10:59PM -0500, kan.liang@...ux.intel.com wrote:
> > 
> > SNIP
> > 
> > > diff --git a/tools/perf/util/mmap.c b/tools/perf/util/mmap.c
> > > index e3921ed..403c5e6 100644
> > > --- a/tools/perf/util/mmap.c
> > > +++ b/tools/perf/util/mmap.c
> > > @@ -235,16 +235,13 @@ static int overwrite_rb_find_range(void *buf, int mask, u64 head, u64 *start, u6
> > >   /*
> > >    * Report the start and end of the available data in ringbuffer
> > >    */
> > > -int perf_mmap__read_init(struct perf_mmap *md, bool overwrite,
> > > -			 u64 *startp, u64 *endp)
> > > +int perf_mmap__read_init(struct perf_mmap *md, bool overwrite)
> > >   {
> > >   	u64 head = perf_mmap__read_head(md);
> > >   	u64 old = md->prev;
> > >   	unsigned char *data = md->base + page_size;
> > >   	unsigned long size;
> > > -	*startp = overwrite ? head : old;
> > > -	*endp = overwrite ? old : head;
> > >   	md->overwrite = overwrite;
> > 
> > hum, can't we set 'overwrite' at the moment we create struct perf_mmap?
> > 
> > it's not changing during the mmap's lifetime.. maybe we could do it in
> > perf_evlist__alloc_mmap function
> 
> Yes, we know that the __alloc_mmap() is for mmap or overwrite_mmap.
> I think we can set the 'overwrite' there.
> I will do the change in V2.

That is even better!

- Arnaldo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ