Closed matthew-olson-intel closed 2 years ago
memmove(event, event + 1, 199);
Surely strlen(event+1)+1 not 199?
Also please place the brackets in the same way as the rest of the code.
Also it would be nice if you could add test cases for the new code to jevents/tester
ACK-- hard to overcome muscle memory.
Yes, you're right, using strlen
there is definitely better: I just hardcoded 199 because that line was originally within the jevent_name_to_attr_extra
function, which uses a 200-byte buffer.
OK, fixed a double-free error when failing to resolve an event: that's not related to the changes, though.
Didn't notice that the tester
was disabled; I thought that I'd passed all the tests. Running it yields an error:
Unknown modifier r at end for cpu/umask=0x01,period=100003,event=0xb7,offcore_rsp=0x80400122/request=all_data_rd,response=any_response
It looks like that string doesn't work with perf
, either, though. Think it should be changed in the tester, or changed in the parser?
Looks ok to me now, but there' s a conflict now according to github.
Can you rebase and push again? During the rebase please also squash the style fixes into the original patches.
Rebased, squashed all style-fixing commits, and merged upstream changes back in. Should be good now!
Github still didn't like it, but I merged it manually now. Thanks!
Sorry this PR adds so much more complexity to the parser; I had to steadily add checks to make it more robust.