diff options
author | Dave Brolley <brolley@redhat.com> | 2009-04-21 11:11:02 -0400 |
---|---|---|
committer | Dave Brolley <brolley@redhat.com> | 2009-04-21 11:11:02 -0400 |
commit | 09fd19d66b9e3318e9e33f604eb2dbe623955123 (patch) | |
tree | 073dc18e4ca3ca4bac674c7225a9a54e5fafc7f7 /buildrun.cxx | |
parent | d4935c2f80122827a02d9f66c020d7e8ef6d6ade (diff) | |
parent | 9a6d143c6e2c79cee1082d0455da92cfa78b03c7 (diff) | |
download | systemtap-steved-09fd19d66b9e3318e9e33f604eb2dbe623955123.tar.gz systemtap-steved-09fd19d66b9e3318e9e33f604eb2dbe623955123.tar.xz systemtap-steved-09fd19d66b9e3318e9e33f604eb2dbe623955123.zip |
Merge branch 'master' of git://sources.redhat.com/git/systemtap
Conflicts:
aclocal.m4
configure
Diffstat (limited to 'buildrun.cxx')
-rw-r--r-- | buildrun.cxx | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/buildrun.cxx b/buildrun.cxx index 3c0d8f4b..5055f7fe 100644 --- a/buildrun.cxx +++ b/buildrun.cxx @@ -388,7 +388,6 @@ make_tracequery(systemtap_session& s, string& name, const vector<string>& extra_ // create our source file string source(dir + "/tracequery.c"); ofstream osrc(source.c_str()); - osrc << "#include <linux/module.h>" << endl; osrc << "#ifdef CONFIG_TRACEPOINTS" << endl; osrc << "#include <linux/tracepoint.h>" << endl; @@ -402,6 +401,10 @@ make_tracequery(systemtap_session& s, string& name, const vector<string>& extra_ osrc << "#define DEFINE_TRACE(name, proto, args) \\" << endl; osrc << " DECLARE_TRACE(name, TPPROTO(proto), TPARGS(args))" << endl; + // some headers may have been pulled in already indirectly, so we need this + // to ensure that they still use our definition + osrc << "#define TRACE_HEADER_MULTI_READ 1" << endl; + // PR9993: Add extra headers to work around undeclared types in individual // include/trace/foo.h files for (unsigned z=0; z<extra_headers.size(); z++) @@ -409,32 +412,38 @@ 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", + "/include/trace/events/*.h", + "/source/include/trace/*.h", + "/source/include/trace/events/*.h", + }; + for (unsigned z = 0; z < sizeof(globs) / sizeof(globs[0]); 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 header(trace_glob.gl_pathv[i]); + size_t root_pos = header.rfind("/include/"); + assert(root_pos != string::npos); + header.erase(0, root_pos + 9); // filter out a few known "internal-only" headers - if (header == "trace_events.h") + if (header.find("/ftrace.h") != string::npos) + continue; + if (header.find("/trace_events.h") != string::npos) continue; if (header.find("_event_types.h") != string::npos) continue; - osrc << "#include <trace/" << header << ">" << endl; + osrc << "#include <" << header << ">" << endl; } globfree(&trace_glob); } // finish up the module source osrc << "#endif /* CONFIG_TRACEPOINTS */" << endl; - osrc << "int init_module(void) { return 0; }" << endl; - osrc << "void cleanup_module(void) {}" << endl; - osrc << "MODULE_DESCRIPTION(\"tracepoint query\");" << endl; - osrc << "MODULE_LICENSE(\"GPL\");" << endl; osrc.close(); // make the module |