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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 13 Jul 2021 21:10:18 +0800
From:   Leo Yan <leo.yan@...aro.org>
To:     Adrian Hunter <adrian.hunter@...el.com>
Cc:     Arnaldo Carvalho de Melo <acme@...nel.org>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Mark Rutland <mark.rutland@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Jiri Olsa <jolsa@...hat.com>,
        Namhyung Kim <namhyung@...nel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Borislav Petkov <bp@...en8.de>, x86@...nel.org,
        "H. Peter Anvin" <hpa@...or.com>,
        Mathieu Poirier <mathieu.poirier@...aro.org>,
        Suzuki K Poulose <suzuki.poulose@....com>,
        Mike Leach <mike.leach@...aro.org>,
        linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org,
        coresight@...ts.linaro.org, linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH v4 07/11] perf auxtrace: Remove
 auxtrace_mmap__read_snapshot_head()

On Mon, Jul 12, 2021 at 05:32:11PM +0300, Adrian Hunter wrote:

[...]

> > --- a/tools/perf/util/auxtrace.c
> > +++ b/tools/perf/util/auxtrace.c
> > @@ -1686,13 +1686,12 @@ static int __auxtrace_mmap__read(struct mmap *map,
> >  	union perf_event ev;
> >  	void *data1, *data2;
> >  
> > +	head = auxtrace_mmap__read_head(mm);
> > +
> >  	if (snapshot) {
> > -		head = auxtrace_mmap__read_snapshot_head(mm);
> >  		if (auxtrace_record__find_snapshot(itr, mm->idx, mm, data,
> >  						   &head, &old))
> 
> That leaves a nested 'if' which is not kernel style i.e. could be
> 
> 	if (snapshot &&
> 	    auxtrace_record__find_snapshot(itr, mm->idx, mm, data, &head, &old))

Will refine in next spin, thanks for suggestion!

> >  			return -1;
> > -	} else {
> > -		head = auxtrace_mmap__read_head(mm);
> >  	}
> >  
> >  	if (old == head)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