]> git.baikalelectronics.ru Git - kernel.git/commit
perf tools: Fix undefined symbol scnprintf in libperf-jvmti.so
authorGustavo Romero <gromero@linux.vnet.ibm.com>
Fri, 2 Nov 2018 00:13:21 +0000 (20:13 -0400)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 5 Nov 2018 19:28:00 +0000 (16:28 -0300)
commitb0f66e51166d43e095844b2d2eeddddefc7b65b9
tree1b7c85e39465c5dcca44f34d088195295399b8d3
parentebf62662a1d8880560e75500ecf59fa099b448ce
perf tools: Fix undefined symbol scnprintf in libperf-jvmti.so

Currently jvmti agent can not be used because function scnprintf is not
present in the agent libperf-jvmti.so. As a result the JVM when using
such agent to record JITed code profiling information will fail on
looking up scnprintf:

  java: symbol lookup error: lib/libperf-jvmti.so: undefined symbol: scnprintf

This commit fixes that by reverting to the use of snprintf, that can be
looked up, instead of scnprintf, adding a proper check for the returned
value in order to print a better error message when the jitdump file
pathname is too long. Checking the returned value also helps to comply
with some recent gcc versions, like gcc8, which will fail due to
truncated writing checks related to the -Werror=format-truncation= flag.

Signed-off-by: Gustavo Romero <gromero@linux.vnet.ibm.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
LPU-Reference: 1541117601-18937-2-git-send-email-gromero@linux.vnet.ibm.com
Link: https://lkml.kernel.org/n/tip-mvpxxxy7wnzaj74cq75muw3f@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/jvmti/jvmti_agent.c