This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
getting tracepoints with 2.6.30-rc2 kernel
- From: William Cohen <wcohen at redhat dot com>
- To: SystemTAP <systemtap at sources dot redhat dot com>
- Date: Thu, 16 Apr 2009 22:50:05 -0400
- Subject: getting tracepoints with 2.6.30-rc2 kernel
The have been some changes in the layout of the trace include directory with the
2.6.30-rc2 kernel. There is now a subdirectory trace/events with the trace
points also need to filter out the ftrace.h include file. The attached patch
allows following to list out the tracepoints in the 2.6.30-rc2 kernel:
stap -L 'kernel.trace("*")'|sort
Without the patch systemtap can not find the tracepoints. Any comments on this
would be appreciated. I would like to make sure that this is reasonable before
checking in.
-Will
diff --git a/buildrun.cxx b/buildrun.cxx
index 82ac9d4..6abb783 100644
--- a/buildrun.cxx
+++ b/buildrun.cxx
@@ -398,22 +398,32 @@ make_tracequery(systemtap_session& s, string& name, const vector<string>& extra_
// dynamically pull in all tracepoint headers from include/trace/
glob_t trace_glob;
- string globs[2] = { "/include/trace/*.h", "/source/include/trace/*.h" };
- for (unsigned z=0; z<2; z++)
+ string globs[] = { "/include/trace/*.h",
+ "/source/include/trace/*.h",
+ "/include/trace/events/*.h",
+ "/source/include/trace/events/*.h",
+ ""
+ };
+ for (unsigned z=0; globs[z] != ""; z++)
{
string glob_str(s.kernel_build_tree + globs[z]);
glob(glob_str.c_str(), 0, NULL, &trace_glob);
for (unsigned i = 0; i < trace_glob.gl_pathc; ++i)
{
string header(basename(trace_glob.gl_pathv[i]));
+ string include_file(trace_glob.gl_pathv[i]);
+ size_t header_pos = include_file.rfind("trace/");
+ include_file = include_file.substr(header_pos);
// filter out a few known "internal-only" headers
if (header == "trace_events.h")
continue;
+ if (header == "ftrace.h")
+ continue;
if (header.find("_event_types.h") != string::npos)
continue;
- osrc << "#include <trace/" << header << ">" << endl;
+ osrc << "#include <" << include_file << ">" << endl;
}
globfree(&trace_glob);
}