linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Can not trace perf-probe event (made to probe the main function) with perf-top
@ 2016-11-19 16:36 HOUSSEN Franck
  2016-11-20 13:26 ` Masami Hiramatsu
  0 siblings, 1 reply; 3+ messages in thread
From: HOUSSEN Franck @ 2016-11-19 16:36 UTC (permalink / raw)
  To: linux-perf-users

[-- Attachment #1: Type: text/plain, Size: 215 bytes --]

Can not trace perf-probe event (made to probe the main function) with
perf-top ? (see ReadMe.txt - works with perf-report and -s option)
Can someone help ? Missing option ? Known bug / limitation ?

Thanks,

Franck

[-- Attachment #2: ReadMe.txt --]
[-- Type: text/plain, Size: 1534 bytes --]

/tmp> more main.cpp
#include <unistd.h> // sleep
int main(void) { sleep(10); return 0; }

/tmp> gcc -g main.cpp -o main

/tmp> sudo perf probe --exec ./main --add main
Added new event:
  probe_main:main      (on main in /tmp/main)
  You can now use it in all perf tools, such as:
    perf record -e probe_main:main -aR sleep 1

/tmp> sudo perf record -e probe_main:main ./main
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.017 MB perf.data (1 samples) ]

/tmp> sudo perf report --stdio -s sym,dso
# To display the perf.data header info, please use --header/--header-only options.
#
#
# Total Lost Samples: 0
#
# Samples: 1  of event 'probe_main:main'
# Event count (approx.): 1
#
# Overhead  Trace output
# ........  ............
#
   100.00%  main
#
# (Tip: List events using substring match: perf list <keyword>)
#

~> sudo perf top -K --stdio -s sym,dso -e probe_main:main
   PerfTop:       0 irqs/sec  kernel: 0.0%  exact:  0.0% [1Hz probe_main:main],  (all, 4 CPUs)
   -------------------------------------------------------------------------------------------

~> lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:  Debian GNU/Linux testing (stretch)
Release:  testing
Codename: stretch

~> cat /proc/sys/kernel/perf_event_paranoid
-1

~> cat /proc/sys/kernel/kptr_restrict
0

~> gcc --version
gcc (Debian 6.2.0-10) 6.2.0 20161027

~> perf --version
perf version 4.7.8

~> uname -a
Linux yoda 4.7.0-1-amd64 #1 SMP Debian 4.7.8-1 (2016-10-19) x86_64 GNU/Linux


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

end of thread, other threads:[~2016-11-21 10:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-19 16:36 Can not trace perf-probe event (made to probe the main function) with perf-top HOUSSEN Franck
2016-11-20 13:26 ` Masami Hiramatsu
2016-11-21 10:35   ` HOUSSEN Franck

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).