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.
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];
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);