当前位置:网站首页>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.
边栏推荐
- Unity3D Button 鼠标悬浮进入与鼠标悬浮退出按钮事件
- 验证整数输入
- mycat的主从关系 垂直分库 水平分表 以及mycat分片联表查询的配置详解(mysql5.7系列)
- 【CV项目调试】CUDNN_CONVOLUTION_FWD_SPECIFY_WORKSPACE_LIMIT问题
- Basic introduction to ShardingJDBC
- CentOS7下mysql5.7.37的安装【完美方案】
- LeetCode 1161 最大层内元素和[BFS 二叉树] HERODING的LeetCode之路
- Project development software directory structure specification
- The effective square of the test (one question of the day 7/29)
- 基于opencv实现人脸检测
猜你喜欢
Huawei od dice js
Drools WorkBench的简介与使用
Word/Excel fixed table size, when filling in the content, the table does not change with the cell content
The application of AI in the whole process of medical imaging equipment
Static routing + PAT + static NAT (explanation + experiment)
AI在医疗影像设备全流程应用
STM32CUBEMX开发GD32F303(11)----ADC在DMA模式下扫描多个通道
19. Support Vector Machines - Intuitive Understanding of Optimization Objectives and Large Spacing
Pythagorean tuple od js
Drools Rule Properties, Advanced Syntax
随机推荐
4、敏感词过滤(前缀树)
开题报告之论文框架
【shell基础】判断目录是否为空
真正的CTO,是一个懂产品的技术人
The modification is not properly placed in the sandbox, causing Apple compatibility issues
[1153] The boundary range of between in mysql
String为什么不可变?
基于opencv实现人脸检测
The difference between link and @import
coldfusion8 background scheduled tasks take shell
try-catch中含return
LeetCode 1161 The largest element in the layer and the LeetCode road of [BFS binary tree] HERODING
mmdetection训练一个模型相关命令
Detailed explanation of STP election (step + case)
Android's webview cache related knowledge collection
Layer 2 broadcast storm (cause + judgment + solution)
multiplayer-hlap 包有问题,无法升级的解决方案
Static route analysis (the longest mask matching principle + active and standby routes)
What level of software testing does it take to get a 9K job?
全流程调度——MySQL与Sqoop