1 Star 1 Fork 0

RobotCT/bcc

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
.github
SPECS
cmake
debian
docker
docs
examples
images
introspection
libbpf-tools
man
scripts
snap
src
tests
tools
lib
old
CMakeLists.txt
argdist.py
argdist_example.txt
bashreadline.py
bashreadline_example.txt
bindsnoop.py
bindsnoop_example.txt
biolatency.py
biolatency_example.txt
biolatpcts.py
biolatpcts_example.txt
biopattern.py
biopattern_example.txt
biosnoop.lua
biosnoop.py
biosnoop_example.txt
biotop.py
biotop_example.txt
bitesize.py
bitesize_example.txt
bpflist.py
bpflist_example.txt
btrfsdist.py
btrfsdist_example.txt
btrfsslower.py
btrfsslower_example.txt
cachestat.py
cachestat_example.txt
cachetop.py
cachetop_example.txt
capable.py
capable_example.txt
cobjnew.sh
cobjnew_example.txt
compactsnoop.py
compactsnoop_example.txt
cpudist.py
cpudist_example.txt
cpuunclaimed.py
cpuunclaimed_example.txt
criticalstat.py
criticalstat_example.txt
cthreads_example.txt
dbslower.py
dbslower_example.txt
dbstat.py
dbstat_example.txt
dcsnoop.py
dcsnoop_example.txt
dcstat.py
dcstat_example.txt
deadlock.c
deadlock.py
deadlock_example.txt
dirtop.py
dirtop_example.txt
drsnoop.py
drsnoop_example.txt
execsnoop.py
execsnoop_example.txt
exitsnoop.py
exitsnoop_example.txt
ext4dist.py
ext4dist_example.txt
ext4slower.py
ext4slower_example.txt
filegone.py
filegone_example.txt
filelife.py
filelife_example.txt
fileslower.py
fileslower_example.txt
filetop.py
filetop_example.txt
funccount.py
funccount_example.txt
funcinterval.py
funcinterval_example.txt
funclatency.py
funclatency_example.txt
funcslower.py
funcslower_example.txt
gethostlatency.py
gethostlatency_example.txt
hardirqs.py
hardirqs_example.txt
inject.py
inject_example.txt
javacalls.sh
javacalls_example.txt
javaflow.sh
javaflow_example.txt
javagc.sh
javagc_example.txt
javaobjnew.sh
javaobjnew_example.txt
javastat.sh
javastat_example.txt
javathreads.sh
javathreads_example.txt
killsnoop.py
killsnoop_example.txt
klockstat.py
klockstat_example.txt
kvmexit.py
kvmexit_example.txt
llcstat.py
llcstat_example.txt
mdflush.py
mdflush_example.txt
memleak.py
memleak_example.txt
mountsnoop.py
mountsnoop_example.txt
mysqld_qslower.py
mysqld_qslower_example.txt
netqtop.c
netqtop.py
netqtop_example.txt
nfsdist.py
nfsdist_example.txt
nfsslower.py
nfsslower_example.txt
nodegc.sh
nodegc_example.txt
nodestat.sh
nodestat_example.txt
offcputime.py
offcputime_example.txt
offwaketime.py
offwaketime_example.txt
oomkill.py
oomkill_example.txt
opensnoop.py
opensnoop_example.txt
perlcalls.sh
perlcalls_example.txt
perlflow.sh
perlflow_example.txt
perlstat.sh
perlstat_example.txt
phpcalls.sh
phpcalls_example.txt
phpflow.sh
phpflow_example.txt
phpstat.sh
phpstat_example.txt
pidpersec.py
pidpersec_example.txt
ppchcalls.py
ppchcalls_example.txt
profile.py
profile_example.txt
pythoncalls.sh
pythoncalls_example.txt
pythonflow.sh
pythonflow_example.txt
pythongc.sh
pythongc_example.txt
pythonstat.sh
pythonstat_example.txt
rdmaucma.py
rdmaucma_example.txt
readahead.py
readahead_example.txt
reset-trace.sh
reset-trace_example.txt
rubycalls.sh
rubycalls_example.txt
rubyflow.sh
rubyflow_example.txt
rubygc.sh
rubygc_example.txt
rubyobjnew.sh
rubyobjnew_example.txt
rubystat.sh
rubystat_example.txt
runqlat.py
runqlat_example.txt
runqlen.py
runqlen_example.txt
runqslower.py
runqslower_example.txt
shmsnoop.py
shmsnoop_example.txt
slabratetop.py
slabratetop_example.txt
sofdsnoop.py
sofdsnoop_example.txt
softirqs.py
softirqs_example.txt
solisten.py
solisten_example.txt
sslsniff.py
sslsniff_example.txt
stackcount.py
stackcount_example.txt
stacksnoop.lua
statsnoop.py
statsnoop_example.txt
swapin.py
swapin_example.txt
syncsnoop.py
syncsnoop_example.txt
syscount.py
syscount_example.txt
tclcalls.sh
tclcalls_example.txt
tclflow.sh
tclflow_example.txt
tclobjnew.sh
tclobjnew_example.txt
tclstat.sh
tclstat_example.txt
tcpaccept.py
tcpaccept_example.txt
tcpcong.py
tcpcong_example.txt
tcpconnect.py
tcpconnect_example.txt
tcpconnlat.py
tcpconnlat_example.txt
tcpdrop.py
tcpdrop_example.txt
tcplife.lua
tcplife.py
tcplife_example.txt
tcpretrans.py
tcpretrans_example.txt
tcprtt.py
tcprtt_example.txt
tcpstates.py
tcpstates_example.txt
tcpsubnet.py
tcpsubnet_example.txt
tcpsynbl.py
tcpsynbl_example.txt
tcptop.py
tcptop_example.txt
tcptracer.py
tcptracer_example.txt
threadsnoop.py
threadsnoop_example.txt
tplist.py
tplist_example.txt
trace.py
trace_example.txt
ttysnoop.py
ttysnoop_example.txt
vfscount.py
vfscount_example.txt
vfsstat.py
vfsstat_example.txt
virtiostat.py
virtiostat_example.txt
wakeuptime.py
wakeuptime_example.txt
xfsdist.py
xfsdist_example.txt
xfsslower.py
xfsslower_example.txt
zfsdist.py
zfsdist_example.txt
zfsslower.py
zfsslower_example.txt
.clang-format
.dockerignore
.gitignore
.gitmodules
.travis.yml
CMakeLists.txt
CODEOWNERS
CONTRIBUTING-SCRIPTS.md
FAQ.txt
INSTALL.md
LICENSE.txt
LINKS.md
QUICKSTART.md
README.md
克隆/下载
zfsdist_example.txt 9.52 KB
一键复制 编辑 原始数据 按行查看 历史
Brendan Gregg 提交于 9年前 . zfsdist
Demonstrations of zfsdist, the Linux eBPF/bcc version.
zfsdist traces ZFS reads, writes, opens, and fsyncs, and summarizes their
latency as a power-of-2 histogram. It has been written to work on ZFS on Linux
(http://zfsonlinux.org). For example:
# ./zfsdist
Tracing ZFS operation latency... Hit Ctrl-C to end.
^C
operation = 'read'
usecs : count distribution
0 -> 1 : 0 | |
2 -> 3 : 0 | |
4 -> 7 : 4479 |****************************************|
8 -> 15 : 1028 |********* |
16 -> 31 : 14 | |
32 -> 63 : 1 | |
64 -> 127 : 2 | |
128 -> 255 : 6 | |
256 -> 511 : 1 | |
512 -> 1023 : 1256 |*********** |
1024 -> 2047 : 9 | |
2048 -> 4095 : 1 | |
4096 -> 8191 : 2 | |
operation = 'write'
usecs : count distribution
0 -> 1 : 0 | |
2 -> 3 : 0 | |
4 -> 7 : 0 | |
8 -> 15 : 0 | |
16 -> 31 : 0 | |
32 -> 63 : 0 | |
64 -> 127 : 0 | |
128 -> 255 : 75 |****************************************|
256 -> 511 : 11 |***** |
512 -> 1023 : 0 | |
1024 -> 2047 : 0 | |
2048 -> 4095 : 0 | |
4096 -> 8191 : 0 | |
8192 -> 16383 : 0 | |
16384 -> 32767 : 0 | |
32768 -> 65535 : 0 | |
65536 -> 131071 : 13 |****** |
131072 -> 262143 : 1 | |
operation = 'open'
usecs : count distribution
0 -> 1 : 0 | |
2 -> 3 : 2 |****************************************|
This output shows a bimodal distribution for read latency, with a faster
mode of around 5 thousand reads that took between 4 and 15 microseconds, and a
slower mode of 1256 reads that took between 512 and 1023 microseconds. It's
likely that the faster mode was a hit from the in-memory file system cache,
and the slower mode is a read from a storage device (disk).
The write latency is also bimodal, with a faster mode between 128 and 511 us,
and the slower mode between 65 and 131 ms.
This "latency" is measured from when the operation was issued from the VFS
interface to the file system (via the ZFS POSIX layer), to when it completed.
This spans everything: block device I/O (disk I/O), file system CPU cycles,
file system locks, run queue latency, etc. This is a better measure of the
latency suffered by applications reading from the file system than measuring
this down at the block device interface.
Note that this only traces the common file system operations previously
listed: other file system operations (eg, inode operations including
getattr()) are not traced.
An optional interval and a count can be provided, as well as -m to show the
distributions in milliseconds. For example:
# ./zfsdist 1 5
Tracing ZFS operation latency... Hit Ctrl-C to end.
06:55:41:
operation = 'read'
usecs : count distribution
0 -> 1 : 0 | |
2 -> 3 : 0 | |
4 -> 7 : 3976 |****************************************|
8 -> 15 : 1181 |*********** |
16 -> 31 : 18 | |
32 -> 63 : 4 | |
64 -> 127 : 17 | |
128 -> 255 : 16 | |
256 -> 511 : 0 | |
512 -> 1023 : 1275 |************ |
1024 -> 2047 : 36 | |
2048 -> 4095 : 3 | |
4096 -> 8191 : 0 | |
8192 -> 16383 : 1 | |
16384 -> 32767 : 1 | |
06:55:42:
operation = 'read'
usecs : count distribution
0 -> 1 : 0 | |
2 -> 3 : 0 | |
4 -> 7 : 12751 |****************************************|
8 -> 15 : 1190 |*** |
16 -> 31 : 38 | |
32 -> 63 : 7 | |
64 -> 127 : 85 | |
128 -> 255 : 47 | |
256 -> 511 : 0 | |
512 -> 1023 : 1010 |*** |
1024 -> 2047 : 49 | |
2048 -> 4095 : 12 | |
06:55:43:
operation = 'read'
usecs : count distribution
0 -> 1 : 0 | |
2 -> 3 : 0 | |
4 -> 7 : 80925 |****************************************|
8 -> 15 : 1645 | |
16 -> 31 : 251 | |
32 -> 63 : 24 | |
64 -> 127 : 16 | |
128 -> 255 : 12 | |
256 -> 511 : 0 | |
512 -> 1023 : 80 | |
1024 -> 2047 : 1 | |
06:55:44:
operation = 'read'
usecs : count distribution
0 -> 1 : 0 | |
2 -> 3 : 0 | |
4 -> 7 : 81207 |****************************************|
8 -> 15 : 2075 |* |
16 -> 31 : 2005 | |
32 -> 63 : 177 | |
64 -> 127 : 3 | |
06:55:45:
operation = 'read'
usecs : count distribution
0 -> 1 : 0 | |
2 -> 3 : 0 | |
4 -> 7 : 74364 |****************************************|
8 -> 15 : 865 | |
16 -> 31 : 4960 |** |
32 -> 63 : 625 | |
64 -> 127 : 2 | |
This workload was randomly reading from a file that became cached. The slower
mode can be seen to disappear by the final summaries.
USAGE message:
# ./zfsdist -h
usage: zfsdist [-h] [-T] [-m] [-p PID] [interval] [count]
Summarize ZFS operation latency
positional arguments:
interval output interval, in seconds
count number of outputs
optional arguments:
-h, --help show this help message and exit
-T, --notimestamp don't include timestamp on interval output
-m, --milliseconds output in milliseconds
-p PID, --pid PID trace this PID only
examples:
./zfsdist # show operation latency as a histogram
./zfsdist -p 181 # trace PID 181 only
./zfsdist 1 10 # print 1 second summaries, 10 times
./zfsdist -m 5 # 5s summaries, milliseconds
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/Dmi-compute/bcc.git
git@gitee.com:Dmi-compute/bcc.git
Dmi-compute
bcc
bcc
master

搜索帮助