读取和解析perf.data [英] Read and parse perf.data
本文介绍了读取和解析perf.data的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用命令perf record来记录性能计数器frm linux.
I am recording a performance counters frm linux using the command perf record.
我想将结果perf.data
用作其他编程应用程序的输入.您知道如何读取和解析perf.data
中的数据吗?有没有办法将其转换为.text
文件或.csv
?
I want to use the result perf.data
as an input to other programming apps. Do you know how shall I read and parse the data in perf.data
? Is there a way to transform it to .text
file or .csv
?
推荐答案
下面显示了一个示例命令定义,该命令定义将服务检查性能数据重定向到文本文件,以供其他应用程序稍后处理:
An example command definition that redirects service check performance data to a text file for later processing by another application is shown below:
define command{
command_name store-service-perfdata
command_line /bin/echo -e "$LASTSERVICECHECK$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICESTATE$\t$SERVICEATTEMPT$\t$SERVICESTATETYPE$\t$SERVICEEXECUTIONTIME$\t$SERVICELATENCY$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$" >> /usr/local/nagios/var/service-perfdata.dat
}
这篇关于读取和解析perf.data的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文