This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: mysql static probes demo
- From: Mark Wielaard <mjw at redhat dot com>
- To: Stan Cox <scox at redhat dot com>
- Cc: systemtap <systemtap at sources dot redhat dot com>
- Date: Mon, 26 Jan 2009 12:25:09 +0100
- Subject: Re: mysql static probes demo
- References: <1232742551.1739.64.camel@localhost.localdomain>
Hi Stan,
On Fri, 2009-01-23 at 15:29 -0500, Stan Cox wrote:
> Here is a demo of mysql being probed.
Wow, that is a really great demo!
What mysql source did you take and how did you configure/build it?
I did have some troubles with the new python wrapper to get postgres to
compile. I believe you should handle the creating of the output filename
differently when there has been no -o option given (and not add
extensions when it is given). I am attaching my local change.
Still trying to figure out how to actually enable the postgres probes
with the new runtime support though. All I am getting is:
pattern '/usr/bin/postgres' matches module '/usr/bin/postgres'
focused on module '/usr/bin/postgres = [0x8047000-0x841bb60,
bias 0x0] file /usr/lib/debug/usr/bin/postgres.debug ELF machine
i?86 (code 3)
focused on module '/usr/bin/postgres'
semantic error: no match while resolving probe point
process("/usr/bin/postgres").statement(1869379436)
dwarf_builder releasing user dwflpp /usr/bin/postgres
semantic error: no probes found
Need to look into why.
Cheers,
Mark
diff --git a/dtrace b/dtrace
index 1eb53bf..fdf9da1 100755
--- a/dtrace
+++ b/dtrace
@@ -21,7 +21,7 @@ class provider:
have_provider = False
self.f = open(provider)
self.h = open(header,mode='w')
- self.h.write("// Generated by /usr/bin/dtrace\n")
+ self.h.write("// Generated by the Systemtap dtrace wrapper\n")
self.h.write("\n#include <sys/sdt.h>\n\n")
in_comment = False
while (True):
@@ -125,21 +125,21 @@ if (build_header == False and build_source == False):
if (filename == ""):
if (s_filename != ""):
filename = s_filename.replace(".d","")
+ if (build_header):
+ filename = filename + ".h"
+ elif (build_source):
+ filename = filename + ".o"
else:
usage
sys.exit(1)
if (build_header):
providers = provider()
- providers.open(s_filename, filename + ".h")
+ providers.open(s_filename, filename)
elif (build_source):
fn = "/tmp/" + os.path.basename(s_filename).replace(".d", ".c")
f = open(fn,mode='w')
f.write("static __dtrace () {}\n")
f.close()
- call("gcc -fPIC -c " + fn + " -o " + filename + ".o", shell=True)
- f.close()
+ call("gcc -fPIC -c " + fn + " -o " + filename, shell=True)
os.remove(fn)
-
-
-