All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf test record+probe_libc_inet_pton: expect [unknown] for ping as well
@ 2018-06-28  7:16 Li Zhijian
  2018-06-29 15:17 ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 3+ messages in thread
From: Li Zhijian @ 2018-06-28  7:16 UTC (permalink / raw)
  To: peterz, mingo, acme, alexander.shishkin, jolsa, namhyung, linux-kernel
  Cc: Li Zhijian, Sandipan Das, Thomas Richter

On system which has not installed debuginfo of iputils(ping) will fail like:
~/lkp/linux/tools/perf$ sudo ./perf test ping -v
63: probe libc's inet_pton & backtrace it with ping       :
--- start ---
test child forked, pid 4207
ping 4224 [007] 3034121.295510: probe_libc:inet_pton: (7fedfccb2200)
7fedfccb2200 __GI___inet_pton+0x0 (/lib/x86_64-linux-gnu/libc-2.23.so)
7fedfcc7ad5e getaddrinfo+0xee (/lib/x86_64-linux-gnu/libc-2.23.so)
55e3239a9f4d [unknown] (/bin/ping)
FAIL: expected backtrace entry 3
".*\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$" got "55e3239a9f4d [unknown] (/bin/ping)"
test child finished with -1
---- end ----
probe libc's inet_pton & backtrace it with ping: FAILED!

To be compatible with this system, expects [unknown] as well

Fixes: 7903a7086723 ("perf script: Show symbol offsets by default")
CC: Sandipan Das <sandipan@linux.vnet.ibm.com>
CC: Thomas Richter <tmricht@linux.ibm.com>
Reported-by: kernel test robot <xiaolong.ye@intel.com>
Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
---
 tools/perf/tests/shell/record+probe_libc_inet_pton.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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 2630570..ebb6549 100755
--- a/tools/perf/tests/shell/record+probe_libc_inet_pton.sh
+++ b/tools/perf/tests/shell/record+probe_libc_inet_pton.sh
@@ -22,12 +22,12 @@ trace_libc_inet_pton_backtrace() {
 		eventattr='call-graph=dwarf,max-stack=4'
 		expected[2]="gaih_inet.*\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$"
 		expected[3]="(__GI_)?getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$"
-		expected[4]="main\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$"
+		expected[4]=".*(\+0x[[:xdigit:]]|\[unknown\])+[[:space:]]\(.*/bin/ping.*\)$"
 		;;
 	*)
 		eventattr='max-stack=3'
 		expected[2]="getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc\)$"
-		expected[3]=".*\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$"
+		expected[3]=".*(\+0x[[:xdigit:]]|\[unknown\])+[[:space:]]\(.*/bin/ping.*\)$"
 		;;
 	esac
 
-- 
2.7.4


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

* Re: [PATCH] perf test record+probe_libc_inet_pton: expect [unknown] for ping as well
  2018-06-28  7:16 [PATCH] perf test record+probe_libc_inet_pton: expect [unknown] for ping as well Li Zhijian
@ 2018-06-29 15:17 ` Arnaldo Carvalho de Melo
  2018-07-01  5:40   ` Li Zhijian
  0 siblings, 1 reply; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2018-06-29 15:17 UTC (permalink / raw)
  To: Li Zhijian
  Cc: peterz, mingo, alexander.shishkin, jolsa, namhyung, linux-kernel,
	Sandipan Das, Thomas Richter

Em Thu, Jun 28, 2018 at 03:16:00PM +0800, Li Zhijian escreveu:
> On system which has not installed debuginfo of iputils(ping) will fail like:
> ~/lkp/linux/tools/perf$ sudo ./perf test ping -v

I think that we should try to check if the required debuginfo package is
installed and if so, expect the symbol resolution that takes place in
that case. Other wise expect [unknown], this way we don't leave this
test accepting almost anything in any case.

- Arnaldo

