lkml.org 
[lkml]   [2013]   [Oct]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] perf record: mmap output file - RFC
On Sun, Sep 22, 2013 at 08:05:59PM -0600, David Ahern wrote:

SNIP

> +
> + if (size > remaining) {
> + memcpy(rec->mmap_addr + rec->mmap_offset, buf, remaining);
> + rec->bytes_written += remaining;
> +
> + size -= remaining;
> + buf += remaining;
> +
> + msync(rec->mmap_addr, rec->mmap_size, MS_ASYNC);
> + munmap(rec->mmap_addr, rec->mmap_size);

do we need msync call if munmap is called right away?


> + goto do_mmap;

SNIP

> + if (rec->use_mmap) {
> + off_t len = rec->bytes_at_mmap_start + rec->bytes_written;
> +
> + rec->use_mmap = false;
> + msync(rec->mmap_addr, rec->mmap_size, MS_ASYNC);
> + munmap(rec->mmap_addr, rec->mmap_size);

ditto

thanks,
jirka


\
 
 \ /
  Last update: 2013-10-09 16:01    [W:0.069 / U:0.468 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site