[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180906110400.GD8248@krava>
Date: Thu, 6 Sep 2018 13:04:00 +0200
From: Jiri Olsa <jolsa@...hat.com>
To: Alexey Budankov <alexey.budankov@...ux.intel.com>
Cc: Ingo Molnar <mingo@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Namhyung Kim <namhyung@...nel.org>,
Andi Kleen <ak@...ux.intel.com>,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [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
Powered by blists - more mailing lists