blob: c9fcf77a719034401d8ec6912abae2d05509e360 [file] [log] [blame]
Steven Moreland61651882016-08-11 12:52:43 -07001package android.hardware.tests.foo@1.0;
2
Iliyan Malcheve96606a2016-08-13 23:05:56 -07003//import IFoo;
4
Steven Moreland61651882016-08-11 12:52:43 -07005interface IFooCallback {
Iliyan Malcheve96606a2016-08-13 23:05:56 -07006 //heyItsMe(IFoo cb);
7 heyItsYou(IFooCallback cb);
Iliyan Malchev614bb722016-08-14 13:37:02 -07008 heyItsYouIsntIt(IFooCallback cb) generates (bool yesOrNo);
Iliyan Malcheve96606a2016-08-13 23:05:56 -07009 oneway heyItsTheMeaningOfLife(uint8_t tmol);
Iliyan Malchevb9c08202016-08-20 16:44:50 -070010
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 Moreland61651882016-08-11 12:52:43 -070037};