public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* perf probe: request: Better message when no debug info is found on vmlinux
@ 2014-08-14 15:33 Arnaldo Carvalho de Melo
  2014-08-14 17:54 ` Masami Hiramatsu
  0 siblings, 1 reply; 12+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-08-14 15:33 UTC (permalink / raw)
  To: Masami Hiramatsu
  Cc: Jiri Olsa, Namhyung Kim, David Ahern, Linux Kernel Mailing List

Hi Masami,

	I was trying to figure out why sys_perf_event_open was returning
EACCES when trying to record, as a non priviledged user, a 'ping'
process started by this user, while it has no problem doing the same
thing if the monitored process is 'sleep' (reusing of ptrace perms seems
to be what is causing this, but I digress), when I stumbled in something
annoying:

  [root@ssdandy ~]# perf probe -v -L icmp_rcv
  Looking at the vmlinux_path (6 entries long)
  Using /lib/modules/3.16.0+/build/vmlinux for symbols
  Failed to open debuginfo file.
    Error: Failed to show lines. (-2)
  [root@ssdandy ~]# 

Huh? Why? So I went to look to see why it was "failing to open debuginfo
file":

  [root@ssdandy ~]# ls -la /lib/modules/3.16.0+/build/vmlinux
  -rwxrwxr-x. 3 acme acme 22505817 Aug 13 11:54
  /lib/modules/3.16.0+/build/vmlinux
  [root@ssdandy ~]# ls -la /lib/modules/3.16.0+/build
  lrwxrwxrwx. 1 root root 29 Aug 13 12:10 /lib/modules/3.16.0+/build ->
  /home/acme/git/build/v3.16.0+

The file is there, but... I forgot I had disabled CONFIG_DEBUG_INFO on
this machine:

  [root@ssdandy ~]# ls -la /lib/modules/3.16.0+/build/.config
  -rw-rw-r--. 1 acme acme 136217 Aug 13 11:40
  /lib/modules/3.16.0+/build/.config
  [root@ssdandy ~]# grep CONFIG_DEBUG_INFO
  /lib/modules/3.16.0+/build/.config
  # CONFIG_DEBUG_INFO is not set
  [root@ssdandy ~]# 

So, only the CFI ELF section was there, not the other with the -g stuff:

  [root@ssdandy ~]# readelf -SW /lib/modules/3.16.0+/build/vmlinux | grep \.debug_
    [29] .debug_frame  PROGBITS  0000000000000000 1266030 0021d0 00  0   0  8
  [root@ssdandy ~]#

So, I suggest that we improve that error message to be more clear:

  [root@ssdandy ~]# perf probe -L icmp_rcv
  Failed to open debuginfo file.
    Error: The /lib/modules/3.16.0+/build/vmlinux file has no
           debugging information, rebuild with CONFIG_DEBUG_INFO=y

  [root@ssdandy ~]# 

Since it knows it is a kernel image file, and that the config option to
enable it is CONFIG_DEBUG_INFO.

Thanks,

- Arnaldo


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

end of thread, other threads:[~2014-08-18  8:22 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-14 15:33 perf probe: request: Better message when no debug info is found on vmlinux Arnaldo Carvalho de Melo
2014-08-14 17:54 ` Masami Hiramatsu
2014-08-14 18:29   ` [PATCH] perf probe: Warn user to rebuild target with debuginfo Masami Hiramatsu
2014-08-14 18:55     ` Arnaldo Carvalho de Melo
2014-08-14 20:07     ` Brendan Gregg
2014-08-15  1:07       ` Arnaldo Carvalho de Melo
2014-08-15  1:29         ` Masami Hiramatsu
2014-08-15  1:44           ` Masami Hiramatsu
2014-08-15  1:51             ` Masami Hiramatsu
2014-08-15  3:39               ` Brendan Gregg
2014-08-15 13:34                 ` Arnaldo Carvalho de Melo
2014-08-18  8:21             ` [tip:perf/core] " tip-bot for Masami Hiramatsu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox