All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] perf test shell: Add -D to check dynamic symbols for ubuntu/debian
@ 2018-05-09  7:45 Li Zhijian
  2018-05-09 21:41 ` Kim Phillips
  0 siblings, 1 reply; 3+ messages in thread
From: Li Zhijian @ 2018-05-09  7:45 UTC (permalink / raw)
  To: linux-kernel, acme
  Cc: peterz, mingo, alexander.shishkin, jolsa, namhyung, philip.li,
	Li Zhijian, Thomas Richter, Arnaldo Carvalho de Melo

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/libc-2.25.so | grep inet_pton
nm: /lib/x86_64-linux-gnu/libc-2.25.so: no symbols

it looks libc.so 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:
...snip...
  -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 <tmricht@linux.vnet.ibm.com>
CC: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
---
 tools/perf/tests/shell/record+probe_libc_inet_pton.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/tests/shell/record+probe_libc_inet_pton.sh b/tools/perf/tests/shell/record+probe_libc_inet_pton.sh
index 016882d..deec366 100755
--- a/tools/perf/tests/shell/record+probe_libc_inet_pton.sh
+++ b/tools/perf/tests/shell/record+probe_libc_inet_pton.sh
@@ -11,7 +11,7 @@
 . $(dirname $0)/lib/probe.sh
 
 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() {
 	idx=0
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] perf test shell: Add -D to check dynamic symbols for ubuntu/debian
  2018-05-09  7:45 [PATCH v2] perf test shell: Add -D to check dynamic symbols for ubuntu/debian Li Zhijian
@ 2018-05-09 21:41 ` Kim Phillips
  2018-05-10  1:11   ` Li Zhijian
  0 siblings, 1 reply; 3+ messages in thread
From: Kim Phillips @ 2018-05-09 21:41 UTC (permalink / raw)
  To: Li Zhijian
  Cc: linux-kernel, acme, peterz, mingo, alexander.shishkin, jolsa,
	namhyung, philip.li, Thomas Richter, Arnaldo Carvalho de Melo

On Wed, 9 May 2018 15:45:29 +0800
Li Zhijian <lizhijian@cn.fujitsu.com> wrote:

> 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/libc-2.25.so | grep inet_pton
> nm: /lib/x86_64-linux-gnu/libc-2.25.so: no symbols
> 
> it looks libc.so has different symbol compositions at different distros

I'm wondering if that is because libc6-dbg isn't installed?:

ubuntu$ nm -g /usr/lib/debug/lib/x86_64-linux-gnu/libc-2.26.so | grep inet_pton
0000000000136340 W inet_pton
0000000000136010 T __inet_pton_length

Kim

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] perf test shell: Add -D to check dynamic symbols for ubuntu/debian
  2018-05-09 21:41 ` Kim Phillips
@ 2018-05-10  1:11   ` Li Zhijian
  0 siblings, 0 replies; 3+ messages in thread
From: Li Zhijian @ 2018-05-10  1:11 UTC (permalink / raw)
  To: Kim Phillips
  Cc: linux-kernel, acme, peterz, mingo, alexander.shishkin, jolsa,
	namhyung, philip.li, Thomas Richter, Arnaldo Carvalho de Melo

The input file is from
lizhijian@haswell-OptiPlex-9020:~/lkp/linux/tools/perf/tests/shell$ grep libc= -A1  record+probe_libc_inet_pton.sh
libc=$(grep -w libc /proc/self/maps | head -1 | sed -r 's/.*[[:space:]](\/.*)/\1/g')
nm -gD $libc 2>/dev/null | fgrep -q inet_pton || exit 254

It mostly points to a striped libc.so(the runtime library)
lizhijian@haswell-OptiPlex-9020:~/lkp/linux/tools/perf/tests/shell$ grep -w libc /proc/self/maps | head -1 | sed -r 's/.*[[:space:]](\/.*)/\1/g'
/lib/x86_64-linux-gnu/libc-2.23.so

Although we can get the expected symbol from the debug library, it still doesn't work for this case.

Thanks
Zhijian


On 05/10/2018 05:41 AM, Kim Phillips wrote:
> On Wed, 9 May 2018 15:45:29 +0800
> Li Zhijian <lizhijian@cn.fujitsu.com> wrote:
>
>> 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/libc-2.25.so | grep inet_pton
>> nm: /lib/x86_64-linux-gnu/libc-2.25.so: no symbols
>>
>> it looks libc.so has different symbol compositions at different distros
> I'm wondering if that is because libc6-dbg isn't installed?:
>
> ubuntu$ nm -g /usr/lib/debug/lib/x86_64-linux-gnu/libc-2.26.so | grep inet_pton
> 0000000000136340 W inet_pton
> 0000000000136010 T __inet_pton_length
>
> Kim
>
>
> .
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-05-10  1:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-09  7:45 [PATCH v2] perf test shell: Add -D to check dynamic symbols for ubuntu/debian Li Zhijian
2018-05-09 21:41 ` Kim Phillips
2018-05-10  1:11   ` Li Zhijian

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.