]> sourceware.org Git - systemtap.git/commitdiff
tracepoints: Skip identical headers from the build and source trees
authorJosh Stone <jistone@redhat.com>
Tue, 11 Oct 2011 21:15:27 +0000 (14:15 -0700)
committerJosh Stone <jistone@redhat.com>
Wed, 12 Oct 2011 00:18:32 +0000 (17:18 -0700)
In preparing the tracequery source, we normalize paths containing
"include/" to just the suffix part, so the header will be found by the
normal -I path.  However, the debuginfo source tree usually contains
at least the same headers found in the build tree.  We were thus
building effectively the same tracequery twice for headers that are
present in both the build and source trees.  Stop that!

* tapsets.cxx (tracepoint_builder::init_dw): Build the header list with
  knowledge of the "include/" normalization to avoid extra work.

tapsets.cxx

index b9ab65b63f182b86e3b1479728bac80538e71740..9fb629d0310bc13ccf36dfb3306bf5b755797f1b 100644 (file)
@@ -9251,6 +9251,7 @@ tracepoint_builder::init_dw(systemtap_session& s)
     for (unsigned j=0; j<glob_suffixes.size(); j++)
       globs.push_back (glob_prefixes[i]+string("/")+glob_suffixes[j]);
 
+  set<string> duped_headers;
   for (unsigned z = 0; z < globs.size(); z++)
     {
       string glob_str = globs[z];
@@ -9269,6 +9270,12 @@ tracepoint_builder::init_dw(systemtap_session& s)
               endswith(header, "_event_types.h"))
             continue;
 
+          // skip identical headers from the build and source trees.
+          size_t root_pos = header.rfind("include/");
+          if (root_pos != string::npos &&
+              !duped_headers.insert(header.substr(root_pos + 8)).second)
+            continue;
+
           system_headers.push_back(header);
         }
       globfree(&trace_glob);
This page took 0.079256 seconds and 5 git commands to generate.