我是靠谱客的博主 标致发箍,最近开发中收集的这篇文章主要介绍oracle linux 7.3 下用dtrace 跟踪 mysql-community-server-5.6.20,觉得挺不错的,现在分享给大家,希望可以做个参考。
概述
第一部分:oracle linux 7.3 dtrace 安装:
http://public-yum.oracle.com/
内核升极到
[root@server1 SPECS]# uname -r
4.1.12-94.3.8.el7uek.x86_64
yum install
kernel-uek-firmware-4.1.12-94.3.8.el7uek.noarch
kernel-uek-debug-devel-4.1.12-94.3.8.el7uek.x86_64
kernel-uek-doc-4.1.12-94.3.8.el7uek.noarch
kernel-uek-devel-4.1.12-94.3.8.el7uek.x86_64
kernel-uek-4.1.12-94.3.8.el7uek.x86_64
安装DTRACE 程序
http://www.oracle.com/technetwork/server-storage/linux/downloads/linux-dtrace-2800968.html
dtrace-utils-devel-0.6.0-3.el7.x86_64 //手动下载
dtrace-utils-0.6.0-3.el7.x86_64 //手动下载
dtrace-modules-4.1.12-94.3.8.el7uek-0.6.0-4.el7.x86_64
探针模块加载:
[root@server1 ~]# cat probe.sh
cd /usr/lib/modules/4.1.12-94.3.8.el7uek.x86_64/kernel/drivers/dtrace/
modprobe fbt
modprobe profile
modprobe systrace
modprobe fasttrap
modprobe dtrace
modprobe sdt
测试:
Testing function entry codes
[root@oel65 Dtrace]# dtrace -n 'syscall::open:entry { printf("Exec: %s File: %s" , execname , stringof(arg0) ); }'
dtrace: description 'syscall::open:entry ' matched 1 probe
CPU ID FUNCTION:NAME
0 8 open:entry Exec: udisks-daemon File: /dev/sr0
0 8 open:entry Exec: vminfo File: /var/run/utmp
0 8 open:entry Exec: vminfo File: /etc/passwd
第二部分MYSQL 安装
1.选择版本:mysql-community-server-5.6.20 起开始内置dtrace(但是mysql 8.0 移除)
2.下载:
http://public-yum.oracle.com/
http://public-yum.oracle.com/repo/OracleLinux/OL7/MySQL56/x86_64/index.html下载四个文件
mysql-community-client-5.6.20-4.el7.x86_64.rpm
mysql-community-common-5.6.20-4.el7.x86_64.rpm
mysql-community-server-5.6.20-4.el7.x86_64.rpm
mysql-community-libs-5.6.20-4.el7.x86_64.rpm
3.安装:
rpm -ivh mysql-community-libs-5.6.20-4.el7.x86_64.rpm
rpm -ivh mysql-community-common-5.6.20-4.el7.x86_64.rpm
rpm -ivh mysql-community-client-5.6.20-4.el7.x86_64.rpm
rpm -ivh mysql-community-server-5.6.20-4.el7.x86_64.rpm
4.文件安装位置
[root@server1 data]# rpm -ql mysql-community-server-5.6.20-4.el7.x86_64
/etc/logrotate.d/mysql
/etc/my.cnf
/usr/bin/innochecksum
/usr/bin/my_print_defaults
/usr/bin/myisam_ftdump
/usr/bin/myisamchk
/usr/bin/myisamlog
/usr/bin/myisampack
/usr/bin/mysql-systemd-start
/usr/bin/mysql_convert_table_format
/usr/bin/mysql_fix_extensions
/usr/bin/mysql_install_db
/usr/bin/mysql_plugin
/usr/bin/mysql_secure_installation
/usr/bin/mysql_tzinfo_to_sql
/usr/bin/mysql_upgrade
/usr/bin/mysql_zap
/usr/bin/mysqlbug
/usr/bin/mysqld_multi
/usr/bin/mysqld_safe
/usr/bin/mysqldumpslow
/usr/bin/mysqlhotcopy
/usr/bin/mysqltest
/usr/bin/perror
/usr/bin/replace
/usr/bin/resolve_stack_dump
/usr/bin/resolveip
/usr/lib/systemd/system/mysqld.service
/usr/lib/tmpfiles.d/mysql.conf
/usr/lib64/mysql/plugin
/usr/lib64/mysql/plugin/adt_null.so
/usr/lib64/mysql/plugin/auth.so
/usr/lib64/mysql/plugin/auth_socket.so
/usr/lib64/mysql/plugin/auth_test_plugin.so
/usr/lib64/mysql/plugin/daemon_example.ini
/usr/lib64/mysql/plugin/debug
/usr/lib64/mysql/plugin/debug/adt_null.so
/usr/lib64/mysql/plugin/debug/auth.so
/usr/lib64/mysql/plugin/debug/auth_socket.so
/usr/lib64/mysql/plugin/debug/auth_test_plugin.so
/usr/lib64/mysql/plugin/debug/innodb_engine.so
/usr/lib64/mysql/plugin/debug/libdaemon_example.so
/usr/lib64/mysql/plugin/debug/libmemcached.so
/usr/lib64/mysql/plugin/debug/mypluglib.so
/usr/lib64/mysql/plugin/debug/qa_auth_client.so
/usr/lib64/mysql/plugin/debug/qa_auth_interface.so
/usr/lib64/mysql/plugin/debug/qa_auth_server.so
/usr/lib64/mysql/plugin/debug/semisync_master.so
/usr/lib64/mysql/plugin/debug/semisync_slave.so
/usr/lib64/mysql/plugin/debug/validate_password.so
/usr/lib64/mysql/plugin/innodb_engine.so
/usr/lib64/mysql/plugin/libdaemon_example.so
/usr/lib64/mysql/plugin/libmemcached.so
/usr/lib64/mysql/plugin/mypluglib.so
/usr/lib64/mysql/plugin/qa_auth_client.so
/usr/lib64/mysql/plugin/qa_auth_interface.so
/usr/lib64/mysql/plugin/qa_auth_server.so
/usr/lib64/mysql/plugin/semisync_master.so
/usr/lib64/mysql/plugin/semisync_slave.so
/usr/lib64/mysql/plugin/validate_password.so
/usr/sbin/mysqld
/usr/sbin/mysqld-debug
/usr/share/doc/mysql-community-server-5.6.20
/usr/share/doc/mysql-community-server-5.6.20/COPYING
/usr/share/doc/mysql-community-server-5.6.20/ChangeLog
/usr/share/doc/mysql-community-server-5.6.20/INFO_BIN
/usr/share/doc/mysql-community-server-5.6.20/INFO_SRC
/usr/share/doc/mysql-community-server-5.6.20/README
/usr/share/doc/mysql-community-server-5.6.20/my-default.cnf
/usr/share/man/man1/innochecksum.1.gz
/usr/share/man/man1/my_print_defaults.1.gz
/usr/share/man/man1/myisam_ftdump.1.gz
/usr/share/man/man1/myisamchk.1.gz
/usr/share/man/man1/myisamlog.1.gz
/usr/share/man/man1/myisampack.1.gz
/usr/share/man/man1/mysql.server.1.gz
/usr/share/man/man1/mysql_convert_table_format.1.gz
/usr/share/man/man1/mysql_fix_extensions.1.gz
/usr/share/man/man1/mysql_install_db.1.gz
/usr/share/man/man1/mysql_plugin.1.gz
/usr/share/man/man1/mysql_secure_installation.1.gz
/usr/share/man/man1/mysql_tzinfo_to_sql.1.gz
/usr/share/man/man1/mysql_upgrade.1.gz
/usr/share/man/man1/mysql_zap.1.gz
/usr/share/man/man1/mysqlbug.1.gz
/usr/share/man/man1/mysqld_multi.1.gz
/usr/share/man/man1/mysqld_safe.1.gz
/usr/share/man/man1/mysqldumpslow.1.gz
/usr/share/man/man1/mysqlhotcopy.1.gz
/usr/share/man/man1/mysqlman.1.gz
/usr/share/man/man1/mysqltest.1.gz
/usr/share/man/man1/perror.1.gz
/usr/share/man/man1/replace.1.gz
/usr/share/man/man1/resolve_stack_dump.1.gz
/usr/share/man/man1/resolveip.1.gz
/usr/share/man/man8/mysqld.8.gz
/usr/share/mysql/SELinux/RHEL4/mysql.fc
/usr/share/mysql/SELinux/RHEL4/mysql.te
/usr/share/mysql/dictionary.txt
/usr/share/mysql/fill_help_tables.sql
/usr/share/mysql/innodb_memcached_config.sql
/usr/share/mysql/magic
/usr/share/mysql/my-default.cnf
/usr/share/mysql/mysql-log-rotate
/usr/share/mysql/mysql_security_commands.sql
/usr/share/mysql/mysql_system_tables.sql
/usr/share/mysql/mysql_system_tables_data.sql
/usr/share/mysql/mysql_test_data_timezone.sql
/var/lib/mysql
/var/run/mysqld
5. 配制my.cnf
datadir mysql.sock error.log etc
6.测试
dtrace -l |c++filt
58746 mysql5011 mysqld ha_myisam::rnd_next(unsigned char*) read-row-start
58747 mysql5011 mysqld ha_tina::rnd_pos(unsigned char*, unsigned char*) read-row-start
58748 mysql5011 mysqld ha_tina::rnd_next(unsigned char*) read-row-start
58749 mysql5011 mysqld ha_blackhole::rnd_next(unsigned char*) read-row-start
58750 mysql5011 mysqld ha_blackhole::rnd_pos(unsigned char*, unsigned char*) read-row-start
58751 mysql5011 mysqld handle_select(THD*, select_result*, unsigned long) select-done
58752 mysql5011 mysqld handle_select(THD*, select_result*, unsigned long) select-start
58753 mysql5011 mysqld mysql_execute_command(THD*) update-done
58754 mysql5011 mysqld handler::ha_update_row(unsigned char const*, unsigned char*) update-row-done
58755 mysql5011 mysqld handler::ha_update_row(unsigned char const*, unsigned char*) update-row-start
58756 mysql5011 mysqld mysql_execute_command(THD*) update-start
systemtap 在ORACLE LINUX 7.3 打开DTRACE=1可以源代码编绎MYSQL,但要安装Systemtap-sdt-devel-3.0-7.el7.x86_64
systemtap-devel-3.0-7.el7.x86_64
systemtap-client-3.0-7.el7.x86_64
systemtap-runtime-3.0-7.el7.x86_64
systemtap-sdt-devel-3.0-7.el7.x86_64
systemtap.x86_64 0:3.0-7.el7
但在DTRACE 工具完成后,源代码会自动检测ORACLE LINUX 7.3中是否有/usr/sbin/dtrace这个文件,如果有,就会自动打开DTRACE这个选 项,但是MYSQL源代码编绎出错,没成功
两个工具在编绎时只能使用一个,删掉另外一个安装包
mysql 源代码安装在ORACLE LINUX 7.3 不能成功编绎,请教一下大神们
最后
以上就是标致发箍为你收集整理的oracle linux 7.3 下用dtrace 跟踪 mysql-community-server-5.6.20的全部内容,希望文章能够帮你解决oracle linux 7.3 下用dtrace 跟踪 mysql-community-server-5.6.20所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复