Re: [PATCH v5 02/10] perf record: implement -f,--mmap-flush=<threshold> option

From: Alexey Budankov
Date: Thu Mar 07 2019 - 03:28:54 EST



On 05.03.2019 15:25, Jiri Olsa wrote:
> On Fri, Mar 01, 2019 at 06:41:44PM +0300, Alexey Budankov wrote:
>
> SNIP
>
>> diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
>> index f3f7f3100336..9b02a68e8c23 100644
>> --- a/tools/perf/builtin-record.c
>> +++ b/tools/perf/builtin-record.c
>> @@ -334,6 +334,29 @@ static int record__aio_enabled(struct record *rec)
>> return rec->opts.nr_cblocks > 0;
>> }
>>
>> +#define MMAP_FLUSH_DEFAULT 1
>> +static int record__mmap_flush_parse(const struct option *opt,
>> + const char *str,
>> + int unset)
>> +{
>> + int mmap_len;
>> + struct record_opts *opts = (struct record_opts *)opt->value;
>> +
>> + if (unset)
>> + return 0;
>> +
>> + if (str)
>> + opts->mmap_flush = strtol(str, NULL, 0);
>> + if (!opts->mmap_flush)
>> + opts->mmap_flush = MMAP_FLUSH_DEFAULT;
>> +
>> + mmap_len = perf_evlist__mmap_size(opts->mmap_pages);
>> + if (opts->mmap_flush > mmap_len / 4)
>> + opts->mmap_flush = mmap_len / 4;
>> +
>
> if there's point in this config option, pelase make it
> configurable as the other size options we have with
> the B/K/M suffixes

in v7.

~Alexey

>
> jirka
>