return self.s.encode(FILESYSTEMENCODING)
def __str__(self):
- return self.__bytes__()
+ return self.s
def warn_with_traceback(message, category, filename, lineno, file=None, line=None):
log = file if hasattr(file, "write") else sys.stderr
probeid += 1
expr = expr.replace("STRCMP", fname, 1)
rdict = {
- "expr" : expr,
- "streq_functions" : streq_functions,
- "probeid" : probeid
+ "expr": expr,
+ "streq_functions": streq_functions,
+ "probeid": probeid
}
return rdict
from bcc import ArgString, BPF, USDT
from time import sleep, strftime
import argparse
-import os
import re
import signal
import sys
libpath = BPF.find_library(self.library)
if libpath is None:
# This might be an executable (e.g. 'bash')
- libpath = BPF.find_exe(self.library)
+ libpath = BPF.find_exe(str(self.library))
if libpath is None or len(libpath) == 0:
raise Exception("unable to find library %s" % self.library)
self.library = libpath
for tracepoint in tracepoints:
text += self._add_function(template, tracepoint)
elif self.type == b"u":
- self.usdt = USDT(path=self.library, pid=self.pid)
+ self.usdt = USDT(path=str(self.library), pid=self.pid)
matches = []
for probe in self.usdt.enumerate_probes():
if not self.pid and (probe.bin_path != self.library):