Commit d753b875 authored by Daniel Xu's avatar Daniel Xu

Supress invalid file warning for wildcarded tracepoints

Wildcards, unless expanded, are not valid tracepoints. We should not
warn about missing files if the patch is wildcarded. Interestingly enough,
the previous behavior (early return) could have caused fewer tracepoints
to be attached than available. However in practice, this doesn't seem
to happen.

This closes issue #133.
parent e1abee55
...@@ -30,7 +30,9 @@ void TracepointFormatParser::parse(ast::Program *program) ...@@ -30,7 +30,9 @@ void TracepointFormatParser::parse(ast::Program *program)
std::string &event_name = ap->func; std::string &event_name = ap->func;
std::string format_file_path = "/sys/kernel/debug/tracing/events/" + category + "/" + event_name + "/format"; std::string format_file_path = "/sys/kernel/debug/tracing/events/" + category + "/" + event_name + "/format";
std::ifstream format_file(format_file_path.c_str()); std::ifstream format_file(format_file_path.c_str());
if (format_file.fail())
// Only bail on error if the attachpoint isn't wildcarded
if (format_file.fail() && format_file_path.find('*') == std::string::npos)
{ {
std::cerr << strerror(errno) << ": " << format_file_path << std::endl; std::cerr << strerror(errno) << ": " << format_file_path << std::endl;
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment