当前位置:网站首页>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 请求的情况是抓取不到的。
边栏推荐
- leetcode-952: Calculate max component size by common factor
- Static routing + PAT + static NAT (explanation + experiment)
- Android's webview cache related knowledge collection
- 【CV项目调试】CUDNN_CONVOLUTION_FWD_SPECIFY_WORKSPACE_LIMIT问题
- Project development software directory structure specification
- What are the project management tools like MS Project
- 1. Non-type template parameters 2. Specialization of templates 3. Explanation of inheritance
- Maximum monthly salary of 20K?The average salary is nearly 10,000... What is the experience of working in a Huawei subsidiary?
- How to expose Prometheus metrics in go programs
- 拒绝加班,程序员开发的效率工具集
猜你喜欢
![LeetCode 1161 最大层内元素和[BFS 二叉树] HERODING的LeetCode之路](/img/56/fcc8ee6f592abf0a374fc950a3362f.png)
LeetCode 1161 最大层内元素和[BFS 二叉树] HERODING的LeetCode之路

MPPT solar charge controller data collection - through the gateway acquisition capacity battery SOC battery voltage, wi-fi

mysql view

Mathematics to solve the problem - circular linked list

tcp框架需要解决的问题

Fiddler captures packets to simulate weak network environment testing

Layer 2 broadcast storm (cause + judgment + solution)

934. The Shortest Bridge

MPPT太阳能充放电控制器数据采集-通过网关采集电池电压容量电量SOC,wifi传输

力扣刷题之爬楼梯(7/30)
随机推荐
系统需求多变如何设计
医疗影像领域AI软件开发流程
Calculate S=a+aa+…+aa…a
The final exam first year course
How to expose Prometheus metrics in go programs
Crypto Life, a day in the life of a Web3 project partner
[1154] How to convert string to datetime
mysql index
cudaMemcpy study notes
Path and the largest
力扣刷题之爬楼梯(7/30)
Maximum monthly salary of 20K?The average salary is nearly 10,000... What is the experience of working in a Huawei subsidiary?
Coldfusion file read holes (CVE - 2010-2861)
Classic linked list OJ strong training problem - fast and slow double pointer efficient solution
coldfusion8 background scheduled tasks take shell
Can an inexperienced college graduate switch to software testing?my real case
Software Testing Defect Reporting - Definition, Composition, Defect Lifecycle, Defect Tracking Post-Production Process, Defect Tracking Process, Purpose of Defect Tracking, Defect Management Tools
Real-time image acquisition based on FPGA
Linux下redis7的安装,启动与停止
CV-Model [3]: MobileNet v2