lkml.org 
[lkml]   [2013]   [May]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 03/16] perf, persistent: Setting default buffer size to 512k as in perf tools
On Fri, May 31, 2013 at 10:47:23AM +0200, Robert Richter wrote:
> From: Robert Richter <robert.richter@calxeda.com>
>
> The default buffer size used to setup event buffers with perf tools is
> 512k. Using the same buffer size for persistent events. This also
> avoids failed mmap calls due to different buffer sizes.
>
> Signed-off-by: Robert Richter <robert.richter@calxeda.com>
> ---
> kernel/events/persistent.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/kernel/events/persistent.c b/kernel/events/persistent.c
> index 9075164..1e6c03a 100644
> --- a/kernel/events/persistent.c
> +++ b/kernel/events/persistent.c
> @@ -5,6 +5,9 @@
>
> #include "internal.h"
>
> +/* 512 kiB: default perf tools memory size, see perf_evlist__mmap() */
> +#define CPU_BUFFER_NR_PAGES ((512 * 1024) / PAGE_SIZE)
> +
> static DEFINE_PER_CPU(struct list_head, pers_events);
>
> static struct perf_event *
> @@ -151,7 +154,7 @@ int perf_add_persistent_event_by_id(int id)
> attr->type = PERF_TYPE_TRACEPOINT;
> attr->size = sizeof(*attr);
>
> - return perf_add_persistent_event(attr, 4);
> + return perf_add_persistent_event(attr, CPU_BUFFER_NR_PAGES);

This one too - the 4 pages I chose then was purely arbitrary for I had
no idea what size to pick. This clearly makes more sense.

Thanks.


\
 
 \ /
  Last update: 2013-05-31 11:41    [W:0.136 / U:0.624 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site