我想在运行perf命令后保存结果, 例如。
perf stat -B dd if = / dev / zero of = / dev / null count = 1000000&> RESULT1
我尝试了几种方法,比如
(perf stat -B dd if=/dev/zero of=/dev/null count=1000000 &>result1) > result2
(perf stat -B dd if=/dev/zero of=/dev/null count=1000000 &>result1) 2> result2
(perf stat -B dd if=/dev/zero of=/dev/null count=1000000 &>result1) &> result2
((perf stat -B dd if=/dev/zero of=/dev/null count=1000000 &>result1) &> result2) > result3
好吧,这些都没有给我我想要的东西。
结果是
'dd if = enter code here
/ dev / zero of = / dev / null count = 1000000'的性能计数器统计信息:
235.959041 task-clock # 0.998 CPUs utilized
20 context-switches # 0.000 M/sec
.........(too long, dont want to have all of them here)
0.236448007 seconds time elapsed"
我只想将这些保存到文件中。
非常感谢!!!
答案 0 :(得分:2)
strace
显示perf
写入文件描述符0,所以这应该有效:
perf stat -B dd if=/dev/zero of=/dev/null count=1000000 0> result1