perf .data 有信息(大小)但似乎是空的

问题描述 投票:0回答:0

有一个我正在运行 perf 的安卓设备。我有时会运行长达一个小时的测试,在运行 stressapptest 时跟踪 cpu 容量和 cpu 频率。从 .data 到 .txt 的转换似乎很随意,或者只是查看数据。有时我会得到一个大文本文件,这正是我想要的。其他时候我会得到一个大小为 0 的空白文本文件。我提到了 stressapptest,但这个问题并不是该程序独有的。

我通过串行连接运行它。我首先删除旧文件(旧的 stressapptest 日志、旧的 perf .data 文件和 .txt 文件)。 Perf & stressapptest 在后台运行,带符号。

rm -f STRESS.txt ; rm -f perf_record.data ; rm -f perf_record.txt ; /vendor/sbin/perf record -e power:cpu_capacity,power:cpu_frequency -a -o perf_record.data -v & stressapptest -s 3600 -M 1024 -v 20 -l STRESS.txt  &

在 stressapptest 通过/失败等之后运行的命令...

killall perf ; /vendor/sbin/perf script -i perf_record.data > perf_record.txt

这是我杀死它时 perf 吐出的一个例子,在我转换它之前,今天拿这个:

[ perf record: Woken up 409 times to write data ]
failed to write feature 2
failed to write feature 8
failed to write feature 9
failed to write feature 14
[ perf record: Captured and wrote 105.746 MB perf_record.data ]

如果不是转换,我选择只查看设备上的 .data 文件

/vendor/sbin/perf script -i perf_record.data

我没有输出。 .data 文件很大,但 .txt 文件正好是 0 字节。里面没有任何信息。如果我运行 perf script -D 来获取原始跟踪数据,我会得到很多。难以理解(对我来说)但这里有一个片段:

0 0 0x900 [0x60]: PERF_RECORD_MMAP -1/0: [0xffffff85936a8000(0x13000) @ 0]: x [a
th_rate_atheros]                                                                
                                                                                
0x960 [0x58]: event: 1                                                          
.                                                                               
. ... raw event: size 88 bytes                                                  
.  0000:  01 00 00 00 01 00 58 00 ff ff ff ff 00 00 ^C34m 00 00 00 00 00 00  ].a
thero........                                                                   
.  0040:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................     
.  0050:  00 00 00 00 00 00 00 00                          ........             
                                  

我还看到我可以提供一个 -d 参数来进入调试模式。如果它能收集到更多关于录音的信息,我可以试试。我已经多次运行同一系列的操作,正如我所说,我有时会得到一个带数据的文件,有时却没有。

谁能想到我的 .txt 文件是空白的原因?

ubuntu perf stress-testing
© www.soinside.com 2019 - 2024. All rights reserved.