diff options
author | Frank Ch. Eigler <fche@elastic.org> | 2009-03-03 20:48:20 -0500 |
---|---|---|
committer | Frank Ch. Eigler <fche@elastic.org> | 2009-03-03 20:48:20 -0500 |
commit | 46cfaf7b18b1d8dfa3e827f3b32d0e8f66e8399f (patch) | |
tree | 5c22000fdd537cc7495d6f0972ac4d060d979238 | |
parent | 9b753edaf92d9e73455ccea4334ab340616c8f93 (diff) | |
download | systemtap-steved-46cfaf7b18b1d8dfa3e827f3b32d0e8f66e8399f.tar.gz systemtap-steved-46cfaf7b18b1d8dfa3e827f3b32d0e8f66e8399f.tar.xz systemtap-steved-46cfaf7b18b1d8dfa3e827f3b32d0e8f66e8399f.zip |
change stap-report to a plain /bin/sh script; support dkpg in addition to rpm
-rwxr-xr-x | stap-report | 43 |
1 files changed, 19 insertions, 24 deletions
diff --git a/stap-report b/stap-report index 8551dc74..944609cf 100755 --- a/stap-report +++ b/stap-report @@ -1,26 +1,21 @@ -#!/usr/bin/python +#! /bin/sh -import sys -import time -import subprocess +run(){ + echo "== $1 ==" + sh -c "$@" +} -ofile = sys.stdout - -def run(command): - ofile.write("== " + command + " ==\n") - ofile.flush() - p = subprocess.Popen(command, shell=True, stdout=ofile, stderr=ofile) - p.wait() - ofile.write("\n") - -if __name__ == "__main__": - run("stap -V") - run("which stap") - run("ls -ald `locate -r '/stap$'` `locate -r '/staprun$'`") - run("printenv | egrep '^PATH=|^LD_LIBRARY_PATH=|^SYSTEMTAP_.*='") - run("gcc -v") - run("uname -a") - run("dmesg | egrep 'stap|systemtap' | tail -n 10") - run("cat /proc/cpuinfo | egrep 'processor|vendor_id|model name'") - run(r"rpm -qa --qf %{name}-%{version}-%{release}.%{arch}\\n | egrep 'systemtap|elfutils|kernel|gcc' | sort") - run(r"egrep 'PROBE|TRACE|MARKER|_DEBUG_' /lib/modules/`uname -r`/build/.config | grep -v not.set | sort | fmt -w 80") +run "stap -V" +run "which stap" +run "locate --regex '/stap(run)?$' | xargs ls -ald" +run "printenv | egrep '^PATH=|^LD_LIBRARY_PATH=|^SYSTEMTAP_.*='" +run "gcc -v" +run "uname -a" +run "dmesg | egrep 'stap|systemtap' | tail -n 10" +run "cat /proc/cpuinfo | egrep 'processor|vendor_id|model name'" +if [ -x /usr/bin/dpkg ]; then + run "dpkg --list | egrep 'systemtap|elfutils|kernel|gcc' | awk '{print \$2,\$3}' | sort" +else + run "rpm -qa --qf '%{name}-%{version} %{release}.%{arch}\\n' | egrep 'systemtap|elfutils|kernel|gcc' | sort" +fi +run "egrep 'PROBE|TRACE|MARKER|_DEBUG_' /lib/modules/`uname -r`/build/.config | grep -v not.set | sort | fmt -w 80" |