Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mysqld_query.py can not be used on CentOS 7 #2233

Open
justlooks opened this issue Feb 27, 2019 · 3 comments
Open

mysqld_query.py can not be used on CentOS 7 #2233

justlooks opened this issue Feb 27, 2019 · 3 comments

Comments

@justlooks
Copy link

justlooks commented Feb 27, 2019

i install mysql from mysql yum repo ,it seems bcc tool can not find the probe in mysql ,should I rebuild the rpm package? and how ?

# cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)
# ./mysqld_query.py $(pgrep mysqld)
Traceback (most recent call last):
  File "./mysqld_query.py", line 43, in <module>
    u.enable_probe(probe="query__start", fn_name="do_trace")
  File "/usr/lib/python2.7/site-packages/bcc/usdt.py", line 154, in enable_probe
    probe
bcc.usdt.USDTException: failed to enable probe 'query__start'; a possible cause can be that the probe requires a pid to enable
[root@yunxiu_db1 tracing]# ps -ef|grep mysqld
mysql     6850     1  0 Feb25 ?        00:01:00 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid
root     10181  7273  0 11:13 pts/3    00:00:00 grep --color=auto mysqld

mysqld script can not be used in centos7.6 ,because no dtrace tool found on this platform

$ cmake -DBUILD_CONFIG=mysql_release -DINSTALL_LAYOUT=RPM  -DCMAKE_BUILD_TYPE=RelWithDebInfo -DWITH_BOOST=.. -DWITH_SYSTEMD=1 -DINSTALL_LIBDIR=/lib64/mysql -DINSTALL_PLUGINDIR==/lib64/mysql/plugin  -DMYSQL_UNIX_ADDR=/tmp/mysq.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DMYSQLX_UNIX_ADDR="/var/run/mysqld/mysqlx.sock" -DWITH_NUMA=ON -DCOMPILATION_COMMENT=1 -DENABLE_DTRACE=1
[  4%] Generating include/probes_mysql_dtrace.h, include/probes_mysql_nodtrace.h
make[2]: DTRACE-NOTFOUND: Command not found
make[2]: *** [include/probes_mysql_dtrace.h] Error 127
make[1]: *** [CMakeFiles/gen_dtrace_header.dir/all] Error 2
make: *** [all] Error 2
@justlooks justlooks changed the title a possible cause can be that the probe requires a pid to enable mysqld_query.py can not be used on CentOS 7 Feb 27, 2019
@palmtenor
Copy link
Member

Have you tried to provide a PID? Maybe try using the trace.py tool. See example.

@justlooks
Copy link
Author

example

yes ,I use pgrep to get mysqld's PID

@yueyongyue
Copy link

Support for DTrace is deprecated in MySQL 5.7 and is removed in MySQL 8.0.
https://dev.mysql.com/doc/refman/5.7/en/dba-dtrace-server.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants