Skip to content

Commit

Permalink
simpletrace: build() missing 2 required positional arguments
Browse files Browse the repository at this point in the history
Commit 4e66c9e "tracetool: add input filename and line number to
Event" forgot to add a line number and a filename argument at one
build method call site.

Traceback (most recent call last):
  File "./scripts/simpletrace.py", line 261, in <module>
    run(Formatter())
  File "./scripts/simpletrace.py", line 236, in run
    process(events, sys.argv[2], analyzer, read_header=read_header)
  File "./scripts/simpletrace.py", line 177, in process
    dropped_event =
      Event.build("Dropped_Event(uint64_t num_events_dropped)")
TypeError: build() missing 2 required positional arguments:
  'lineno' and 'filename'

Add the missing arguments.

Signed-off-by: Volker Rümelin <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-id: [email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>
  • Loading branch information
Volker Rümelin authored and stefanhaRH committed Feb 1, 2021
1 parent 418ed14 commit c6e93c9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/simpletrace.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,9 @@ def process(events, log, analyzer, read_header=True):
if read_header:
read_trace_header(log)

dropped_event = Event.build("Dropped_Event(uint64_t num_events_dropped)")
frameinfo = inspect.getframeinfo(inspect.currentframe())
dropped_event = Event.build("Dropped_Event(uint64_t num_events_dropped)",
frameinfo.lineno + 1, frameinfo.filename)
edict = {"dropped": dropped_event}
idtoname = {dropped_event_id: "dropped"}

Expand Down

0 comments on commit c6e93c9

Please sign in to comment.