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 | |
Hridya Valsaraju | d833379 | 2016-08-09 10:05:20 -0700 | [diff] [blame] | 17 | package android.hardware.benchmarks.msgq@1.0; |
| 18 | |
| 19 | interface IBenchmarkMsgQ { |
Hridya Valsaraju | 9d9672c | 2016-09-21 17:47:06 -0700 | [diff] [blame] | 20 | /* |
| 21 | * This method requests the service to set up Synchronous read/write |
| 22 | * wait-free FMQ with the client as reader. |
| 23 | * @return ret Will be 0 if the setup is successful. |
| 24 | * @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() |
| 28 | generates(int32_t ret, MQDescriptorSync mqDescIn); |
| 29 | |
| 30 | /* |
| 31 | * This method requests the service to set up Synchronous read/write |
| 32 | * wait-free FMQ with the client as writer. |
| 33 | * @return Will be 0 if the setup is successful. |
| 34 | * @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() |
| 38 | generates(int32_t ret, MQDescriptorSync mqDescOut); |
| 39 | |
| 40 | /* |
| 41 | * This method request the service to write into the FMQ. |
| 42 | * @param count Number to messages to write. |
| 43 | * @ret Number of messages succesfully written. |
| 44 | */ |
| 45 | requestWrite(int32_t count) generates (int32_t ret); |
| 46 | |
| 47 | /* |
| 48 | * This method request the service to read from the FMQ. |
| 49 | * @param count Number to messages to read. |
| 50 | * @ret Number of messages succesfully read. |
| 51 | */ |
| 52 | requestRead(int32_t count) generates (int32_t ret); |
| 53 | |
| 54 | /* |
| 55 | * This method kicks off a benchmarking experiment where |
| 56 | * the client writes a message into its outbox FMQ, |
| 57 | * the service reads it and writes it into the client's |
| 58 | * inbox FMQ and the client reads the message. |
| 59 | * The average time taken for the experiment is measured. |
| 60 | * @param numIter The number of iterations to run the experiment. |
| 61 | */ |
| 62 | benchmarkPingPong(uint32_t numIter); |
| 63 | |
| 64 | /* |
| 65 | * This method kicks off a benchmarking experiment where |
| 66 | * the service writes into an FMQ and the client reads the same. |
| 67 | * @param numIter The number of iterations to run the experiment. |
| 68 | */ |
| 69 | benchmarkServiceWriteClientRead(uint32_t numIter); |
| 70 | |
| 71 | /* |
| 72 | * This method sends a vector of time duration(in ns). |
| 73 | * @param timeData vector of time instants measured by client. |
| 74 | * Each entry is the number of ns between the epoch and a |
| 75 | * std::chrono::time_point. |
| 76 | */ |
| 77 | sendTimeData(vec<int64_t> timeData); |
Hridya Valsaraju | d833379 | 2016-08-09 10:05:20 -0700 | [diff] [blame] | 78 | }; |