diff options
author | Ben Hutchings <[email protected]> | 2018-11-11 18:45:24 +0000 |
---|---|---|
committer | Arnaldo Carvalho de Melo <[email protected]> | 2018-11-21 22:39:56 -0300 |
commit | 11a64a05dc649815670b1be9fe63d205cb076401 (patch) | |
tree | ec1a0864e45db38f4e00bf818a84912c82ceb04e /tools/perf/scripts/python/net_dropmonitor.py | |
parent | 4787eff3fa88f62fede6ed7afa06477ae6bf984d (diff) |
perf pmu: Suppress potential format-truncation warning
Depending on which functions are inlined in util/pmu.c, the snprintf()
calls in perf_pmu__parse_{scale,unit,per_pkg,snapshot}() might trigger a
warning:
util/pmu.c: In function 'pmu_aliases':
util/pmu.c:178:31: error: '%s' directive output may be truncated writing up to 255 bytes into a region of size between 0 and 4095 [-Werror=format-truncation=]
snprintf(path, PATH_MAX, "%s/%s.unit", dir, name);
^~
I found this when trying to build perf from Linux 3.16 with gcc 8.
However I can reproduce the problem in mainline if I force
__perf_pmu__new_alias() to be inlined.
Suppress this by using scnprintf() as has been done elsewhere in perf.
Signed-off-by: Ben Hutchings <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: [email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/net_dropmonitor.py')
0 files changed, 0 insertions, 0 deletions