All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: He Kuang <hekuang@huawei.com>
Cc: masami.hiramatsu.pt@hitachi.com, a.p.zijlstra@chello.nl,
	mingo@redhat.com, namhyung@kernel.org, wangnan0@huawei.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] perf probe: Make --source avaiable when probe with lazy_line
Date: Mon, 13 Apr 2015 17:56:59 -0300	[thread overview]
Message-ID: <20150413205659.GB14885@kernel.org> (raw)
In-Reply-To: <1428925290-5623-2-git-send-email-hekuang@huawei.com>

Em Mon, Apr 13, 2015 at 07:41:29PM +0800, He Kuang escreveu:
> Use get_real_path() to enable --source option when probe with lazy_line
> pattern.
> 
> Before this patch:
> 
>   $ perf probe -s ./kernel_src/ -k ./vmlinux --add='fs/super.c;s->s_count=1;'
>   Failed to open fs/super.c: No such file or directory
>     Error: Failed to add events.
> 
> After this patch:
> 
>   $ perf probe -s ./kernel_src/ -k ./vmlinux  --add='fs/super.c;s->s_count=1;'
>   Added new events:
>     probe:_stext         (on @fs/super.c)
>     probe:_stext_1       (on @fs/super.c)
>   ...

Tried just doing:

[root@ssdandy ~]# ulimit -c 100000000
[root@ssdandy ~]# perf probe --add='fs/super.c;s->s_count=1;'
Segmentation fault (core dumped)

I.e. not specifying vmlinux, as it finds the right one looking at the vmlinux path,
and as well not specifying -s, as it should find that as well from the vmlinux file,
but here I get a segfault:

