当前位置:网站首页>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 请求的情况是抓取不到的。
边栏推荐
- Maximum monthly salary of 20K?The average salary is nearly 10,000... What is the experience of working in a Huawei subsidiary?
- 12 磁盘相关命令
- f.grid_sample
- ShardingJDBC基本介绍
- ShardingJDBC使用总结
- 19. Support Vector Machines - Intuitive Understanding of Optimization Objectives and Large Spacing
- Drools basic introduction, introductory case, basic syntax
- Fiddler captures packets to simulate weak network environment testing
- vlan间路由+静态路由+NAT(PAT+静态NAT)综合实验
- cudaMemcpy study notes
猜你喜欢
To write good test cases, you must first learn test design
What level of software testing does it take to get a 9K job?
Live Preview | KDD2022 Doctoral Dissertation Award Champion and Runner-up Dialogue
JS 函数 this上下文 运行时点语法 圆括号 数组 IIFE 定时器 延时器 self.备份上下文 call apply
英特尔软硬优化,赋能东软加速智慧医疗时代到来
真正的CTO,是一个懂产品的技术人
Software testing basic interface testing - getting started with Jmeter, you should pay attention to these things
STM32CUBEMX开发GD32F303(11)----ADC在DMA模式下扫描多个通道
经典链表OJ强训题——快慢双指针高效解法
User interaction + formatted output
随机推荐
uniapp uses 3rd party fonts
The effective square of the test (one question of the day 7/29)
Refuse to work overtime, a productivity tool set developed by programmers
MPPT solar charge controller data collection - through the gateway acquisition capacity battery SOC battery voltage, wi-fi
tcp框架需要解决的问题
1. Non-type template parameters 2. Specialization of templates 3. Explanation of inheritance
Can an inexperienced college graduate switch to software testing?my real case
AI在医疗影像设备全流程应用
FPGA-based vending machine
[1153] The boundary range of between in mysql
拒绝加班,程序员开发的效率工具集
LeetCode 1161 最大层内元素和[BFS 二叉树] HERODING的LeetCode之路
CV-Model [3]: MobileNet v2
User interaction + formatted output
leetcode-952: Calculate max component size by common factor
The final exam first year course
英特尔软硬优化,赋能东软加速智慧医疗时代到来
修改未正确放入沙盒造成苹果兼容性问题
Software Testing Defect Reporting - Definition, Composition, Defect Lifecycle, Defect Tracking Post-Production Process, Defect Tracking Process, Purpose of Defect Tracking, Defect Management Tools
Huawei od dice js