Skip to content

Commit

Permalink
Fix trace.py for library filenames containing colons (iovisor#1252)
Browse files Browse the repository at this point in the history
`trace.py` parses a probe using the colon as a separator.  As a result, it
fails to create a uprobe for binary/library with a filename containing colons.

This diff fixes that issue with `trace.py`.  It requires a kernel with
https://lkml.org/lkml/2017/1/13/585 merged to work properly, otherwise
`trace.py` still fails for create uprobes.
  • Loading branch information
vkhromov authored and goldshtn committed Jul 14, 2017
1 parent 4180333 commit 5a2b39e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tools/trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,15 @@ def _parse_spec(self, spec):
self.library = "" # kernel
self.function = "" # from TRACEPOINT_PROBE
elif self.probe_type == "u":
self.library = parts[1]
self.usdt_name = parts[2]
self.library = ':'.join(parts[1:-1])
self.usdt_name = parts[-1]
self.function = "" # no function, just address
# We will discover the USDT provider by matching on
# the USDT name in the specified library
self._find_usdt_probe()
else:
self.library = parts[1]
self.function = parts[2]
self.library = ':'.join(parts[1:-1])
self.function = parts[-1]

def _find_usdt_probe(self):
target = Probe.pid if Probe.pid and Probe.pid != -1 \
Expand Down

0 comments on commit 5a2b39e

Please sign in to comment.