当前位置:网站首页>BCC installation and basic tool instructions
BCC installation and basic tool instructions
2022-04-23 07:02:00 【Wei Yanhua】
Catalog
4.2 trace View its passed in parameters
bcc All the tools provided are installed in /usr/share/bcc/tools In this directory . But here's a reminder ,bcc By default, the software package will not configure these tools to the system PATH In the path , So you have to configure it manually :
$ export PATH=$PATH:/usr/share/bcc/tools
0. bcc install
0.1 yum install
yum install bcc-tools
0.2 Source code installation
Install build dependencies:
sudo yum groupinstall -y "Development tools"
sudo yum install -y elfutils-libelf-devel cmake3 git bison flex ncurses-devel
sudo yum install -y luajit luajit-devel # for Lua support
Install and compile LLVM:
curl -LO http://releases.llvm.org/7.0.1/llvm-7.0.1.src.tar.xz
curl -LO http://releases.llvm.org/7.0.1/cfe-7.0.1.src.tar.xz
tar -xf cfe-7.0.1.src.tar.xz
tar -xf llvm-7.0.1.src.tar.xz
mkdir clang-build
mkdir llvm-build
cd llvm-build
cmake3 -G "Unix Makefiles" -DLLVM_TARGETS_TO_BUILD="BPF;X86" \
-DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr ../llvm-7.0.1.src
make
sudo make install
cd ../clang-build
cmake3 -G "Unix Makefiles" -DLLVM_TARGETS_TO_BUILD="BPF;X86" \
-DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr ../cfe-7.0.1.src
make
sudo make install
cd ..
Install and compile BCC:
git clone GitHub - iovisor/bcc: BCC - Tools for BPF-based Linux IO analysis, networking, monitoring, and more
mkdir bcc/build; cd bcc/build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr
make
sudo make install
PS:
1. Use make Out of commission make -j8
2. ln -s python2 python # establish python Soft connection
3. make install route :/usr/share/bcc/tools
1. cachestat
./cachestat 1 3
TOTAL MISSES HITS DIRTIES BUFFERS_MB CACHED_MB
0 0 0 0 3 303
1 0 1 0 3 303
0 0 0 0 3 303
You can see ,cachestat The output of is actually a table . Each row represents a set of data , And each column represents different cache statistics . These indicators represent... From left to right
TOTAL , Indicates total I/O frequency ;
MISSES , Indicates the number of cache misses ;
HITS , Indicates the number of cache hits ;
DIRTIES, Indicates the number of dirty pages added to the cache ;
BUFFERS_MB Express Buffers Size , With MB In units of ;
CACHED_MB Express Cache Size , With MB In units of .
2. cachetop
./cachetop
13:52:30 Buffers MB: 3 / Cached MB: 391 / Sort: HITS / Order: ascending
PID UID CMD HITS MISSES DIRTIES READ_HIT% WRITE_HIT%
1506 root cachetop 1 0 0 100.0% 0.0%
1534 nginx nginx 1 3 0 25.0% 50.0%
1544 root curl 20 0 0 100.0% 0.0%
1543 root bash 198 4 0 98.0% 2.0%
1543 root curl 1993 80 0 96.1% 3.9%
Its output is similar to top similar , The default is based on the number of hits in the cache (HITS) Sort , Shows the cache hits of each process . Specific to each indicator , there HITS、MISSES and DIRTIES , Follow cachestat The same meaning in , Each represents the number of cache hits in the interval 、 Number of misses and dirty pages added to the cache .
and READ_HIT and WRITE_HIT , Indicates the cache hit rate of read and write respectively .
3. funccount
./funccount -i 1 c:malloc
Tracing 1 functions for "b'c:malloc'"... Hit Ctrl-C to end.
FUNC COUNT
b'malloc' 2
FUNC COUNT
b'malloc' 1
FUNC COUNT
b'malloc' 1
FUNC COUNT
b'malloc' 1
FUNC COUNT
b'malloc' 1
funccount Some parameters are supported , such as -p Specify a process ID, -i Specify the time interval for the output . At present, it can only support up to 1000 A tracking object (probe), about fmt.* Come on , There are not many functions OK, But if you track all libgo There is a problem with the function in
# funccount 'go:*'
maximum of 1000 probes allowed, attempted 21178
Uh huh , No more work . It's like bcc/BPF Like some other problems in , If this limitation hinders the application too much, we should consider finding a way to solve it .
4. trace
4.1 trace
./trace do_sys_open
PID TID COMM FUNC
832 832 irqbalance do_sys_open
832 832 irqbalance do_sys_open
1 1 systemd do_sys_open
1 1 systemd do_sys_open
832 832 irqbalance do_sys_open
832 832 irqbalance do_sys_open
832 832 irqbalance do_sys_open
832 832 irqbalance do_sys_open
832 832 irqbalance do_sys_open
832 832 irqbalance do_sys_open
832 832 irqbalance do_sys_open
832 832 irqbalance do_sys_open
832 832 irqbalance do_sys_open
832 832 irqbalance do_sys_open
832 832 irqbalance do_sys_open
832 832 irqbalance do_sys_open
1 1 systemd do_sys_open
832 832 irqbalance do_sys_open
832 832 irqbalance do_sys_open
832 832 irqbalance do_sys_open
832 832 irqbalance do_sys_open
832 832 irqbalance do_sys_open
832 832 irqbalance do_sys_open
832 832 irqbalance do_sys_open
832 832 irqbalance do_sys_open
4.2 trace View its passed in parameters
./trace '/root/bcc_test/test_malloc:add "%d %d" arg1, arg2' PID TID COMM FUNC - 1691 1691 test_malloc add 2 3 1692 1692 test_malloc add 2 3 1693 1693 test_malloc add 2 3 1694 1694 test_malloc add 2 3 1695 1695 test_malloc add 2 3 1696 1696 test_malloc add 2 3
版权声明
本文为[Wei Yanhua]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230557207747.html
边栏推荐
- surprise库中evaluate函数弃用解决方法
- 用Future与CountDownLatch实现多线程执行多个异步任务,任务全部完成后返回结果
- MySQL 【读写锁+表锁+行锁+MVCC】
- Web登录小案例(含验证码登录)
- Oracle Performance Analysis Tool: oswatcher
- Each traversal usage of tp6
- Prometheus Thanos快速指南
- AttributeError: ‘dict‘ object has no attribute ‘iteritems‘
- [no steps in a small step to a thousand miles] Oracle Application derivative ora-01455 error reporting processing
- [Lombok quick start]
猜你喜欢

