From 2a0e62a892c4d3f4bbab29fac9105ec98594a2d1 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 11 Oct 2011 13:21:34 -0700 Subject: [PATCH] tracepoints: Work with the tracequery's .o rather than .ko The intermediate object files are slightly smaller, since they don't have any of the module boilerplate compiled in yet. It still has what we need though, just the basic stapprobe_* function definitions. * buildrun.cxx (make_tracequeries): Return .o filenames rather than .ko. * hash.cxx (find_tracequery_hash): Use .o for cached filenames. * tapsets.cxx (tracepoint_builder::get_tracequery_modules): Update comments and variable names to refer to objects instead of kos. --- buildrun.cxx | 10 +++++----- hash.cxx | 2 +- tapsets.cxx | 20 ++++++++++---------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/buildrun.cxx b/buildrun.cxx index c44ebbd42..79cf09e84 100644 --- a/buildrun.cxx +++ b/buildrun.cxx @@ -547,14 +547,14 @@ make_run_command (systemtap_session& s, const string& remotedir, // Build tiny kernel modules to query tracepoints. // Given a (header-file -> test-contents) map, compile them ASAP, and return -// a (header-file -> ko-filename) map. +// a (header-file -> obj-filename) map. map make_tracequeries(systemtap_session& s, const map& contents) { static unsigned tick = 0; string basename("tracequery_kmod_" + lex_cast(++tick)); - map kos; + map objs; // create a subdirectory for the module string dir(s.tmpdir + "/" + basename); @@ -563,7 +563,7 @@ make_tracequeries(systemtap_session& s, const map& contents) if (! s.suppress_warnings) cerr << _("Warning: failed to create directory for querying tracepoints.") << endl; s.set_try_server (); - return kos; + return objs; } // create a simple Makefile @@ -592,7 +592,7 @@ make_tracequeries(systemtap_session& s, const map& contents) // arrange to build it omf << "obj-m += " + sbasename + ".o" << endl; // NB: without prefix - kos[it->first] = dir + "/" + sbasename + ".ko"; + objs[it->first] = dir + "/" + sbasename + ".o"; } omf.close(); @@ -614,7 +614,7 @@ make_tracequeries(systemtap_session& s, const map& contents) // other useful diagnostic. -vvvv would let a user see what's up, // but the user can't fix the problem even with that. - return kos; + return objs; } diff --git a/hash.cxx b/hash.cxx index 479f2e8fa..aa1f8f633 100644 --- a/hash.cxx +++ b/hash.cxx @@ -335,7 +335,7 @@ find_tracequery_hash (systemtap_session& s, const string& header) create_hash_log(string("tracequery_hash"), h.get_parms(), result, hashdir + "/tracequery_" + result + "_hash.log"); - return hashdir + "/tracequery_" + result + ".ko"; + return hashdir + "/tracequery_" + result + ".o"; } diff --git a/tapsets.cxx b/tapsets.cxx index 62c6d1f78..b9ab65b63 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -9071,7 +9071,7 @@ public: -// Create (or cache) one or more tracequery .ko modules, based upon the +// Create (or cache) one or more tracequery .o modules, based upon the // tracepoint-related header files given. Return the generated or cached // modules[]. @@ -9087,20 +9087,20 @@ tracepoint_builder::get_tracequery_modules(systemtap_session& s, clog << " " << headers[i] << endl; } - map headers_cacheko; // header name -> cache/.../tracequery_hash.ko file name - // Map the headers to cache .ko names. Note that this has side-effects of + map headers_cache_obj; // header name -> cache/.../tracequery_hash.o file name + // Map the headers to cache .o names. Note that this has side-effects of // creating the $SYSTEMTAP_DIR/.cache/XX/... directory and the hash-log file, // so we prefer not to repeat this. vector uncached_headers; for (size_t i=0; i 2) @@ -9172,18 +9172,18 @@ tracepoint_builder::get_tracequery_modules(systemtap_session& s, } // now build them all together - map tracequery_kos = make_tracequeries(s, headers_tracequery_src); + map tracequery_objs = make_tracequeries(s, headers_tracequery_src); // now plop them into the cache if (s.use_cache) for (size_t i=0; i 2); + copy_file(tracequery_obj, tracequery_path, s.verbose > 2); modules.push_back (tracequery_path); } else -- 2.43.5