- 论坛徽章:
- 0
|
回复 8# amarant
那看来你的环境上正常情况是可以的喽?你是ubuntu吧,,,,
>./test &
[1] 71965
>sudo perf stat -p 71965
root's password:
usage: perf stat [<options>] <command>
-e, --event <event> event selector. use 'perf list' to list available events
-i, --inherit child tasks inherit counters
-p, --pid <n> stat events on existing pid
-a, --all-cpus system-wide collection from all CPUs
-c, --scale scale/normalize counters
-v, --verbose be more verbose (show counter open errors, etc)
-r, --repeat <n> repeat command and print average + stddev (max: 100)
-n, --null null run - dont start any counters
>ps -ef | grep 71965
seecdq 71965 62071 0 14:22 pts/10 00:00:00 ./test
seecdq 75416 62071 0 14:22 pts/10 00:00:00 grep 71965
|
|