BCC
BCC
目录
用例 (见ob软件版本)
项目案例
编译后,可以在 /usr/share/bcc/
里找到
- /usr/share/bcc
- /examples
- hello_world.py
- /tracing
- (非常多的示例python)
- /introspection
- /man
- /tools
- (非常多的工具)
- /examples
其实哪怕不整体编译,在源码那个地方要什么工具就编译什么工具也是可以的。特别是python,例如直接运行 python3 ./hello_world.py
就行
Examples
- examples/tracing/bitehist.py: Block I/O size histogram. Examples. 块 I/O 大小直方图
- examples/tracing/disksnoop.py: Trace block device I/O latency. Examples. 跟踪块设备 I/O 延迟
- examples/hello_world.py: Prints "Hello, World!" for new processes. 用新流程打印“Hello,World!
- examples/tracing/mysqld_query.py: Trace MySQL server queries using USDT probes. Examples. 使用 USDT 探针跟踪 MySQL 服务器查询
- examples/tracing/nodejs_http_server.py: Trace Node.js HTTP server requests using USDT probes. Examples. 使用 USDT 探针跟踪 Node.js HTTP 服务器请求
- examples/tracing/stacksnoop: Trace a kernel function and print all kernel stack traces. Examples. 跟踪内核函数并打印所有内核堆栈跟踪
- tools/statsnoop: Trace stat() syscalls. Examples. 跟踪 stat() 系统调用
- examples/tracing/task_switch.py: Count task switches with from and to PIDs. 使用起始和终止 PID 来计算任务切换
- examples/tracing/tcpv4connect.py: Trace TCP IPv4 active connections. Examples. 跟踪 TCP IPv4 活动连接
- examples/tracing/trace_fields.py: Simple example of printing fields from traced events. 打印跟踪事件字段的简单示例
- examples/tracing/undump.py: Dump UNIX socket packets. Examples 转储 UNIX 套接字数据包
- examples/tracing/urandomread.py: A kernel tracepoint example, which traces random:urandom_read. Examples. 内核跟踪点示例
- examples/tracing/vfsreadlat.py examples/tracing/vfsreadlat.c: VFS read latency distribution. Examples. VFS 读取延迟分布
- examples/tracing/kvm_hypercall.py: Conditional static kernel tracepoints for KVM entry, exit and hypercall Examples. KVM 进入、退出和超级调用示例的条件静态内核跟踪点。
Tools
- tools/argdist: Display function parameter values as a histogram or frequency count. Examples. 将函数参数值显示为直方图或频率计数
- tools/bashreadline: Print entered bash commands system wide. Examples. 在系统范围内打印输入的 bash 命令
- tools/bindsnoop: Trace IPv4 and IPv6 bind() system calls (bind()). Examples. 跟踪 IPv4 和 IPv6 bind() 系统调用 (bind())
- tools/biolatency: Summarize block device I/O latency as a histogram. Examples. 将块设备 I/O 延迟总结为直方图
- tools/biotop: Top for disks: Summarize block device I/O by process. Examples. 磁盘顶部:按进程汇总块设备 I/O
- tools/biopattern: Identify random/sequential disk access patterns. Examples. 识别随机/顺序磁盘访问模式
- tools/biosnoop: Trace block device I/O with PID and latency. Examples. 使用 PID 和延迟跟踪块设备 I/O
- tools/bitesize: Show per process I/O size histogram. Examples. 显示每个进程 I/O 大小直方图
- tools/bpflist: Display processes with active BPF programs and maps. Examples. 显示具有活动 BPF 程序和映射的进程
- tools/btrfsdist: Summarize btrfs operation latency distribution as a histogram. Examples. 将 btrfs 操作延迟分布总结为直方图
- tools/btrfsslower: Trace slow btrfs operations. Examples. 跟踪缓慢的 btrfs 操作
- tools/capable: Trace security capability checks. Examples. 跟踪安全能力检查
- tools/cachestat: Trace page cache hit/miss ratio. Examples. 跟踪页面缓存命中/未命中率
- tools/cachetop: Trace page cache hit/miss ratio by processes. Examples. 按进程跟踪页面缓存命中/未命中率
- tools/compactsnoop: Trace compact zone events with PID and latency. Examples. 使用 PID 和延迟跟踪紧凑区域事件
- tools/cpudist: Summarize on- and off-CPU time per task as a histogram. Examples 将每个任务的 CPU 开启和关闭时间总结为直方图
- tools/cpuunclaimed: Sample CPU run queues and calculate unclaimed idle CPU. Examples 采样 CPU 运行队列并计算无人认领的空闲 CPU
- tools/criticalstat: Trace and report long atomic critical sections in the kernel. Examples 跟踪并报告内核中的长原子关键部分
- tools/dbslower: Trace MySQL/PostgreSQL queries slower than a threshold. Examples. 跟踪慢于阈值的 MySQL/PostgreSQL 查询
- tools/dbstat: Summarize MySQL/PostgreSQL query latency as a histogram. Examples. 将 MySQL/PostgreSQL 查询延迟总结为直方图
- tools/dcsnoop: Trace directory entry cache (dcache) lookups. Examples. 跟踪目录条目缓存 (dcache) 查找
- tools/dcstat: Directory entry cache (dcache) stats. Examples. 目录条目缓存 (dcache) 统计信息
- tools/deadlock: Detect potential deadlocks on a running process. Examples. 检测正在运行的进程上潜在的死锁
- tools/dirtop: File reads and writes by directory. Top for directories. Examples. 按目录进行文件读写。目录顶部
- tools/drsnoop: Trace direct reclaim events with PID and latency. Examples. 使用 PID 和延迟跟踪直接回收事件
- tools/execsnoop: Trace new processes via exec() syscalls. Examples. 通过 exec() 系统调用跟踪新进程
- tools/exitsnoop: Trace process termination (exit and fatal signals). Examples. 跟踪进程终止(退出和致命信号)
- tools/ext4dist: Summarize ext4 operation latency distribution as a histogram. Examples. 将 ext4 操作延迟分布总结为直方图
- tools/ext4slower: Trace slow ext4 operations. Examples. 跟踪缓慢的 ext4 操作
- tools/filelife: Trace the lifespan of short-lived files. Examples. 跟踪短期文件的生命周期
- tools/filegone: Trace why file gone (deleted or renamed). Examples. 跟踪文件消失的原因(删除或重命名)
- tools/fileslower: Trace slow synchronous file reads and writes. Examples. 跟踪缓慢的同步文件读取和写入
- tools/filetop: File reads and writes by filename and process. Top for files. Examples. 按文件名和进程读取和写入文件。顶部为文件
- tools/funccount: Count kernel function calls. Examples. 计算内核函数调用次数
- tools/funcinterval: Time interval between the same function as a histogram. Examples. 作为直方图的同一函数之间的时间间隔
- tools/funclatency: Time functions and show their latency distribution. Examples. 时间函数并显示其延迟分布
- tools/funcslower: Trace slow kernel or user function calls. Examples. 跟踪缓慢的内核或用户函数调用
- tools/gethostlatency: Show latency for getaddrinfo/gethostbyname[2] calls. Examples. 显示 getaddrinfo/gethostbyname[2] 调用的延迟
- tools/hardirqs: Measure hard IRQ (hard interrupt) event time. Examples. 测量硬IRQ(硬中断)事件时间
- tools/inject: Targeted error injection with call chain and predicates Examples. 带有调用链和谓词示例的有针对性的错误注入
- tools/killsnoop: Trace signals issued by the kill() syscall. Examples. 由kill()系统调用发出的跟踪信号
- tools/klockstat: Traces kernel mutex lock events and display locks statistics. Examples. 跟踪内核互斥锁定事件并显示锁定统计信息
- tools/kvmexit: Display the exit_reason and its statistics of each vm exit. Examples. 显示每个虚拟机退出的 exit_reason 及其统计信息
- tools/llcstat: Summarize CPU cache references and misses by process. Examples. 按进程汇总 CPU 缓存引用和未命中情况
- tools/mdflush: Trace md flush events. Examples. 跟踪 md 刷新事件
- tools/memleak: Display outstanding memory allocations to find memory leaks. Examples. 显示未完成的内存分配以查找内存泄漏
- tools/mountsnoop: Trace mount and umount syscalls system-wide. Examples. 跟踪系统范围内的挂载和卸载系统调用
- tools/mysqld_qslower: Trace MySQL server queries slower than a threshold. Examples. 跟踪慢于阈值的 MySQL 服务器查询
- tools/netqtop tools/netqtop.c: Trace and display packets distribution on NIC queues. Examples. 跟踪并显示 NIC 队列上的数据包分布
- tools/nfsslower: Trace slow NFS operations. Examples. 跟踪缓慢的 NFS 操作
- tools/nfsdist: Summarize NFS operation latency distribution as a histogram. Examples. 将 NFS 操作延迟分布总结为直方图
- tools/offcputime: Summarize off-CPU time by kernel stack trace. Examples. 通过内核堆栈跟踪汇总脱离 CPU 的时间
- tools/offwaketime: Summarize blocked time by kernel off-CPU stack and waker stack. Examples.
- tools/oomkill: Trace the out-of-memory (OOM) killer. Examples.
- tools/opensnoop: Trace open() syscalls. Examples.
- tools/pidpersec: Count new processes (via fork). Examples.
- tools/ppchcalls: Summarize ppc hcall counts and latencies. Examples.
- tools/profile: Profile CPU usage by sampling stack traces at a timed interval. Examples.
- tools/readahead: Show performance of read-ahead cache Examples.
- tools/reset-trace: Reset the state of tracing. Maintenance tool only. Examples.
- tools/runqlat: Run queue (scheduler) latency as a histogram. Examples.
- tools/runqlen: Run queue length as a histogram. Examples.
- tools/runqslower: Trace long process scheduling delays. Examples.
- tools/shmsnoop: Trace System V shared memory syscalls. Examples.
- tools/sofdsnoop: Trace FDs passed through unix sockets. Examples.
- tools/slabratetop: Kernel SLAB/SLUB memory cache allocation rate top. Examples.
- tools/softirqs: Measure soft IRQ (soft interrupt) event time. Examples.
- tools/solisten: Trace TCP socket listen. Examples.
- tools/sslsniff: Sniff OpenSSL written and readed data. Examples.
- tools/stackcount: Count kernel function calls and their stack traces. Examples.
- tools/syncsnoop: Trace sync() syscall. Examples.
- tools/syscount: Summarize syscall counts and latencies. Examples.
- tools/tcpaccept: Trace TCP passive connections (accept()). Examples.
- tools/tcpconnect: Trace TCP active connections (connect()). Examples.
- tools/tcpconnlat: Trace TCP active connection latency (connect()). Examples.
- tools/tcpdrop: Trace kernel-based TCP packet drops with details. Examples.
- tools/tcplife: Trace TCP sessions and summarize lifespan. Examples.
- tools/tcpretrans: Trace TCP retransmits and TLPs. Examples.
- tools/tcprtt: Trace TCP round trip time. Examples.
- tools/tcpstates: Trace TCP session state changes with durations. Examples.
- tools/tcpsubnet: Summarize and aggregate TCP send by subnet. Examples.
- tools/tcpsynbl: Show TCP SYN backlog. Examples.
- tools/tcptop: Summarize TCP send/recv throughput by host. Top for TCP. Examples.
- tools/tcptracer: Trace TCP established connections (connect(), accept(), close()). Examples.
- tools/tcpcong: Trace TCP socket congestion control status duration. Examples.
- tools/threadsnoop: List new thread creation. Examples.
- tools/tplist: Display kernel tracepoints or USDT probes and their formats. Examples.
- tools/trace: Trace arbitrary functions, with filters. Examples.
- tools/ttysnoop: Watch live output from a tty or pts device. Examples.
- tools/ucalls: Summarize method calls or Linux syscalls in high-level languages. Examples.
- tools/uflow: Print a method flow graph in high-level languages. Examples.
- tools/ugc: Trace garbage collection events in high-level languages. Examples.
- tools/uobjnew: Summarize object allocation events by object type and number of bytes allocated. Examples.
- tools/ustat: Collect events such as GCs, thread creations, object allocations, exceptions and more in high-level languages. Examples.
- tools/uthreads: Trace thread creation events in Java and raw pthreads. Examples.
- tools/vfscount: Count VFS calls. Examples.
- tools/vfsstat: Count some VFS calls, with column output. Examples.
- tools/virtiostat: Show VIRTIO device IO statistics. Examples.
- tools/wakeuptime: Summarize sleep to wakeup time by waker kernel stack. Examples.
- tools/xfsdist: Summarize XFS operation latency distribution as a histogram. Examples.
- tools/xfsslower: Trace slow XFS operations. Examples.
- tools/zfsdist: Summarize ZFS operation latency distribution as a histogram. Examples.
- tools/zfsslower: Trace slow ZFS operations. Examples.
链接到当前文件 0
没有文件链接到当前文件