Closed bjackman closed 6 years ago
Phew.. I really really really don't want to break anything here so trying to be a bit hyper-cautious with testing.. added a unit test, I also added a separate exception class just because there was already one instance of that in the code.
OK, changed the FAILED TO PARSE case to just print a warning and continue. There might be missing data, but at least we know what went wrong and that the rest of the trace is probably fine.
Some events from the kernel cannot be parsed by old trace-cmd binaries. This results in data_str starting with "[FAILED TO PARSE]", which we ourselves fail to parse because we expect to find a key=value pair.
This adds a missing 'continue' statement to avoid attempting to avoid a KeyError when attempting to use an unset prev_key as a key into data_dict, and also adds a special error for the "[FAILED TO PARSE]" case.