Steven Moreland | 6165188 | 2016-08-11 12:52:43 -0700 | [diff] [blame] | 1 | package android.hardware.tests.foo@1.0; |
| 2 | |
Iliyan Malchev | e96606a | 2016-08-13 23:05:56 -0700 | [diff] [blame] | 3 | //import IFoo; |
| 4 | |
Steven Moreland | 6165188 | 2016-08-11 12:52:43 -0700 | [diff] [blame] | 5 | interface IFooCallback { |
Iliyan Malchev | e96606a | 2016-08-13 23:05:56 -0700 | [diff] [blame] | 6 | //heyItsMe(IFoo cb); |
| 7 | heyItsYou(IFooCallback cb); |
Iliyan Malchev | 614bb72 | 2016-08-14 13:37:02 -0700 | [diff] [blame] | 8 | heyItsYouIsntIt(IFooCallback cb) generates (bool yesOrNo); |
Iliyan Malchev | e96606a | 2016-08-13 23:05:56 -0700 | [diff] [blame] | 9 | oneway heyItsTheMeaningOfLife(uint8_t tmol); |
Iliyan Malchev | b9c0820 | 2016-08-20 16:44:50 -0700 | [diff] [blame^] | 10 | |
| 11 | // The next two methods are for instrumentation purposes. |
| 12 | |
| 13 | // Block the caller for up to ns nanosesonds and return the number |
| 14 | // of nanoseconds it took to invoke each of the three methods |
| 15 | // above, both from the point of view of the caller (callerBlockedNs) and |
| 16 | // from the point of view of IFooCallback itself (timeNs). timeNs measures |
| 17 | // how long a method's body took to execute, regardless of whether the |
| 18 | // method was oneway or two-way. callerBlockedNs reflects the amount of |
| 19 | // time the caller was blocked before the method returned. For two-way |
| 20 | // methods, callerBlockedNs should be slightly higher than timeNs. For |
| 21 | // one-way calls, callerBlockedNs will be very low, and unrelated to |
| 22 | // timeNs. |
| 23 | |
| 24 | struct InvokeInfo { |
| 25 | bool invoked; |
| 26 | int64_t callerBlockedNs; |
| 27 | int64_t timeNs; |
| 28 | }; |
| 29 | reportResults(int64_t ns) generates (int64_t leftNs, InvokeInfo[3] invokeInfo); |
| 30 | |
| 31 | // This method is used by the caller of IFooCallback to tell IFooCallback |
| 32 | // how long the three methods above took, from the point of view of that |
| 33 | // caller. IFooCallback adds this information to the one reported by |
| 34 | // reportResults in InvokeInfo. |
| 35 | |
| 36 | youBlockedMeFor(int64_t[3] callerBlockedInfo); |
Steven Moreland | 6165188 | 2016-08-11 12:52:43 -0700 | [diff] [blame] | 37 | }; |