I'm profiling a function within an app which is executed every 5 seconds. However, I only see half of the calls in the "Calls + Rec/Total" option in the trace view. I am using samplebased profiling with 1 microsecond as a sampling interval. I tried to play with this sampling rate but no visible improvements. For example, when I run the view for 236 seconds, I should get 47 calls in the "Call + Rec/Total" option, however, it shows only 20 as shown in the picture below. Can anyone comment what I am doing wrong ?
Tested devices:
Device 1: SmartWatch LG R (Android 6.0.1), observes this problem
Device 2: Samsung Galaxy S2 (Android 5.0.1 Custom ROM), observes this problem
Device 3: Samsung Galaxy S2 (Android 4.4, Custom ROM), works fine
UPDATE: I installed Android 4.4.4 on the second Samsung (originally with Android 5.1.1) based on my discussion with @kws and now the sampling-based method is working fine with it. However, the smartwatch with Android 6.0.1 is still behaving the old way with trace view.
Update 2: I think the sampling based method doesn't have the resolution to capture very lightweight functions because it could be that these functions are executed between two samples and it will be missed by this the profiler. Though it records data with microseconds as an sampling interval, I doubt that it can reach to such detailed granularity. The reasoning behind this argument is that when I tested a very lightweight function with it, and not every call was caught on all three devices.