Bug 206531 - libtraceevent: fail to parse event format file containing '{' and '}' characters in print fmt string
Summary: libtraceevent: fail to parse event format file containing '{' and '}' charac...
Status: NEW
Alias: None
Product: Tools
Classification: Unclassified
Component: Trace-cmd/Kernelshark (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Default virtual assignee for Trace-cmd and kernelshark
Depends on:
Reported: 2020-02-14 09:31 UTC by Tzvetomir Stoyanov
Modified: 2020-02-14 09:31 UTC (History)
0 users

See Also:
Kernel Version: 5.4.14-200.fc31.x86_64
Tree: Mainline
Regression: No


Description Tzvetomir Stoyanov 2020-02-14 09:31:38 UTC
tep_parse_event() API from traceevent library fails with
   bad op token {
error when parsing print fmt string containing '{' character in unexpected places. There are such format strings in xhci_urb_dequeue, xhci_urb_enqueue, xhci_urb_giveback events from xhci-hcd system:

  cat events/xhci-hcd/xhci_urb_dequeue/format
 print fmt: "ep%d%s-%s: urb %p pipe %u slot %d length %d/%d sgs %d/%d stream %d flags %08x", REC->epnum, REC->dir_in ? "in" : "out", ({ char *s; switch (REC->type) { case 3: s = "intr"; break; case 0: s = "control"; break; case 2: s = "bulk"; break; case 1: s = "isoc"; break; default: s = "UNKNOWN"; } s; }), REC->urb, REC->pipe, REC->slot_id, REC->actual, REC->length, REC->num_mapped_sgs, REC->num_sgs, REC->stream, REC->flags

  trace-cmd check-events
 [xhci-hcd:xhci_urb_enqueue] bad op token {
 [xhci-hcd:xhci_urb_giveback] bad op token {
 [xhci-hcd:xhci_urb_dequeue] bad op token {

trace-cmd version 2.9.dev (e8fb01140eb2800f9ef419a0f8e5bfeb51292c55+)

Note You need to log in before you can comment on or make changes to this bug.