lkml.org 
[lkml]   [2021]   [Dec]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v12 09/16] perf record: Introduce bytes written stats
From
On 05.12.2021 18:14, Jiri Olsa wrote:

<SNIP>

>> static int record__write(struct record *rec, struct mmap *map __maybe_unused,
>> @@ -210,13 +223,15 @@ static int record__write(struct record *rec, struct mmap *map __maybe_unused,
>> return -1;
>> }
>>
>> - if (!(map && map->file))
>> + if (map && map->file)
>> + thread->bytes_written += size;
>> + else
>> rec->bytes_written += size;
>
> ok, that's why ;-) do we actually stil need rec->bytes_written?
> can't we count that under synthesizing main thread->bytes_written?

Hi Jiri,

No, we still need rec->bytes_written because it is used for
the header in "perf.data/data", and it cannot be replaced by
threads[0].bytes_written because threads[0] is used for
"perf.data/data.0".

Regards,
Alexey

>
> jirka
>
>>
>> if (record__output_max_size_exceeded(rec) && !done) {
>> fprintf(stderr, "[ perf record: perf size limit reached (%" PRIu64 " KB),"
>> " stopping session ]\n",
>> - rec->bytes_written >> 10);
>> + record__bytes_written(rec) >> 10);
>> done = 1;
>> }
>>
>> --
>> 2.19.0
>>
>

\
 
 \ /
  Last update: 2021-12-06 12:22    [W:0.447 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site