Skip to content

Instantly share code, notes, and snippets.

@evverx
Last active December 24, 2015 02:49
Show Gist options
  • Save evverx/bd0a6748f3c6254d2021 to your computer and use it in GitHub Desktop.
Save evverx/bd0a6748f3c6254d2021 to your computer and use it in GitHub Desktop.

##environment

$ hostnamectl
   Static hostname: hola-bro
         Icon name: computer-vm
           Chassis: vm
        Machine ID: db79307cf0a7419589c900a3e6d84be0
           Boot ID: ba2c70822f0340edb99d686111dddca7
    Virtualization: oracle
  Operating System: Ubuntu 15.10
            Kernel: Linux 4.2.0-18-generic
      Architecture: x86-64
      

$ dpkg -s linux-tools-common
Package: linux-tools-common
Status: install ok installed
Priority: optional
Section: kernel
Installed-Size: 235
Maintainer: Ubuntu Kernel Team <kernel-team@lists.ubuntu.com>
Architecture: all
Multi-Arch: foreign
Source: linux
Version: 4.2.0-18.22
Replaces: linux-tools (<= 2.6.32-16.25)
Description: Linux kernel version specific tools for version 4.2.0
 This package provides the architecture independent parts for kernel
 version locked tools (such as perf and x86_energy_perf_policy) for
 version PGKVER.

##perf probe

$ sudo apt-get install systemd-dbg
$ sudo perf probe -x /lib/systemd/systemd --funcs
no symbols found in /lib/systemd/systemd, maybe install a debug package?
Failed to load symbols in /lib/systemd/systemd

$ sudo strace -eopen perf probe -x /lib/systemd/systemd --funcs
...
open("/lib/systemd/systemd", O_RDONLY)  = 3
open("/lib/systemd/2cea0e7a1230fd7ebf93bba1858888ecb9b4d1.debug", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/debug/lib/systemd/systemd.debug", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/debug/lib/systemd/systemd", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/systemd/systemd", O_RDONLY)  = 3
open("/lib/systemd/.debug/systemd", O_RDONLY) = -1 ENOENT (No such file or directory)
no symbols found in /lib/systemd/systemd, maybe install a debug package?
Failed to load symbols in /lib/systemd/systemd

$ sudo cp /usr/lib/debug/.build-id/83/2cea0e7a1230fd7ebf93bba1858888ecb9b4d1.debug /lib/systemd/2cea0e7a1230fd7ebf93bba1858888ecb9b4d1.debug
$ sudo perf probe -x /lib/systemd/systemd --funcs
...
write_confirm_message
write_string_file
write_string_file_atomic_label
write_string_stream
write_to_journal
write_utmp_wtmp.lto_priv.855
writev@plt
....
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment