当前位置:网站首页>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.
边栏推荐
猜你喜欢

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

ShardingJDBC基本介绍

The principle of complete replication of virtual machines (cloud computing)

Introduction and use of Drools WorkBench

直播预告 | KDD2022博士论文奖冠亚军对话

真正的CTO,是一个懂产品的技术人

二层广播风暴(产生原因+判断+解决)

Drools basic introduction, introductory case, basic syntax

What level of software testing does it take to get a 9K job?

The application of AI in the whole process of medical imaging equipment
随机推荐
8、统一处理异常(控制器通知@ControllerAdvice全局配置类、@ExceptionHandler统一处理异常)
Intranet Infiltration - Privilege Escalation
Real-time image acquisition based on FPGA
Intel's software and hardware optimization empowers Neusoft to accelerate the arrival of the era of smart medical care
There is a problem with the multiplayer-hlap package and the solution cannot be upgraded
STM32CUBEMX开发GD32F303(11)----ADC在DMA模式下扫描多个通道
MPPT太阳能充放电控制器数据采集-通过网关采集电池电压容量电量SOC,wifi传输
知识蒸馏7:知识蒸馏代码详解
自动化办公案例:如何自动生成期数据?
Discourse 自定义头部链接(Custom Header Links)
How to do a startup CTO?
AtCoder Beginner Contest 261 部分题解
【shell基础】判断目录是否为空
Introduction and use of Drools WorkBench
Face detection based on opencv
【Android】Room —— SQLite的替代品
221. Largest Square
静态路由解析(最长掩码匹配原则+主备路由)
Calculate S=a+aa+…+aa…a
Detailed explanation of STP election (step + case)