当前位置:网站首页>execsnoop 工具
execsnoop 工具
2022-07-31 02:31:00 【北在南方】
execsnoop
一 前言
execsnoop -- 短时进程追踪工具,它能够抓取服务器上瞬时执行的命令,类似 history 但是execsnoop 是实时记录全系统在执行的命令。
当我们遇到性能问题,但是通过 vmstat,dstat,top 等工具分析不到导致问题的进程,可以考虑使用 execsnoop 。看看是否能够抓到瞬时执行的命令请求。 前文说的案例就是 一例。 当机器 cpu 负载持续高涨却抓取不到 top 进程时,可以采用 execsnoop 抓取短时进程。
二 使用
execsnoop 的安装非常简单,其实它就是一个 可执行的 shell 。
下载:
https://github.com/brendangregg/perf-tools/blob/master/execsnoop
安装 ,则是下载或者拷贝文件内容 写到 /usr/bin/execsnoop ,并执行 chmod +x /usr/bin/execsnoop
使用方法:
execsnoop 的参数
[[email protected] ~]# execsnoop -h
USAGE: execsnoop [-hrt] [-a argc] [-d secs] [name]
-d seconds # trace duration, and use buffers
-a argc # max args to show (default 8)
-r # include re-execs
-t # include time (seconds)
-h # this usage message
name # process name to match (REs allowed)
eg,
execsnoop # watch exec()s live (unbuffered)
execsnoop -d 1 # trace 1 sec (buffered)
execsnoop grep # trace process names containing grep
execsnoop 'udevd$' # process names ending in "udevd"
比如我们要抓取谁访问了 mysql
[[email protected] ~]# execsnoop mysql ## mysql 是指 进程的name
Tracing exec()s issued by process name "mysql". Ctrl-C to end.
Instrumenting sys_execve
PID PPID ARGS
22632 22631 /data/sandboxes/mysql_binary/5.7.31/bin/mysql --defaults-file=/data/msb_5_7_31/my.sandbox.cnf
22661 22660 /data/sandboxes/mysql_binary/5.7.31/bin/mysql --defaults-file=/data/msb_5_7_31/my.sandbox.cnf
22700 22699 /data/sandboxes/mysql_binary/5.7.31/bin/mysql --defaults-file=/data/msb_5_7_31/my.sandbox.cnf -e select now();
^C
Ending tracing...
该工具只能抓取一次性执行的命令,如果是长连接比如通过tcp ip 连接,然后发送SQL 请求的情况是抓取不到的。
边栏推荐
- Word/Excel fixed table size, when filling in the content, the table does not change with the cell content
- Draw Your Cards
- 数学解决——环形链表问题
- 【CV项目调试】CUDNN_CONVOLUTION_FWD_SPECIFY_WORKSPACE_LIMIT问题
- Classic linked list OJ strong training problem - fast and slow double pointer efficient solution
- 你们程序员为什么不靠自己的项目谋生?而必须为其他人打工?
- Live Preview | KDD2022 Doctoral Dissertation Award Champion and Runner-up Dialogue
- Drools规则属性,高级语法
- Drools Rule Properties, Advanced Syntax
- 【Bank Series Phase 1】People's Bank of China
猜你喜欢

What have I experienced to become a tester who is harder than development?

What are the project management tools like MS Project
![CV-Model [3]: MobileNet v2](/img/c7/1155a1f610110724c67a3b7557ef28.jpg)
CV-Model [3]: MobileNet v2

uniapp uses 3rd party fonts

19.支持向量机-优化目标和大间距直观理解

934. The Shortest Bridge

Inter-vlan routing + static routing + NAT (PAT + static NAT) comprehensive experiment

Intranet Infiltration - Privilege Escalation

基于opencv实现人脸检测

Crypto Life, a day in the life of a Web3 project partner
随机推荐
Basic introduction to ShardingJDBC
BAT can't sell "Medical Cloud": Hospitals flee, mountains stand, and there are rules
Detailed explanation of STP election (step + case)
221. Largest Square
关于 mysql8.0数据库中主键位id,使用replace插入id为0时,实际id插入后自增导致数据重复插入 的解决方法
mysql index
ShardingJDBC使用总结
Installation, start and stop of redis7 under Linux
Basic learning about Redis related content
[1153] The boundary range of between in mysql
Android's webview cache related knowledge collection
全流程调度——MySQL与Sqoop
基于FPGA的售货机
AI在医疗影像设备全流程应用
Huawei od dice js
Coldfusion file read holes (CVE - 2010-2861)
曼城推出可检测情绪的智能围巾,把球迷给整迷惑了
基于FPGA的图像实时采集
cudaMemcpy学习笔记
Between two orderly array of additive and Topk problem