ARM-software / trappy

This repository has moved to https://gitlab.arm.com/tooling/trappy
Apache License 2.0
60 stars 39 forks source link

base: Don't error on event field values containing '=' #237

Closed bjackman closed 7 years ago

bjackman commented 7 years ago

If a trace field value contains a '=', we currently get a ValueError('Too many values to unpack'). Instead, let's only split on the first '='.

In practice if a field value contains a '=' it's probably because a kernel developer typo'd a custom event like:

/* Note missing space between "%d" and "bar" */
trace_printk("my_broken_event: foo=%dbar=%d", foo, bar)

So I did consider raising an explicit 'malformed event field' error. But this approach is more flexible in case someone really wanted to trace fields containing strings with '=' in them.

JaviMerino commented 7 years ago

It should be easy to create a test for this, can you add it as part of this commit?

bjackman commented 7 years ago

Pushed a version with a simple test. I used a .txt trace file because that way it was easy to chop out the relevant bit, is that OK?

JaviMerino commented 7 years ago

It's perfect :heart: , thanks!