Skip to content
Snippets Groups Projects
  • Jerome Marchand's avatar
    tools: fix a python 3 map issue in dbstat and dbslower · c9805f44
    Jerome Marchand authored
    In python 3, map returns an iterator and not a list anymore. This
    patch cast the map into a list. It fixes the following error:
    
    $ /usr/share/bcc/tools/dbstat mysql
    Traceback (most recent call last):
      File "/usr/share/bcc/tools/dbstat", line 95, in <module>
        bpf = BPF(text=program, usdt_contexts=usdts)
      File "/usr/lib/python3.6/site-packages/bcc/__init__.py", line 339, in __init__
        ctx_array = (ct.c_void_p * len(usdt_contexts))()
    TypeError: object of type 'map' has no len()
    c9805f44