Simpleperf to Access the PMU on the Hikey960 board


#1

I would like to access the HPC counters using the simpleperf command for all the processes running in the system parallely.

For linux OS , this script works

#!/bin/sh
#set -x
ps -ef | awk ‘{printf($2)"\n";}’ > out.txt
sed ‘1d’ out.txt > tmp

IFS=$’\n’

while read tmp
do

3>results-$tmp perf stat -p $tmp --log-fd 3 sleep 5 > /dev/null &
done <tmp

But since the Hikey960 has Android OS, I have replaced the line

3>results-$tmp perf stat -p $tmp --log-fd 3 sleep 5 > /dev/null &
done <tmp

with

3>results-$tmp simpleperf stat -p $tmp --log-fd 3 sleep 5 > /dev/null &
done <tmp

.But the flags --logfd , do not work for simpleperf.

The flags used for perf are different from the flags used for simpleperf.
Can anyone suggest a way to access the PMU for all the processes parallely by the simpleperf command.


#2

why not using -o option ?

simpleperf stat -p $tmp -o results-$tmp....

https://developer.android.com/ndk/guides/simpleperf-commands.html