blob: 6640338b25947948b26cf8e415e9571923591c3e [file] [log] [blame]
Martijn Coenencbe590c2016-08-30 11:27:56 -07001/*
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 Moreland61651882016-08-11 12:52:43 -070017package android.hardware.tests.foo@1.0;
18
Iliyan Malcheve96606a2016-08-13 23:05:56 -070019//import IFoo;
20
Steven Moreland61651882016-08-11 12:52:43 -070021interface IFooCallback {
Iliyan Malcheve96606a2016-08-13 23:05:56 -070022 //heyItsMe(IFoo cb);
23 heyItsYou(IFooCallback cb);
Iliyan Malchev614bb722016-08-14 13:37:02 -070024 heyItsYouIsntIt(IFooCallback cb) generates (bool yesOrNo);
Iliyan Malcheve96606a2016-08-13 23:05:56 -070025 oneway heyItsTheMeaningOfLife(uint8_t tmol);
Iliyan Malchevb9c08202016-08-20 16:44:50 -070026
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 Moreland61651882016-08-11 12:52:43 -070053};