当前位置:网站首页>execsnoop tool
execsnoop tool
2022-07-31 02:40:00 【north is south】
execsnoop
一 前言
execsnoop -- Short-term progress tracking tool,It is capable of grabbing commands that are executed instantaneously on the server,类似 history 但是execsnoop It is a real-time recording of the commands executed by the whole system.
When we run into performance issues,但是通过 vmstat,dstat,top Other tools cannot analyze the process that caused the problem,可以考虑使用 execsnoop .See if you can catch instantaneous command requests. The case mentioned above is 一例. 当机器 cpu 负载持续高涨却抓取不到 top 进程时,可以采用 execsnoop 抓取短时进程.
二 使用
execsnoop 的安装非常简单,其实它就是一个 可执行的 shell .
下载:
https://github.com/brendangregg/perf-tools/blob/master/execsnoop
安装 ,It is to download or copy the content of the file 写到 /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"
For example, we want to crawl who visited 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...
The tool can only grab commands for one-time execution,If it is a long connection such as throughtcp ip 连接,然后发送SQL The requested situation cannot be fetched.
边栏推荐
- Static routing + PAT + static NAT (explanation + experiment)
- Huawei od dice js
- JS 函数 this上下文 运行时点语法 圆括号 数组 IIFE 定时器 延时器 self.备份上下文 call apply
- How to do a startup CTO?
- FPGA-based vending machine
- try-catch中含return
- mmdetection trains a model related command
- Go 项目实战-获取多级分类下的全部商品
- [1153]mysql中between的边界范围
- Refuse to work overtime, a productivity tool set developed by programmers
猜你喜欢
221. Largest Square
汉源高科8路HDMI综合多业务高清视频光端机8路HDMI视频+8路双向音频+8路485数据+8路E1+32路电话+4路千兆物理隔离网络
1. Non-type template parameters 2. Specialization of templates 3. Explanation of inheritance
Real-time image acquisition based on FPGA
vlan间路由+静态路由+NAT(PAT+静态NAT)综合实验
知识蒸馏7:知识蒸馏代码详解
Linux下redis7的安装,启动与停止
The principle of complete replication of virtual machines (cloud computing)
ShardingJDBC基本介绍
Inter-vlan routing + static routing + NAT (PAT + static NAT) comprehensive experiment
随机推荐
共模电感的仿真应用来了,满满的干货送给大家
Installation, start and stop of redis7 under Linux
multiplayer-hlap 包有问题,无法升级的解决方案
mysql 视图
Introduction to flask series 】 【 flask - using SQLAlchemy
TCP/IP四层模型
mysql view
mysql 索引
The principle of complete replication of virtual machines (cloud computing)
Detailed explanation of STP election (step + case)
ShardingJDBC usage summary
字体压缩神器font-spider的使用
CMOS和TTL的区别?
LeetCode 1161 最大层内元素和[BFS 二叉树] HERODING的LeetCode之路
直播预告 | KDD2022博士论文奖冠亚军对话
Observer mode (1)
【C语言基础】解决C语言error: expected ‘;‘, ‘,‘ or ‘)‘ before ‘&‘ token
ShardingJDBC基本介绍
Draw Your Cards
Tower of Hanoi problem