lkml.org 
[lkml]   [2018]   [Sep]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v7 2/2]: perf record: enable asynchronous trace writing
On Wed, Sep 05, 2018 at 10:39:25AM +0300, Alexey Budankov wrote:

SNIP

> -static int record__pushfn(void *to, void *bf, size_t size)
> +static int record__pushfn(void *to, struct aiocb *cblock, void *data, size_t size)
> {
> + off_t off;
> struct record *rec = to;
> + int ret, trace_fd = rec->session->data->file.fd;
>
> rec->samples++;
> - return record__write(rec, bf, size);
> +
> + off =
> + lseek(trace_fd, 0, SEEK_CUR);
> + lseek(trace_fd, off + size, SEEK_SET);
> +
> + ret = record__aio_write(cblock, trace_fd, data, size, off);
> + if (!ret) {
> + rec->bytes_written += size;
> + if (switch_output_size(rec))
> + trigger_hit(&switch_output_trigger);

why do you need to call switch output from here?

jirka

\
 
 \ /
  Last update: 2018-09-06 13:05    [W:0.124 / U:0.304 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site