From c95eddf7e5ef5b2c8f9f804eeb34a7663ccdb0a3 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 14 Aug 2009 17:56:46 -0700 Subject: [PATCH] Cache failed tracepoint headers too Rather than re-attempting a tracepoint header that fails to compile, we now save an empty file into the cache to indicate "nothing to see here." See also PR10424. * tapsets.cxx (tracepoint_builder::get_tracequery_module): Use /dev/null as the empty result file if make_tracequery fails. (tracepoint_builder::init_dw): Ignore empty tracequery modules. --- tapsets.cxx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tapsets.cxx b/tapsets.cxx index a88cda79b..d350715ce 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -6005,6 +6005,9 @@ string tracepoint_builder::get_tracequery_module(systemtap_session& s, const string& header) { + if (s.verbose > 2) + clog << "Pass 2: getting a tracequery for " << header << endl; + string tracequery_path; if (s.use_cache) { @@ -6033,7 +6036,7 @@ tracepoint_builder::get_tracequery_module(systemtap_session& s, int rc = make_tracequery(s, tracequery_ko, short_header, tracepoint_extra_headers()); if (rc != 0) - return ""; + tracequery_ko = "/dev/null"; if (s.use_cache) { @@ -6082,7 +6085,10 @@ tracepoint_builder::init_dw(systemtap_session& s) continue; string tracequery_path = get_tracequery_module(s, header); - if (!tracequery_path.empty()) + + /* NB: An empty tracequery means that the + * header didn't even compile correctly. */ + if (get_file_size(tracequery_path)) tracequery_modules.push_back(tracequery_path); } globfree(&trace_glob); -- 2.43.5