[root@ssdandy ~]# gdb -c core.26128 ~/bin/perf
<SNIP>
Core was generated by `perf probe --add=fs/super.c;s->s_count=1;'.
Program terminated with signal 11, Segmentation fault.
#0  0x00007f2a021301c1 in dwarf_tag () from /lib64/libdw.so.1
Missing separate debuginfos, use: debuginfo-install audit-libs-2.4.1-5.el7.x86_64 bzip2-libs-1.0.6-12.el7.x86_64 elfutils-libelf-0.160-1.el7.x86_64 elfutils-libs-0.160-1.el7.x86_64 glibc-2.17-78.el7.x86_64 libgcc-4.8.3-9.el7.x86_64 libunwind-1.1-3.el7.x86_64 nss-softokn-freebl-3.16.2.3-9.el7.x86_64 numactl-libs-2.0.9-4.el7.x86_64 perl-libs-5.16.3-285.el7.x86_64 python-libs-2.7.5-16.el7.x86_64 slang-2.2.4-11.el7.x86_64 xz-libs-5.1.2-9alpha.el7.x86_64 zlib-1.2.7-13.el7.x86_64
(gdb) bt
#0  0x00007f2a021301c1 in dwarf_tag () from /lib64/libdw.so.1

#1  0x00000000004e3b78 in die_walk_lines (rt_die=rt_die@entry=0x0, callback=callback@entry=0x4e0b10 <probe_point_lazy_walker>, data=data@entry=0x7ffff2da1750) at util/dwarf-aux.c:690
#2  0x00000000004dff19 in find_probe_point_lazy (sp_die=sp_die@entry=0x0, pf=pf@entry=0x7ffff2da1750) at util/probe-finder.c:867
#3  0x00000000004e06e2 in debuginfo__find_probes (pf=pf@entry=0x7ffff2da1750, dbg=0x1767c50) at util/probe-finder.c:1058
#4  0x00000000004e13b2 in debuginfo__find_trace_events (dbg=dbg@entry=0x1767c50, pev=pev@entry=0x8fcd90 <params+16>, tevs=tevs@entry=0x1763978, max_tevs=max_tevs@entry=128) at util/probe-finder.c:1218
#5  0x00000000004dcbea in try_to_find_probe_trace_events (target=0x0, max_tevs=128, tevs=0x1763978, pev=0x8fcd90 <params+16>) at util/probe-event.c:611
#6  convert_to_probe_trace_events (target=0x0, max_tevs=128, tevs=0x1763978, pev=0x8fcd90 <params+16>) at util/probe-event.c:2645
#7  add_perf_probe_events (pevs=pevs@entry=0x8fcd90 <params+16>, npevs=<optimized out>, max_tevs=128, force_add=false) at util/probe-event.c:2680
#8  0x000000000044fa7b in __cmd_probe (argc=<optimized out>, argv=argv@entry=0x7ffff2da2600, prefix=<optimized out>) at builtin-probe.c:504
#9  0x000000000044fc34 in cmd_probe (argc=<optimized out>, argv=0x7ffff2da2600, prefix=<optimized out>) at builtin-probe.c:521
#10 0x0000000000470b35 in run_builtin (p=p@entry=0x838420 <commands+384>, argc=argc@entry=2, argv=argv@entry=0x7ffff2da2600) at perf.c:370
#11 0x000000000041d220 in handle_internal_command (argv=0x7ffff2da2600, argc=2) at perf.c:429
#12 run_argv (argv=0x7ffff2da2380, argcp=0x7ffff2da238c) at perf.c:473
#13 main (argc=2, argv=0x7ffff2da2600) at perf.c:588
(gdb) 

Now with your patch, another coredump:

[root@ssdandy ~]# rm -f core.26128 
[root@ssdandy ~]# perf probe --add='fs/super.c;s->s_count=1;'
Segmentation fault (core dumped)
[root@ssdandy ~]#
[root@ssdandy ~]# gdb -c core.26712 ~/bin/perf
<SNIP>
Core was generated by `perf probe --add=fs/super.c;s->s_count=1;'.
Program terminated with signal 11, Segmentation fault.
#0  0x00007f25cf4e61c1 in dwarf_tag () from /lib64/libdw.so.1
Missing separate debuginfos, use: debuginfo-install audit-libs-2.4.1-5.el7.x86_64 bzip2-libs-1.0.6-12.el7.x86_64 elfutils-libelf-0.160-1.el7.x86_64 elfutils-libs-0.160-1.el7.x86_64 glibc-2.17-78.el7.x86_64 libgcc-4.8.3-9.el7.x86_64 libunwind-1.1-3.el7.x86_64 nss-softokn-freebl-3.16.2.3-9.el7.x86_64 numactl-libs-2.0.9-4.el7.x86_64 perl-libs-5.16.3-285.el7.x86_64 python-libs-2.7.5-16.el7.x86_64 slang-2.2.4-11.el7.x86_64 xz-libs-5.1.2-9alpha.el7.x86_64 zlib-1.2.7-13.el7.x86_64
(gdb) bt
#0  0x00007f25cf4e61c1 in dwarf_tag () from /lib64/libdw.so.1
#1  0x00000000004e3c18 in die_walk_lines (rt_die=rt_die@entry=0x0, callback=callback@entry=0x4e0bb0 <probe_point_lazy_walker>, data=data@entry=0x7ffdf9244df0) at util/dwarf-aux.c:690
#2  0x00000000004dff9b in find_probe_point_lazy (sp_die=sp_die@entry=0x0, pf=pf@entry=0x7ffdf9244df0) at util/probe-finder.c:879
#3  0x00000000004e0782 in debuginfo__find_probes (pf=pf@entry=0x7ffdf9244df0, dbg=0xe3ec50) at util/probe-finder.c:1070
#4  0x00000000004e1452 in debuginfo__find_trace_events (dbg=dbg@entry=0xe3ec50, pev=pev@entry=0x8fcd90 <params+16>, tevs=tevs@entry=0xe3a978, max_tevs=max_tevs@entry=128) at util/probe-finder.c:1230
#5  0x00000000004dcc2a in try_to_find_probe_trace_events (target=0x0, max_tevs=128, tevs=0xe3a978, pev=0x8fcd90 <params+16>) at util/probe-event.c:611
#6  convert_to_probe_trace_events (target=0x0, max_tevs=128, tevs=0xe3a978, pev=0x8fcd90 <params+16>) at util/probe-event.c:2645
#7  add_perf_probe_events (pevs=pevs@entry=0x8fcd90 <params+16>, npevs=<optimized out>, max_tevs=128, force_add=false) at util/probe-event.c:2680
#8  0x000000000044faab in __cmd_probe (argc=<optimized out>, argv=argv@entry=0x7ffdf9245ca0, prefix=<optimized out>) at builtin-probe.c:504
#9  0x000000000044fc64 in cmd_probe (argc=<optimized out>, argv=0x7ffdf9245ca0, prefix=<optimized out>) at builtin-probe.c:521
#10 0x0000000000470b65 in run_builtin (p=p@entry=0x838420 <commands+384>, argc=argc@entry=2, argv=argv@entry=0x7ffdf9245ca0) at perf.c:370
#11 0x000000000041d250 in handle_internal_command (argv=0x7ffdf9245ca0, argc=2) at perf.c:429
#12 run_argv (argv=0x7ffdf9245a20, argcp=0x7ffdf9245a2c) at perf.c:473
#13 main (argc=2, argv=0x7ffdf9245ca0) at perf.c:588
(gdb)

