* How to correctly decode fun+X/Y
@ 2015-12-03 18:14 Matwey V. Kornilov
2015-12-03 18:34 ` Dave Tian
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Matwey V. Kornilov @ 2015-12-03 18:14 UTC (permalink / raw)
To: kernelnewbies
Hello,
I have the following stack trace:
[ 1351.381696] a.out S c0afb050 0 1676 1658 0x00000000
[ 1351.387048] [<c0afb050>] (__schedule) from [<c0afb4d0>]
(schedule+0x58/0xcc)
[ 1351.392436] [<c0afb4d0>] (schedule) from [<c069369c>]
(tty_port_block_til_ready+0x1a8/0x35c)
[ 1351.396937] [<c069369c>] (tty_port_block_til_ready) from [<c06ab220>]
(uart_open+0x118/0x158)
[ 1351.402560] [<c06ab220>] (uart_open) from [<c068b768>]
(tty_open+0x11c/0x600)
[ 1351.407043] [<c068b768>] (tty_open) from [<c03e1ce4>]
(chrdev_open+0xb4/0x188)
[ 1351.412556] [<c03e1ce4>] (chrdev_open) from [<c03db3dc>]
(do_dentry_open+0x230/0x330)
[ 1351.417038] [<c03db3dc>] (do_dentry_open) from [<c03dc64c>]
(vfs_open+0x64/0x6c)
[ 1351.422470] [<c03dc64c>] (vfs_open) from [<c03eaf5c>]
(do_last+0x510/0xd94)
[ 1351.426909] [<c03eaf5c>] (do_last) from [<c03eb86c>]
(path_openat+0x8c/0x270)
[ 1351.432398] [<c03eb86c>] (path_openat) from [<c03ecd78>]
(do_filp_open+0x70/0xd4)
[ 1351.436815] [<c03ecd78>] (do_filp_open) from [<c03dc9cc>]
(do_sys_open+0x120/0x1e4)
[ 1351.442117] [<c03dc9cc>] (do_sys_open) from [<c03dcab8>]
(SyS_open+0x28/0x30)
[ 1351.447046] [<c03dcab8>] (SyS_open) from [<c021cd40>]
(ret_fast_syscall+0x0/0x34)
Could please explain, how to correctly decode
tty_port_block_til_ready+0x1a8/0x35c to the instruction or line of code
using gdb?
I have kernel image and separate debug info.
^ permalink raw reply [flat|nested] 5+ messages in thread
* How to correctly decode fun+X/Y
2015-12-03 18:14 How to correctly decode fun+X/Y Matwey V. Kornilov
@ 2015-12-03 18:34 ` Dave Tian
2015-12-03 18:43 ` Nicholas Mc Guire
2015-12-04 9:12 ` Daniel Baluta
2 siblings, 0 replies; 5+ messages in thread
From: Dave Tian @ 2015-12-03 18:34 UTC (permalink / raw)
To: kernelnewbies
addr2line -e /path_to_vmlinux c069369c
-daveti
> On Dec 3, 2015, at 1:14 PM, Matwey V. Kornilov <matwey.kornilov@gmail.com> wrote:
>
> Hello,
>
> I have the following stack trace:
>
> [ 1351.381696] a.out S c0afb050 0 1676 1658 0x00000000
> [ 1351.387048] [<c0afb050>] (__schedule) from [<c0afb4d0>]
> (schedule+0x58/0xcc)
> [ 1351.392436] [<c0afb4d0>] (schedule) from [<c069369c>]
> (tty_port_block_til_ready+0x1a8/0x35c)
> [ 1351.396937] [<c069369c>] (tty_port_block_til_ready) from [<c06ab220>]
> (uart_open+0x118/0x158)
> [ 1351.402560] [<c06ab220>] (uart_open) from [<c068b768>]
> (tty_open+0x11c/0x600)
> [ 1351.407043] [<c068b768>] (tty_open) from [<c03e1ce4>]
> (chrdev_open+0xb4/0x188)
> [ 1351.412556] [<c03e1ce4>] (chrdev_open) from [<c03db3dc>]
> (do_dentry_open+0x230/0x330)
> [ 1351.417038] [<c03db3dc>] (do_dentry_open) from [<c03dc64c>]
> (vfs_open+0x64/0x6c)
> [ 1351.422470] [<c03dc64c>] (vfs_open) from [<c03eaf5c>]
> (do_last+0x510/0xd94)
> [ 1351.426909] [<c03eaf5c>] (do_last) from [<c03eb86c>]
> (path_openat+0x8c/0x270)
> [ 1351.432398] [<c03eb86c>] (path_openat) from [<c03ecd78>]
> (do_filp_open+0x70/0xd4)
> [ 1351.436815] [<c03ecd78>] (do_filp_open) from [<c03dc9cc>]
> (do_sys_open+0x120/0x1e4)
> [ 1351.442117] [<c03dc9cc>] (do_sys_open) from [<c03dcab8>]
> (SyS_open+0x28/0x30)
> [ 1351.447046] [<c03dcab8>] (SyS_open) from [<c021cd40>]
> (ret_fast_syscall+0x0/0x34)
>
>
> Could please explain, how to correctly decode
> tty_port_block_til_ready+0x1a8/0x35c to the instruction or line of code
> using gdb?
>
> I have kernel image and separate debug info.
>
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
^ permalink raw reply [flat|nested] 5+ messages in thread
* How to correctly decode fun+X/Y
2015-12-03 18:14 How to correctly decode fun+X/Y Matwey V. Kornilov
2015-12-03 18:34 ` Dave Tian
@ 2015-12-03 18:43 ` Nicholas Mc Guire
2015-12-04 9:12 ` Daniel Baluta
2 siblings, 0 replies; 5+ messages in thread
From: Nicholas Mc Guire @ 2015-12-03 18:43 UTC (permalink / raw)
To: kernelnewbies
On Thu, Dec 03, 2015 at 09:14:38PM +0300, Matwey V. Kornilov wrote:
> Hello,
>
> I have the following stack trace:
>
> [ 1351.381696] a.out S c0afb050 0 1676 1658 0x00000000
> [ 1351.387048] [<c0afb050>] (__schedule) from [<c0afb4d0>]
> (schedule+0x58/0xcc)
> [ 1351.392436] [<c0afb4d0>] (schedule) from [<c069369c>]
> (tty_port_block_til_ready+0x1a8/0x35c)
> [ 1351.396937] [<c069369c>] (tty_port_block_til_ready) from [<c06ab220>]
> (uart_open+0x118/0x158)
> [ 1351.402560] [<c06ab220>] (uart_open) from [<c068b768>]
> (tty_open+0x11c/0x600)
> [ 1351.407043] [<c068b768>] (tty_open) from [<c03e1ce4>]
> (chrdev_open+0xb4/0x188)
> [ 1351.412556] [<c03e1ce4>] (chrdev_open) from [<c03db3dc>]
> (do_dentry_open+0x230/0x330)
> [ 1351.417038] [<c03db3dc>] (do_dentry_open) from [<c03dc64c>]
> (vfs_open+0x64/0x6c)
> [ 1351.422470] [<c03dc64c>] (vfs_open) from [<c03eaf5c>]
> (do_last+0x510/0xd94)
> [ 1351.426909] [<c03eaf5c>] (do_last) from [<c03eb86c>]
> (path_openat+0x8c/0x270)
> [ 1351.432398] [<c03eb86c>] (path_openat) from [<c03ecd78>]
> (do_filp_open+0x70/0xd4)
> [ 1351.436815] [<c03ecd78>] (do_filp_open) from [<c03dc9cc>]
> (do_sys_open+0x120/0x1e4)
> [ 1351.442117] [<c03dc9cc>] (do_sys_open) from [<c03dcab8>]
> (SyS_open+0x28/0x30)
> [ 1351.447046] [<c03dcab8>] (SyS_open) from [<c021cd40>]
> (ret_fast_syscall+0x0/0x34)
>
>
> Could please explain, how to correctly decode
> tty_port_block_til_ready+0x1a8/0x35c to the instruction or line of code
> using gdb?
>
> I have kernel image and separate debug info.
>
The numbers after the symbol name are offset/length
so in your case the offset from tty_port_block_til_ready was
0x1a8 and the length of the function tty_port_block_til_ready
0x35c.
if you have the appropriate kernel sources also it
probably would be easier if you generate the .lst file
that contains tty_port_block_til_ready => drivers/tty/tty_port.c
so make drivers/tty/tty_port.lst would give you
the annotated c file with the assebler code interleaved
and then you can inspect the relevant assembler in the
c-code context.
thx!
hofrat
^ permalink raw reply [flat|nested] 5+ messages in thread
* How to correctly decode fun+X/Y
2015-12-03 18:14 How to correctly decode fun+X/Y Matwey V. Kornilov
2015-12-03 18:34 ` Dave Tian
2015-12-03 18:43 ` Nicholas Mc Guire
@ 2015-12-04 9:12 ` Daniel Baluta
2015-12-07 8:53 ` Andrey Skvortsov
2 siblings, 1 reply; 5+ messages in thread
From: Daniel Baluta @ 2015-12-04 9:12 UTC (permalink / raw)
To: kernelnewbies
On Thu, Dec 3, 2015 at 8:14 PM, Matwey V. Kornilov
<matwey.kornilov@gmail.com> wrote:
> Hello,
>
> I have the following stack trace:
>
> [ 1351.381696] a.out S c0afb050 0 1676 1658 0x00000000
> [ 1351.387048] [<c0afb050>] (__schedule) from [<c0afb4d0>]
> (schedule+0x58/0xcc)
> [ 1351.392436] [<c0afb4d0>] (schedule) from [<c069369c>]
> (tty_port_block_til_ready+0x1a8/0x35c)
> [ 1351.396937] [<c069369c>] (tty_port_block_til_ready) from [<c06ab220>]
> (uart_open+0x118/0x158)
> [ 1351.402560] [<c06ab220>] (uart_open) from [<c068b768>]
> (tty_open+0x11c/0x600)
> [ 1351.407043] [<c068b768>] (tty_open) from [<c03e1ce4>]
> (chrdev_open+0xb4/0x188)
> [ 1351.412556] [<c03e1ce4>] (chrdev_open) from [<c03db3dc>]
> (do_dentry_open+0x230/0x330)
> [ 1351.417038] [<c03db3dc>] (do_dentry_open) from [<c03dc64c>]
> (vfs_open+0x64/0x6c)
> [ 1351.422470] [<c03dc64c>] (vfs_open) from [<c03eaf5c>]
> (do_last+0x510/0xd94)
> [ 1351.426909] [<c03eaf5c>] (do_last) from [<c03eb86c>]
> (path_openat+0x8c/0x270)
> [ 1351.432398] [<c03eb86c>] (path_openat) from [<c03ecd78>]
> (do_filp_open+0x70/0xd4)
> [ 1351.436815] [<c03ecd78>] (do_filp_open) from [<c03dc9cc>]
> (do_sys_open+0x120/0x1e4)
> [ 1351.442117] [<c03dc9cc>] (do_sys_open) from [<c03dcab8>]
> (SyS_open+0x28/0x30)
> [ 1351.447046] [<c03dcab8>] (SyS_open) from [<c021cd40>]
> (ret_fast_syscall+0x0/0x34)
>
>
> Could please explain, how to correctly decode
> tty_port_block_til_ready+0x1a8/0x35c to the instruction or line of code
> using gdb?
$ gdb ./vmlinux
list *(tty_port_block_til_ready+0x1a8)
HTH,
Daniel.
^ permalink raw reply [flat|nested] 5+ messages in thread
* How to correctly decode fun+X/Y
2015-12-04 9:12 ` Daniel Baluta
@ 2015-12-07 8:53 ` Andrey Skvortsov
0 siblings, 0 replies; 5+ messages in thread
From: Andrey Skvortsov @ 2015-12-07 8:53 UTC (permalink / raw)
To: kernelnewbies
On 04 Dec, Daniel Baluta wrote:
> On Thu, Dec 3, 2015 at 8:14 PM, Matwey V. Kornilov
> <matwey.kornilov@gmail.com> wrote:
> > Hello,
> >
> > I have the following stack trace:
> >
> > [ 1351.381696] a.out S c0afb050 0 1676 1658 0x00000000
> > [ 1351.387048] [<c0afb050>] (__schedule) from [<c0afb4d0>]
> > (schedule+0x58/0xcc)
> > [ 1351.392436] [<c0afb4d0>] (schedule) from [<c069369c>]
> > (tty_port_block_til_ready+0x1a8/0x35c)
> > [ 1351.396937] [<c069369c>] (tty_port_block_til_ready) from [<c06ab220>]
> > (uart_open+0x118/0x158)
> > [ 1351.402560] [<c06ab220>] (uart_open) from [<c068b768>]
> > (tty_open+0x11c/0x600)
> > [ 1351.407043] [<c068b768>] (tty_open) from [<c03e1ce4>]
> > (chrdev_open+0xb4/0x188)
> > [ 1351.412556] [<c03e1ce4>] (chrdev_open) from [<c03db3dc>]
> > (do_dentry_open+0x230/0x330)
> > [ 1351.417038] [<c03db3dc>] (do_dentry_open) from [<c03dc64c>]
> > (vfs_open+0x64/0x6c)
> > [ 1351.422470] [<c03dc64c>] (vfs_open) from [<c03eaf5c>]
> > (do_last+0x510/0xd94)
> > [ 1351.426909] [<c03eaf5c>] (do_last) from [<c03eb86c>]
> > (path_openat+0x8c/0x270)
> > [ 1351.432398] [<c03eb86c>] (path_openat) from [<c03ecd78>]
> > (do_filp_open+0x70/0xd4)
> > [ 1351.436815] [<c03ecd78>] (do_filp_open) from [<c03dc9cc>]
> > (do_sys_open+0x120/0x1e4)
> > [ 1351.442117] [<c03dc9cc>] (do_sys_open) from [<c03dcab8>]
> > (SyS_open+0x28/0x30)
> > [ 1351.447046] [<c03dcab8>] (SyS_open) from [<c021cd40>]
> > (ret_fast_syscall+0x0/0x34)
> >
> >
> > Could please explain, how to correctly decode
> > tty_port_block_til_ready+0x1a8/0x35c to the instruction or line of code
> > using gdb?
>
> $ gdb ./vmlinux
>
> list *(tty_port_block_til_ready+0x1a8)
>
Or even easier using decode_stacktrace.sh from the linux
kernel tree (exists since 3.16).
Usage:
./decode_stacktrace.sh [vmlinux] [base path]
Where vmlinux is the vmlinux to extract line numbers from and base path
is the path that points to the root of the build tree, for example:
./decode_stacktrace.sh vmlinux /home/sasha/linux/ < input.log > output.log
Then stacktrace will include file and line number:
[ 635.148361] dump_stack (lib/dump_stack.c:52)
[ 635.149127] warn_slowpath_common (kernel/panic.c:418)
[ 635.150214] warn_slowpath_null (kernel/panic.c:453)
[ 635.151031] _oalloc_pages_slowpath+0x6a/0x7d0
[ 635.152171] ? zone_watermark_ok (mm/page_alloc.c:1728)
[ 635.152988] ? get_page_from_freelist (mm/page_alloc.c:1939)
[ 635.154766] __alloc_pages_nodemask (mm/page_alloc.c:2766)
--
Best regards,
Andrey Skvortsov
Secure eMail with gnupg: See http://www.gnupg.org/
PGP Key ID: 0x57A3AEAD
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20151207/9e03855d/attachment.bin
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-12-07 8:53 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-03 18:14 How to correctly decode fun+X/Y Matwey V. Kornilov
2015-12-03 18:34 ` Dave Tian
2015-12-03 18:43 ` Nicholas Mc Guire
2015-12-04 9:12 ` Daniel Baluta
2015-12-07 8:53 ` Andrey Skvortsov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).