Martijn Coenen | cbe590c | 2016-08-30 11:27:56 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2016 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Steven Moreland | 6165188 | 2016-08-11 12:52:43 -0700 | [diff] [blame] | 17 | package android.hardware.tests.foo@1.0; |
| 18 | |
Iliyan Malchev | e96606a | 2016-08-13 23:05:56 -0700 | [diff] [blame] | 19 | //import IFoo; |
| 20 | |
Steven Moreland | 6165188 | 2016-08-11 12:52:43 -0700 | [diff] [blame] | 21 | interface IFooCallback { |
Iliyan Malchev | e96606a | 2016-08-13 23:05:56 -0700 | [diff] [blame] | 22 | //heyItsMe(IFoo cb); |
| 23 | heyItsYou(IFooCallback cb); |
Iliyan Malchev | 614bb72 | 2016-08-14 13:37:02 -0700 | [diff] [blame] | 24 | heyItsYouIsntIt(IFooCallback cb) generates (bool yesOrNo); |
Iliyan Malchev | e96606a | 2016-08-13 23:05:56 -0700 | [diff] [blame] | 25 | oneway heyItsTheMeaningOfLife(uint8_t tmol); |
Iliyan Malchev | b9c0820 | 2016-08-20 16:44:50 -0700 | [diff] [blame] | 26 | |
| 27 | // The next two methods are for instrumentation purposes. |
| 28 | |
| 29 | // Block the caller for up to ns nanosesonds and return the number |
| 30 | // of nanoseconds it took to invoke each of the three methods |
| 31 | // above, both from the point of view of the caller (callerBlockedNs) and |
| 32 | // from the point of view of IFooCallback itself (timeNs). timeNs measures |
| 33 | // how long a method's body took to execute, regardless of whether the |
| 34 | // method was oneway or two-way. callerBlockedNs reflects the amount of |
| 35 | // time the caller was blocked before the method returned. For two-way |
| 36 | // methods, callerBlockedNs should be slightly higher than timeNs. For |
| 37 | // one-way calls, callerBlockedNs will be very low, and unrelated to |
| 38 | // timeNs. |
| 39 | |
| 40 | struct InvokeInfo { |
| 41 | bool invoked; |
| 42 | int64_t callerBlockedNs; |
| 43 | int64_t timeNs; |
| 44 | }; |
| 45 | reportResults(int64_t ns) generates (int64_t leftNs, InvokeInfo[3] invokeInfo); |
| 46 | |
| 47 | // This method is used by the caller of IFooCallback to tell IFooCallback |
| 48 | // how long the three methods above took, from the point of view of that |
| 49 | // caller. IFooCallback adds this information to the one reported by |
| 50 | // reportResults in InvokeInfo. |
| 51 | |
| 52 | youBlockedMeFor(int64_t[3] callerBlockedInfo); |
Steven Moreland | 6165188 | 2016-08-11 12:52:43 -0700 | [diff] [blame] | 53 | }; |