trace: Forbid event format ending with newline character
commit9f7ad79c16ede0da01902b18fb32929cfbd20f87
authorPhilippe Mathieu-Daudé <philmd@redhat.com>
Mon, 16 Sep 2019 09:51:21 +0000 (16 11:51 +0200)
committerStefan Hajnoczi <stefanha@redhat.com>
Wed, 18 Sep 2019 09:20:15 +0000 (18 10:20 +0100)
tree7df1d72d711643a8e441e8a4200f5a4a5b9bcf25
parent794dcb54b3fc3cb91d1eeb34216be3177400d6a2
trace: Forbid event format ending with newline character

Event format ending with newlines confuse the trace reports.
Forbid them.

Add a check to refuse new format added with trailing newline:

  $ make
  [...]
    GEN     hw/misc/trace.h
  Traceback (most recent call last):
    File "scripts/tracetool.py", line 152, in <module>
      main(sys.argv)
    File "scripts/tracetool.py", line 143, in main
      events.extend(tracetool.read_events(fh, arg))
    File "scripts/tracetool/__init__.py", line 367, in read_events
      event = Event.build(line)
    File "scripts/tracetool/__init__.py", line 281, in build
      raise ValueError("Event format can not end with a newline character")
  ValueError: Error at hw/misc/trace-events:121: Event format can not end with a newline character

Reviewed-by: John Snow <jsnow@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20190916095121.29506-3-philmd@redhat.com
Message-Id: <20190916095121.29506-3-philmd@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
docs/devel/tracing.txt
scripts/tracetool/__init__.py