Connor O'Brien | 5733719 | 2018-11-20 12:49:16 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2018 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 | |
Connor O'Brien | d250acc | 2019-01-23 17:21:41 -0800 | [diff] [blame] | 17 | #pragma once |
| 18 | |
Connor O'Brien | 5733719 | 2018-11-20 12:49:16 -0800 | [diff] [blame] | 19 | #include <unordered_map> |
| 20 | #include <vector> |
| 21 | |
| 22 | namespace android { |
| 23 | namespace bpf { |
| 24 | |
Connor O'Brien | 26de80f | 2019-06-11 13:49:19 -0700 | [diff] [blame^] | 25 | bool startTrackingUidTimes(); |
Connor O'Brien | f03b6ae | 2019-06-05 18:03:12 -0700 | [diff] [blame] | 26 | std::optional<std::vector<std::vector<uint64_t>>> getUidCpuFreqTimes(uint32_t uid); |
| 27 | std::optional<std::unordered_map<uint32_t, std::vector<std::vector<uint64_t>>>> |
| 28 | getUidsCpuFreqTimes(); |
Connor O'Brien | 26de80f | 2019-06-11 13:49:19 -0700 | [diff] [blame^] | 29 | |
| 30 | struct concurrent_time_t { |
| 31 | std::vector<uint64_t> active; |
| 32 | std::vector<std::vector<uint64_t>> policy; |
| 33 | }; |
| 34 | |
| 35 | std::optional<concurrent_time_t> getUidConcurrentTimes(uint32_t uid, bool retry = true); |
| 36 | std::optional<std::unordered_map<uint32_t, concurrent_time_t>> getUidsConcurrentTimes(); |
| 37 | bool clearUidTimes(unsigned int uid); |
Connor O'Brien | 5733719 | 2018-11-20 12:49:16 -0800 | [diff] [blame] | 38 | |
| 39 | } // namespace bpf |
| 40 | } // namespace android |