[lkml]   [2017]   [Dec]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH] perf test shell: Add -D to check dynamic symbols for ubuntu/debian
On Ubuntu and Debian, we can't find any symbol including "inet_pton" from 'nm -g'
root@vm-lkp-nex04-8G-5 ~# nm -g /lib/x86_64-linux-gnu/ | grep inet_pton
nm: /lib/x86_64-linux-gnu/ no symbols

it looks has different symbol compositions at different distros

Usage: nm [option(s)] [file(s)]
List symbols in [file(s)] (a.out by default).
The options are:
-D, --dynamic Display dynamic symbols instead of normal symbols
--defined-only Display only defined symbols
-e (ignored)
-f, --format=FORMAT Use the output format FORMAT. FORMAT can be `bsd',
`sysv' or `posix'. The default is `bsd'
-g, --extern-only Display only external symbols

I tested both debian/ubuntu and RHEL, they work as expected

CC: Thomas Richter <>
CC: Arnaldo Carvalho de Melo <>
Signed-off-by: Li Zhijian <>
tools/perf/tests/shell/ | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/tests/shell/ b/tools/perf/tests/shell/
index 8b3da21..f939bd6 100755
--- a/tools/perf/tests/shell/
+++ b/tools/perf/tests/shell/
@@ -11,7 +11,7 @@
. $(dirname $0)/lib/

libc=$(grep -w libc /proc/self/maps | head -1 | sed -r 's/.*[[:space:]](\/.*)/\1/g')
-nm -g $libc 2>/dev/null | fgrep -q inet_pton || exit 254
+nm -gD $libc 2>/dev/null | fgrep -q inet_pton || exit 254

trace_libc_inet_pton_backtrace() {
 \ /
  Last update: 2017-12-27 09:53    [W:0.065 / U:5.512 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site