> 63: probe libc's inet_pton & backtrace it with ping       :
> --- start ---
> test child forked, pid 4207
> ping 4224 [007] 3034121.295510: probe_libc:inet_pton: (7fedfccb2200)
> 7fedfccb2200 __GI___inet_pton+0x0 (/lib/x86_64-linux-gnu/libc-2.23.so)
> 7fedfcc7ad5e getaddrinfo+0xee (/lib/x86_64-linux-gnu/libc-2.23.so)
> 55e3239a9f4d [unknown] (/bin/ping)
> FAIL: expected backtrace entry 3
> ".*\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$" got "55e3239a9f4d [unknown] (/bin/ping)"
> test child finished with -1
> ---- end ----
> probe libc's inet_pton & backtrace it with ping: FAILED!
> 
> To be compatible with this system, expects [unknown] as well
> 
> Fixes: 7903a7086723 ("perf script: Show symbol offsets by default")
> CC: Sandipan Das <sandipan@linux.vnet.ibm.com>
> CC: Thomas Richter <tmricht@linux.ibm.com>
> Reported-by: kernel test robot <xiaolong.ye@intel.com>
> Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
> ---
>  tools/perf/tests/shell/record+probe_libc_inet_pton.sh | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> 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 2630570..ebb6549 100755
> --- a/tools/perf/tests/shell/record+probe_libc_inet_pton.sh
> +++ b/tools/perf/tests/shell/record+probe_libc_inet_pton.sh
> @@ -22,12 +22,12 @@ trace_libc_inet_pton_backtrace() {
>  		eventattr='call-graph=dwarf,max-stack=4'
>  		expected[2]="gaih_inet.*\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$"
>  		expected[3]="(__GI_)?getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$"
> -		expected[4]="main\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$"
> +		expected[4]=".*(\+0x[[:xdigit:]]|\[unknown\])+[[:space:]]\(.*/bin/ping.*\)$"
>  		;;
>  	*)
>  		eventattr='max-stack=3'
>  		expected[2]="getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc\)$"
> -		expected[3]=".*\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$"
> +		expected[3]=".*(\+0x[[:xdigit:]]|\[unknown\])+[[:space:]]\(.*/bin/ping.*\)$"
>  		;;
>  	esac
>  
> -- 
> 2.7.4

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

* Re: [PATCH] perf test record+probe_libc_inet_pton: expect [unknown] for ping as well
  2018-06-29 15:17 ` Arnaldo Carvalho de Melo
@ 2018-07-01  5:40   ` Li Zhijian
  0 siblings, 0 replies; 3+ messages in thread
From: Li Zhijian @ 2018-07-01  5:40 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: peterz, mingo, alexander.shishkin, jolsa, namhyung, linux-kernel,
	Sandipan Das, Thomas Richter


On 06/29/2018 11:17 PM, Arnaldo Carvalho de Melo wrote:
> Em Thu, Jun 28, 2018 at 03:16:00PM +0800, Li Zhijian escreveu:
>> On system which has not installed debuginfo of iputils(ping) will fail like:
>> ~/lkp/linux/tools/perf$ sudo ./perf test ping -v
> I think that we should try to check if the required debuginfo package is
> installed and if so, expect the symbol resolution that takes place in
> that case. Other wise expect [unknown], this way we don't leave this
> test accepting almost anything in any case.

Looks ping binary in different distros include different symbol.
without this patch, ubuntu 16.04 is good and debian 9 is bad when they both have not installed debuginfo for ping.

and then after i installed debuginfo for ping(iputils-ping-dbgsym), test become passed as well on debian 9

Debian 9
bofore installing debuginfo, it includes [unknown]
root@vm-lkp-nex04-8G-10 /usr/src/linux-perf-x86_64-randconfig-w0-06061439-fb43d6cb91ef57d9e58d5f69b423784ff4a4c374/tools/perf# ./perf test ping -v
62: probe libc's inet_pton & backtrace it with ping       :
--- start ---
test child forked, pid 6324
ping 6341 [000] 4470.361330: probe_libc:inet_pton: (7f9f3900eaa0)
105aa0 inet_pton (/lib/x86_64-linux-gnu/libc-2.24.so)
d52f8 getaddrinfo (/lib/x86_64-linux-gnu/libc-2.24.so)
3ebe [unknown] (/bin/ping)
test child finished with 0

