summaryrefslogtreecommitdiffstats
path: root/pyfuntop.stp
diff options
context:
space:
mode:
authorMiro Hrončok <miro@hroncok.cz>2016-08-09 12:36:16 +0200
committerMiro Hrončok <miro@hroncok.cz>2016-09-26 10:20:04 +0200
commite32ce18e762bfad63a243fa6dcb192b3e5ae9588 (patch)
tree52df28be6fe15714554555c8bc772cb67f167dbc /pyfuntop.stp
parentf5845b442d5e3c252df4de7d56bbafe3e8737613 (diff)
downloadpython34-e32ce18e762bfad63a243fa6dcb192b3e5ae9588.tar.gz
python34-e32ce18e762bfad63a243fa6dcb192b3e5ae9588.tar.xz
python34-e32ce18e762bfad63a243fa6dcb192b3e5ae9588.zip
Initial import of Fedora 23 package
Diffstat (limited to 'pyfuntop.stp')
-rw-r--r--pyfuntop.stp21
1 files changed, 21 insertions, 0 deletions
diff --git a/pyfuntop.stp b/pyfuntop.stp
new file mode 100644
index 0000000..f235a23
--- /dev/null
+++ b/pyfuntop.stp
@@ -0,0 +1,21 @@
+#!/usr/bin/stap
+
+global fn_calls;
+
+probe python.function.entry
+{
+ fn_calls[pid(), filename, funcname, lineno] += 1;
+}
+
+probe timer.ms(1000) {
+ printf("\033[2J\033[1;1H") /* clear screen */
+ printf("%6s %80s %6s %30s %6s\n",
+ "PID", "FILENAME", "LINE", "FUNCTION", "CALLS")
+ foreach ([pid, filename, funcname, lineno] in fn_calls- limit 20) {
+ printf("%6d %80s %6d %30s %6d\n",
+ pid, filename, lineno, funcname,
+ fn_calls[pid, filename, funcname, lineno]);
+ }
+
+ delete fn_calls;
+}