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, 10 Oct 2017 15:14:05 -0300
From:   Arnaldo Carvalho de Melo <acme@...nel.org>
To:     kan.liang@...el.com
Cc:     peterz@...radead.org, mingo@...hat.com,
        linux-kernel@...r.kernel.org, jolsa@...nel.org,
        wangnan0@...wei.com, hekuang@...wei.com, namhyung@...nel.org,
        alexander.shishkin@...ux.intel.com, adrian.hunter@...el.com,
        ak@...ux.intel.com
Subject: Re: [PATCH 02/10] perf tool: fix: Don't discard prev in backward mode

Em Tue, Oct 10, 2017 at 10:20:15AM -0700, kan.liang@...el.com escreveu:
> From: Kan Liang <kan.liang@...el.com>
> 
> Perf record can switch output. The new output should only store the data
> after switching. However, in overwrite backward mode, the new output
> still have the data from old output.
> 
> At the end of mmap_read, the position of processed ring buffer is saved
> in md->prev. Next mmap_read should be end in md->prev.
> However, the md->prev is discarded. So next mmap_read has to process
> whole valid ring buffer, which definitely include the old processed
> data.
> 
> Set the prev as the end of the range in backward mode.

Do you think this should go together with the rest of this patchkit?
Probably it should be processed ASAP, i.e. perf/urgent, no?

- Arnaldo
 
> Signed-off-by: Kan Liang <kan.liang@...el.com>
> ---
>  tools/perf/util/evlist.c | 14 +++++++++++++-
>  1 file changed, 13 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
> index 33b8837..7d23cf5 100644
> --- a/tools/perf/util/evlist.c
> +++ b/tools/perf/util/evlist.c
> @@ -742,13 +742,25 @@ static int
>  rb_find_range(void *data, int mask, u64 head, u64 old,
>  	      u64 *start, u64 *end, bool backward)
>  {
> +	int ret;
> +
>  	if (!backward) {
>  		*start = old;
>  		*end = head;
>  		return 0;
>  	}
>  
> -	return backward_rb_find_range(data, mask, head, start, end);
> +	ret = backward_rb_find_range(data, mask, head, start, end);
> +
> +	/*
> +	 * The start and end from backward_rb_find_range is the range for all
> +	 * valid data in ring buffer.
> +	 * However, part of the data is processed previously.
> +	 * Reset the end to drop the processed data
> +	 */
> +	*end = old;
> +
> +	return ret;
>  }
>  
>  /*
> -- 
> 2.5.5

Powered by blists - more mailing lists