Re: [PATCH v9 1/3]: perf util: map data buffer for preserving collected data

From: Alexey Budankov
Date: Fri Oct 05 2018 - 03:29:55 EST


Hi,

On 05.10.2018 9:23, Namhyung Kim wrote:
<SNIP>
> On Wed, Oct 03, 2018 at 07:01:26PM +0300, Alexey Budankov wrote:
<SNIP>
>> +#ifdef HAVE_AIO_SUPPORT
>> + map->nr_cblocks = mp->nr_cblocks;
>> + if (map->nr_cblocks) {
>> + map->data = malloc(perf_mmap__mmap_len(map));
>> + if (!map->data) {
>> + pr_debug2("failed to allocate data buffer, error %d\n",
>> + errno);
>
> I guess the error code is not very useful than the message. But in
> this case it's probably ENOMEM so we can simply omit it.

Possibly like this:
pr_debug2("failed to allocate data buffer, error %d: %s\n",
errno, strerror(errno));
would be more informative.

Thanks,
Alexey