本文主要是介绍5.117 BCC工具之xfsdist.py解读,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
一,工具简介
xfsdist 追踪 XFS 的读取、写入、打开和 fsyncs 操作,并将其延迟以 2 的幂次直方图的形式进行总结。例如:
二,代码示例
#!/usr/bin/env pythonfrom __future__ import print_function
from bcc import BPF
from time import sleep, strftime
import argparse# arguments
examples = """examples:./xfsdist # show operation latency as a histogram./xfsdist -p 181 # trace PID 181 only./xfsdist 1 10 # print 1 second summaries, 10 times./xfsdist -m 5 # 5s summaries, milliseconds
"""
parser = argparse.ArgumentParser(description="Summarize XFS operation latency",formatter_class=argparse.RawDescriptionHelpFormatter,epilog=examples)
parser.add_argument("-T", "--notimestamp", action="store_true",help="don't include timestamp on interval output")
parser.add_argument("-m", "--milliseconds", action="sto
这篇关于5.117 BCC工具之xfsdist.py解读的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!