Re: [PATCH 00/12] Stitch LBR call stack (Perf Tools)

From: Jiri Olsa
Date: Fri Mar 06 2020 - 04:39:55 EST


On Fri, Feb 28, 2020 at 08:29:59AM -0800, kan.liang@xxxxxxxxxxxxxxx wrote:

SNIP

> Kan Liang (12):
> perf tools: Add hw_idx in struct branch_stack
> perf tools: Support PERF_SAMPLE_BRANCH_HW_INDEX
> perf header: Add check for event attr
> perf pmu: Add support for PMU capabilities

hi,
I'm getting compile error:

util/pmu.c: In function âperf_pmu__caps_parseâ:
util/pmu.c:1620:32: error: â%sâ directive output may be truncated writing up to 255 bytes into a region of size between 0 and 4095 [-Werror=format-truncation=]
1620 | snprintf(path, PATH_MAX, "%s/%s", caps_path, name);
| ^~
In file included from /usr/include/stdio.h:867,
from util/pmu.c:12:
/usr/include/bits/stdio2.h:67:10: note: â__builtin___snprintf_chkâ output between 2 and 4352 bytes into a destination of size 4096
67 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
68 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

[jolsa@krava perf]$ gcc --version
gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1)

jirka