Trying exactly as you did, first without the patch:

[root@ssdandy linux]# perf probe -s /home/acme/git/linux/ -k ../build/v4.0.0-rc6+/vmlinux  --add='fs/super.c;s->s_count=1;'
Segmentation fault (core dumped)
[root@ssdandy linux]# 

Now with it:

[root@ssdandy linux]# perf probe -s /home/acme/git/linux/ -k ../build/v4.0.0-rc6+/vmlinux  --add='fs/super.c;s->s_count=1;'
Segmentation fault (core dumped)
[root@ssdandy linux]#

Core was generated by `perf probe -s /home/acme/git/linux/ -k ../build/v4.0.0-rc6+/vmlinux --add=fs/su'.
Program terminated with signal 11, Segmentation fault.
#0  0x00007f76795c01c1 in dwarf_tag () from /lib64/libdw.so.1
Missing separate debuginfos, use: debuginfo-install audit-libs-2.4.1-5.el7.x86_64 bzip2-libs-1.0.6-12.el7.x86_64 elfutils-libelf-0.160-1.el7.x86_64 elfutils-libs-0.160-1.el7.x86_64 glibc-2.17-78.el7.x86_64 libgcc-4.8.3-9.el7.x86_64 libunwind-1.1-3.el7.x86_64 nss-softokn-freebl-3.16.2.3-9.el7.x86_64 numactl-libs-2.0.9-4.el7.x86_64 perl-libs-5.16.3-285.el7.x86_64 python-libs-2.7.5-16.el7.x86_64 slang-2.2.4-11.el7.x86_64 xz-libs-5.1.2-9alpha.el7.x86_64 zlib-1.2.7-13.el7.x86_64
(gdb) bt
#0  0x00007f76795c01c1 in dwarf_tag () from /lib64/libdw.so.1
#1  0x00000000004e3c18 in die_walk_lines (rt_die=rt_die@entry=0x0, callback=callback@entry=0x4e0bb0 <probe_point_lazy_walker>, data=data@entry=0x7ffcf282f280) at util/dwarf-aux.c:690
#2  0x00000000004dff9b in find_probe_point_lazy (sp_die=sp_die@entry=0x0, pf=pf@entry=0x7ffcf282f280) at util/probe-finder.c:879
#3  0x00000000004e0782 in debuginfo__find_probes (pf=pf@entry=0x7ffcf282f280, dbg=0x19c1b30) at util/probe-finder.c:1070
#4  0x00000000004e1452 in debuginfo__find_trace_events (dbg=dbg@entry=0x19c1b30, pev=pev@entry=0x8fcd90 <params+16>, tevs=tevs@entry=0x19be778, max_tevs=max_tevs@entry=128) at util/probe-finder.c:1230
#5  0x00000000004dcc2a in try_to_find_probe_trace_events (target=0x0, max_tevs=128, tevs=0x19be778, pev=0x8fcd90 <params+16>) at util/probe-event.c:611
#6  convert_to_probe_trace_events (target=0x0, max_tevs=128, tevs=0x19be778, pev=0x8fcd90 <params+16>) at util/probe-event.c:2645
#7  add_perf_probe_events (pevs=pevs@entry=0x8fcd90 <params+16>, npevs=<optimized out>, max_tevs=128, force_add=false) at util/probe-event.c:2680
#8  0x000000000044faab in __cmd_probe (argc=<optimized out>, argv=argv@entry=0x7ffcf2830130, prefix=<optimized out>) at builtin-probe.c:504
#9  0x000000000044fc64 in cmd_probe (argc=<optimized out>, argv=0x7ffcf2830130, prefix=<optimized out>) at builtin-probe.c:521
#10 0x0000000000470b65 in run_builtin (p=p@entry=0x838420 <commands+384>, argc=argc@entry=6, argv=argv@entry=0x7ffcf2830130) at perf.c:370
#11 0x000000000041d250 in handle_internal_command (argv=0x7ffcf2830130, argc=6) at perf.c:429
#12 run_argv (argv=0x7ffcf282feb0, argcp=0x7ffcf282febc) at perf.c:473
#13 main (argc=6, argv=0x7ffcf2830130) at perf.c:588
(gdb)

And:

[acme@ssdandy linux]$ ls -la /home/acme/git/linux/fs/super.c
-rw-rw-r--. 1 acme acme 36192 Abr  7 17:59 /home/acme/git/linux/fs/super.c

Processed [1/3], looking if [3/3] can be applied independently of this one.

- Arnaldo


  parent reply	other threads:[~2015-04-13 20:57 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-13 11:41 [PATCH 1/3] perf probe: Set retprobe flag when probe in address-based alternative mode He Kuang
2015-04-13 11:41 ` [PATCH 2/3] perf probe: Make --source avaiable when probe with lazy_line He Kuang
2015-04-13 15:41   ` Masami Hiramatsu
2015-04-13 16:05     ` Arnaldo Carvalho de Melo
2015-04-13 20:56   ` Arnaldo Carvalho de Melo [this message]
2015-04-13 20:57     ` Arnaldo Carvalho de Melo
2015-04-13 21:00       ` Arnaldo Carvalho de Melo
2015-04-13 11:41 ` [PATCH 3/3] perf probe: Fix segfault when probe with lazy_line to file He Kuang
2015-04-13 16:03   ` Masami Hiramatsu
2015-04-14 12:18   ` [tip:perf/urgent] " tip-bot for He Kuang
2015-04-13 14:39 ` [PATCH 1/3] perf probe: Set retprobe flag when probe in address-based alternative mode Arnaldo Carvalho de Melo
2015-04-13 14:42   ` Arnaldo Carvalho de Melo
2015-04-13 15:38     ` He Kuang
2015-04-13 20:42       ` Arnaldo Carvalho de Melo
2015-04-13 15:23   ` He Kuang
2015-04-13 16:23     ` Arnaldo Carvalho de Melo
2015-04-13 15:42 ` Masami Hiramatsu
2015-04-13 16:05   ` Arnaldo Carvalho de Melo
2015-04-14 12:17 ` [tip:perf/urgent] " tip-bot for He Kuang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150413205659.GB14885@kernel.org \
    --to=acme@kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=hekuang@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=wangnan0@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.