First you need to get a list of events using perf list . I have no experience with Android, so if you can, please show the most interesting part of this list.
1) -c will be the countdown of the event between samples. (only the count'th event is counted, 1 is the selection, and 100000 is the selection of each 100000th event). if there is an event for cpu tick (smth like TSC), then counting the number of ticks, and I recommend that you set the sample to run no more than 1 millisecond. To get the number of tags, use the formula: CPU_Freq_in_MHz * 1000 . This is the number of events to receive a sample every milliseconds, for example. to use the 800 MHz processor and use the -c 800000 event.
For other events, you must evaluate how often they will do. If you do not know, you can start with the count value for ticks, and then check if enough samples have been collected. If not, reduce the score ten times and check again. An account for ticks will be safe, since the check mark is one of the most common events in any processor.
2) Good speed is different for different PMUs, which is selected with the option "-e" or "--event =". If the event is rare, no more than 1000 per second, you can even test every event. If the event looks like a cache miss, you should try several options, because a good value depends on the selected code. Too low a sampling rate will give you a small number of samples, and the results will not be reliable and noisy. But for too high speed, the results will also be tagged, because each PMU can affect the program being tracked. I recommend that you use no more than 1000 events per second on average.
source share