Permalink
Browse files

Tried Python 3.6's systemtap probes and gave up on them.

- Built a version of Python 3.6 with systemtap descriptors
- systemtap scripts don't compile under Ubuntu Xenial.
- Although a StackOverflow answer suggested that building systemtap from
  source works, it didn't work for me.

It appears to be very brittle.  systemtap 3.2 doesn't compile, but 3.1
does.  But even under 3.1, the .stp scripts themselves don't compile!
  • Loading branch information...
Andy Chu
Andy Chu committed Mar 13, 2018
1 parent f8bc99f commit 4c29ee038def612cb67dd77cf74ec0abee35c977
Showing with 75 additions and 0 deletions.
  1. +75 −0 benchmarks/systemtap.sh
View
@@ -0,0 +1,75 @@
#!/bin/bash
#
# Following:
# https://docs.python.org/3/howto/instrumentation.html
#
# Couldn't get this to work. Even building it from source doesn't work!
# 'stap' invokes a compiler, and I get compiler errors.
#
# It appears to be very brittle.
#
# https://stackoverflow.com/questions/46047270/systemtap-error-on-ubuntu
#
# Usage:
# ./systemtap.sh <function name>
set -o nounset
set -o pipefail
set -o errexit
deps() {
# 'stap' lives in systemtap package
sudo apt install systemtap systemtap-sdt-dev
}
stap-deps() {
# For DWARF debugging info, interesting.
sudo apt install libdw-dev libdw1
}
# NOTE: systemtap-3.2 is out, but doesn't compile on Ubuntu xenial!
download() {
wget --no-clobber --directory _tmp \
https://sourceware.org/systemtap/ftp/releases/systemtap-3.1.tar.gz
}
extract() {
cd _tmp
tar -x -z < systemtap-3.1.tar.gz
}
readonly PY36=~/src/languages/Python-3.6.1
build-python() {
pushd $PY36
# There is no --with-systemtap/
./configure --with-dtrace
make -j 7
popd
}
# Default Python build doesn't have it
elf() {
readelf -n $(which python3)
echo ---
# Now this has "stapsdt" -- SystemTap probe descriptors.
readelf -n $PY36/python
}
_demo() {
#local stp="$PWD/benchmarks/call-hierarchy.stp"
# C compile errors? It's getting further.
#local stp="$PY36/Lib/test/dtracedata/call_stack.stp"
local stp="$PY36/Lib/test/dtracedata/gc.stp"
#local stp="$PY36/Lib/test/dtracedata/assert_usable.stp"
local py="$PWD/test/sh_spec.py"
pushd $PY36
stap -v $stp -c "./python $py"
popd
}
demo() { sudo $0 _demo; }
"$@"

0 comments on commit 4c29ee0

Please sign in to comment.