------------------------------
after install debuginfo
root@vm-lkp-nex04-8G-10 /usr/src/linux-perf-x86_64-randconfig-w0-06061439-fb43d6cb91ef57d9e58d5f69b423784ff4a4c374/tools/perf# ./perf test ping -v
62: probe libc's inet_pton & backtrace it with ping       :
--- start ---
test child forked, pid 6387
ping 6404 [000] 4488.855086: probe_libc:inet_pton: (7fb5bcc7caa0)
105aa0 inet_pton (/lib/x86_64-linux-gnu/libc-2.24.so)
d52f8 getaddrinfo (/lib/x86_64-linux-gnu/libc-2.24.so)
3ebe main (/bin/ping)
test child finished with 0



Thanks


>
> - Arnaldo
>
>> 63: probe libc's inet_pton & backtrace it with ping       :
>> --- start ---
>> test child forked, pid 4207
>> ping 4224 [007] 3034121.295510: probe_libc:inet_pton: (7fedfccb2200)
>> 7fedfccb2200 __GI___inet_pton+0x0 (/lib/x86_64-linux-gnu/libc-2.23.so)
>> 7fedfcc7ad5e getaddrinfo+0xee (/lib/x86_64-linux-gnu/libc-2.23.so)
>> 55e3239a9f4d [unknown] (/bin/ping)
>> FAIL: expected backtrace entry 3
>> ".*\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$" got "55e3239a9f4d [unknown] (/bin/ping)"
>> test child finished with -1
>> ---- end ----
>> probe libc's inet_pton & backtrace it with ping: FAILED!
>>
>> To be compatible with this system, expects [unknown] as well
>>
>> Fixes: 7903a7086723 ("perf script: Show symbol offsets by default")
>> CC: Sandipan Das <sandipan@linux.vnet.ibm.com>
>> CC: Thomas Richter <tmricht@linux.ibm.com>
>> Reported-by: kernel test robot <xiaolong.ye@intel.com>
>> Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
>> ---
>>   tools/perf/tests/shell/record+probe_libc_inet_pton.sh | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> 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 2630570..ebb6549 100755
>> --- a/tools/perf/tests/shell/record+probe_libc_inet_pton.sh
>> +++ b/tools/perf/tests/shell/record+probe_libc_inet_pton.sh
>> @@ -22,12 +22,12 @@ trace_libc_inet_pton_backtrace() {
>>   		eventattr='call-graph=dwarf,max-stack=4'
>>   		expected[2]="gaih_inet.*\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$"
>>   		expected[3]="(__GI_)?getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$"
>> -		expected[4]="main\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$"
>> +		expected[4]=".*(\+0x[[:xdigit:]]|\[unknown\])+[[:space:]]\(.*/bin/ping.*\)$"
>>   		;;
>>   	*)
>>   		eventattr='max-stack=3'
>>   		expected[2]="getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc\)$"
>> -		expected[3]=".*\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$"
>> +		expected[3]=".*(\+0x[[:xdigit:]]|\[unknown\])+[[:space:]]\(.*/bin/ping.*\)$"
>>   		;;
>>   	esac
>>   
>> -- 
>> 2.7.4
>
> .
>

-- 
Best regards.
Li Zhijian (8528)




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

end of thread, other threads:[~2018-07-01  5:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-28  7:16 [PATCH] perf test record+probe_libc_inet_pton: expect [unknown] for ping as well Li Zhijian
2018-06-29 15:17 ` Arnaldo Carvalho de Melo
2018-07-01  5:40   ` 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.