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]
Message-ID: <YRGJoNdr253SHqlh@kernel.org>
Date:   Mon, 9 Aug 2021 17:01:36 -0300
From:   Arnaldo Carvalho de Melo <acme@...nel.org>
To:     Leo Yan <leo.yan@...aro.org>
Cc:     Peter Zijlstra <peterz@...radead.org>,
        Adrian Hunter <adrian.hunter@...el.com>,
        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>,
        "H. Peter Anvin" <hpa@...or.com>,
        Mathieu Poirier <mathieu.poirier@...aro.org>,
        Suzuki K Poulose <suzuki.poulose@....com>,
        Mike Leach <mike.leach@...aro.org>,
        Michael Petlan <mpetlan@...hat.com>,
        "Frank Ch. Eigler" <fche@...hat.com>,
        Song Liu <songliubraving@...com>, x86@...nel.org,
        Daniel Díaz <daniel.diaz@...aro.org>,
        Andrii Nakryiko <andriin@...com>,
        Alexei Starovoitov <ast@...nel.org>,
        Sedat Dilek <sedat.dilek@...il.com>,
        Andi Kleen <ak@...ux.intel.com>,
        linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org,
        coresight@...ts.linaro.org
Subject: Re: [PATCH v5 7/9] perf auxtrace: Remove
 auxtrace_mmap__read_snapshot_head()

Em Mon, Aug 09, 2021 at 07:14:05PM +0800, Leo Yan escreveu:
> Since the function auxtrace_mmap__read_snapshot_head() is exactly same
> with auxtrace_mmap__read_head(), whether the session is in snapshot mode
> or not, it's unified to use function auxtrace_mmap__read_head() for
> reading AUX buffer head.
> 
> And the function auxtrace_mmap__read_snapshot_head() is unused so this
> patch removes it.

Thanks, applied to perf/core.

- Arnaldo

 
> Signed-off-by: Leo Yan <leo.yan@...aro.org>
> ---
>  tools/perf/util/auxtrace.c | 13 +++++--------
>  tools/perf/util/auxtrace.h | 10 ----------
>  2 files changed, 5 insertions(+), 18 deletions(-)
> 
> diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c
> index cb19669d2a5b..2dcf3d12ba32 100644
> --- a/tools/perf/util/auxtrace.c
> +++ b/tools/perf/util/auxtrace.c
> @@ -1686,14 +1686,11 @@ static int __auxtrace_mmap__read(struct mmap *map,
>  	union perf_event ev;
>  	void *data1, *data2;
>  
> -	if (snapshot) {
> -		head = auxtrace_mmap__read_snapshot_head(mm);
> -		if (auxtrace_record__find_snapshot(itr, mm->idx, mm, data,
> -						   &head, &old))
> -			return -1;
> -	} else {
> -		head = auxtrace_mmap__read_head(mm);
> -	}
> +	head = auxtrace_mmap__read_head(mm);
> +
> +	if (snapshot &&
> +	    auxtrace_record__find_snapshot(itr, mm->idx, mm, data, &head, &old))
> +		return -1;
>  
>  	if (old == head)
>  		return 0;
> diff --git a/tools/perf/util/auxtrace.h b/tools/perf/util/auxtrace.h
> index 4f9176368134..d68a5e80b217 100644
> --- a/tools/perf/util/auxtrace.h
> +++ b/tools/perf/util/auxtrace.h
> @@ -440,16 +440,6 @@ struct auxtrace_cache;
>  
>  #ifdef HAVE_AUXTRACE_SUPPORT
>  
> -static inline u64 auxtrace_mmap__read_snapshot_head(struct auxtrace_mmap *mm)
> -{
> -	struct perf_event_mmap_page *pc = mm->userpg;
> -	u64 head = READ_ONCE(pc->aux_head);
> -
> -	/* Ensure all reads are done after we read the head */
> -	smp_rmb();
> -	return head;
> -}
> -
>  static inline u64 auxtrace_mmap__read_head(struct auxtrace_mmap *mm)
>  {
>  	struct perf_event_mmap_page *pc = mm->userpg;
> -- 
> 2.25.1
> 

-- 

- Arnaldo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