dbslower: fix a python3 bytes/string issue int the -x option
In python3, the find method requires a bytes-like object. It fixes the
following error:
$ dbslower mysql -x $(which mysqld)
Traceback (most recent call last):
File "/usr/share/bcc/tools/dbslower", line 72, in <module>
if mysql_func_name.find("COM_DATA") >= 0:
TypeError: a bytes-like object is required, not 'str'
Also the -x option is currently undocumented in the man page and the
example file. So let's ix that too.
diff --git a/tools/dbslower.py b/tools/dbslower.py
index c523d7a..92d4127 100755
--- a/tools/dbslower.py
+++ b/tools/dbslower.py
@@ -69,7 +69,7 @@
(mysql_func_name, addr) = symbols[0]
- if mysql_func_name.find("COM_DATA") >= 0:
+ if mysql_func_name.find(b'COM_DATA') >= 0:
mode = "MYSQL57"
else:
mode = "MYSQL56"