Home | History | Annotate | only in /system/extras/perfprofd/tests
Up to higher level directory
NameDateSize
Android.bp21-Aug-20181.2K
AndroidTest.xml21-Aug-20181.4K
callchain.canned.perf.data21-Aug-2018250.4K
canned.perf.data21-Aug-20181.3M
perfprofd_test.cc21-Aug-201843.8K
perfprofdmockutils.cc21-Aug-20182.1K
perfprofdmockutils.h21-Aug-2018974
README.txt21-Aug-20182K

README.txt

      1 Native tests for 'perfprofd'. Please run with
      2 
      3    runtest --path=system/extras/perfprofd/tests
      4 
      5 (where runtest == $ANDROID_BUILD_TOP"/development/testrunner/runtest.py).
      6 
      7 Notes:
      8 
      9 1. Several of the testpoints in this unit tests perform a live 'simpleperf'
     10 run on the device (if you are using a userdebug build, simpleperf should
     11 already be available in /system/xbin/simpleperf).
     12 
     13 2. Part of the test is a system-wide profile, meaning that you will
     14 need to run 'adb root' prior to test execution.
     15 
     16 3. The daemon under test, perfprofd, is broken into a main function, a
     17 "core" library, and a "utils library. Picture:
     18 
     19 	+-----------+   perfprofdmain.o
     20 	| perfprofd |
     21 	| main()    |   1-liner; calls perfprofd_main()
     22 	+-----------+
     23 	   |
     24 	   v
     25 	+-----------+   perfprofdcore.a
     26 	| perfprofd |
     27 	| core      |   most of the interesting code is here;
     28 	|           |   calls into utils library when for
     29 	+-----------+   operations such as sleep, log, etc
     30 	   |
     31 	   v
     32 	+-----------+   perfprofdutils.a
     33 	| perfprofd |
     34 	| utils     |   real implementations of perfprofd_sleep,
     35 	|           |   perfprofd_log_* etc
     36 	+-----------+
     37 
     38 Because the daemon tends to spend a lot of time sleeping/waiting,
     39 it is impractical to try to test it directly. Instead we insert a
     40 mock utilities layer and then have a test driver that invokes the
     41 daemon main function. Picture for perfprofd_test:
     42 
     43 	+----------------+   perfprofd_test.cc
     44 	| perfprofd_test |
     45 	|                |   makes calls into perfprofd_main(),
     46 	+----------------+   then verifies behavior
     47 	   |
     48 	   v
     49 	+-----------+   perfprofdcore.a
     50 	| perfprofd |
     51 	| core      |   same as above
     52 	+-----------+
     53 	   |
     54 	   v
     55 	+-----------+   perfprofdmockutils.a
     56 	| perfprofd |
     57 	| mockutils |   mock implementations of perfprofd_sleep,
     58 	|           |   perfprofd_log_* etc
     59 	+-----------+
     60 
     61 The mockup versions of perfprofd_sleep() and  perfprofd_log_* do
     62 simply log the fact that they are called; the test driver can
     63 then examine the log to make sure that the daemon is doing
     64 what it is supposed to be doing.
     65