blob: c4b9d95ebc6099db0afb966d63765380f97365d7 [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
Hridya Valsarajud8333792016-08-09 10:05:20 -070017package android.hardware.benchmarks.msgq@1.0;
18
19interface IBenchmarkMsgQ {
Hridya Valsaraju9d9672c2016-09-21 17:47:06 -070020 /*
21 * This method requests the service to set up Synchronous read/write
22 * wait-free FMQ with the client as reader.
Hridya Valsaraju954515f2016-09-27 13:43:57 -070023 * @return ret Will be true if the setup was successful, false otherwise.
Hridya Valsaraju9d9672c2016-09-21 17:47:06 -070024 * @return mqDescIn This structure describes the FMQ that was set up
25 * by the service. Client can use it to set up the FMQ at its end.
26 */
27 configureClientInboxSyncReadWrite()
Hridya Valsaraju33351da2016-12-27 12:40:01 -080028 generates(bool ret, fmq_sync<uint8_t> mqDescIn);
Hridya Valsaraju9d9672c2016-09-21 17:47:06 -070029
30 /*
31 * This method requests the service to set up Synchronous read/write
32 * wait-free FMQ with the client as writer.
Hridya Valsaraju954515f2016-09-27 13:43:57 -070033 * @return ret Will be true if the setup was successful, false otherwise.
Hridya Valsaraju9d9672c2016-09-21 17:47:06 -070034 * @return mqDescOut This structure describes the FMQ that was set up
35 * by the service. Client can use it to set up the FMQ at its end.
36 */
37 configureClientOutboxSyncReadWrite()
Hridya Valsaraju33351da2016-12-27 12:40:01 -080038 generates(bool ret, fmq_sync<uint8_t> mqDescOut);
Hridya Valsaraju9d9672c2016-09-21 17:47:06 -070039
40 /*
41 * This method request the service to write into the FMQ.
42 * @param count Number to messages to write.
Hridya Valsaraju954515f2016-09-27 13:43:57 -070043 * @return ret Will be true if the write operation was successful,
44 * false otherwise.
Hridya Valsaraju9d9672c2016-09-21 17:47:06 -070045 */
Hridya Valsaraju954515f2016-09-27 13:43:57 -070046 requestWrite(int32_t count) generates (bool ret);
Hridya Valsaraju9d9672c2016-09-21 17:47:06 -070047
48 /*
49 * This method request the service to read from the FMQ.
50 * @param count Number to messages to read.
Hridya Valsaraju954515f2016-09-27 13:43:57 -070051 * @ret Will be true if the read operation was successful, false otherwise.
Hridya Valsaraju9d9672c2016-09-21 17:47:06 -070052 */
Hridya Valsaraju954515f2016-09-27 13:43:57 -070053 requestRead(int32_t count) generates (bool ret);
Hridya Valsaraju9d9672c2016-09-21 17:47:06 -070054
55 /*
56 * This method kicks off a benchmarking experiment where
57 * the client writes a message into its outbox FMQ,
58 * the service reads it and writes it into the client's
59 * inbox FMQ and the client reads the message.
60 * The average time taken for the experiment is measured.
61 * @param numIter The number of iterations to run the experiment.
62 */
63 benchmarkPingPong(uint32_t numIter);
64
65 /*
66 * This method kicks off a benchmarking experiment where
67 * the service writes into an FMQ and the client reads the same.
68 * @param numIter The number of iterations to run the experiment.
69 */
70 benchmarkServiceWriteClientRead(uint32_t numIter);
71
72 /*
73 * This method sends a vector of time duration(in ns).
74 * @param timeData vector of time instants measured by client.
75 * Each entry is the number of ns between the epoch and a
76 * std::chrono::time_point.
77 */
78 sendTimeData(vec<int64_t> timeData);
Hridya Valsarajud8333792016-08-09 10:05:20 -070079};