iovisor / iovisor/bcc

mysqld_query.py can not be used on CentOS 7

Open
#2,233 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
22.7k
Forks
4.1k
Avg merge
10d 4h
Merged PRs (30d)
3

Description

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
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
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with tools/mysql/mysqld_query.py and the bcc.usdt.USDT enable_probe path shown in the traceback. Compare the MySQL RPM installation with the provided CMake build output, especially ENABLE_DTRACE=1 and the missing DTRACE command. Done means establishing whether CentOS 7 packages can expose the required probe and documenting or addressing the supported setup.

Written by the indexing model from the issue text.

Assessment

Tech stack
centos, mysql, python
Domain
databases, operating-systems, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.