Basic concepts of database: OLTP / OLAP / HTAP, RPO / RTO, MPP

surprise库中evaluate函数弃用解决方法

修改Jupyter Notebook样式

Imitation scallop essay reading page

通过源码探究@ModelAndView如何实现数据与页面的转发
![[ES6 quick start]](/img/9e/4c4be5907c1f7b3485c2f4178b9150.png)
[ES6 quick start]

MySQL【ACID+隔离级别+ redo log + undo log】

MySQL 【读写锁+表锁+行锁+MVCC】

使用prom-label-proxy实现Prometheus Thanos的基于标签的多租户读

【ES6快速入门】
随机推荐
LeetCode刷题|13罗马数字转整数
2021年国产数据库12强介绍
The arithmetic square root of X in leetcode
Oracle性能分析工具:OSWatcher
JS performance optimization
DNA reveals surprise ancestry of mysterious Chinese mummies
如何通过dba_hist_active_sess_history分析数据库历史性能问题
qs.stringify 接口里把入参转为&连接的字符串(配合application/x-www-form-urlencoded请求头)
你应该知道的 JVM 基础知识
Thanos Compact组件测试总结(处理历史数据)
使用prom-label-proxy实现Prometheus Thanos的基于标签的多租户读
tensorflow下载
Redis 详解(基础+数据类型+事务+持久化+发布订阅+主从复制+哨兵+缓存穿透、击穿、雪崩)
Introduction to DDoS attack / defense
Prometheus Cortex使用Block存储时的相关问题
Imitation scallop essay reading page
Sum (if) in MySQL_ Sum (if ()) in MySQL
关于 synchronized、ThreadLocal、线程池、Atomic 原子类的 JUC 面试题
surprise库中evaluate函数弃用解决方法
ES6 specification details