lkml.org 
[lkml]   [2018]   [Mar]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 7/7] perf tools: Refine perf_mmap__read_init
On Mon, Mar 05, 2018 at 02:10:59PM -0500, kan.liang@linux.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

really nice cleanup!

thanks,
jirka

\
 
 \ /
  Last update: 2018-03-05 23:26    [W:0.071 / U:0.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site