Yabin Cui | 76769e5 | 2015-07-13 12:23:54 -0700 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (C) 2015 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 | |
| 17 | #ifndef SIMPLE_PERF_PERF_REGS_H_ |
| 18 | #define SIMPLE_PERF_PERF_REGS_H_ |
| 19 | |
| 20 | #include <asm-x86/asm/perf_regs.h> |
| 21 | #include <asm-arm/asm/perf_regs.h> |
| 22 | #define perf_event_arm_regs perf_event_arm64_regs |
| 23 | #include <asm-arm64/asm/perf_regs.h> |
| 24 | #include <stdint.h> |
| 25 | #include <string> |
| 26 | |
| 27 | enum ArchType { |
| 28 | ARCH_X86_32, |
| 29 | ARCH_X86_64, |
| 30 | ARCH_ARM, |
| 31 | ARCH_ARM64, |
| 32 | }; |
| 33 | |
| 34 | ArchType GetCurrentArch(); |
| 35 | bool SetCurrentArch(const std::string& arch); |
| 36 | |
| 37 | uint64_t GetSupportedRegMask(); |
| 38 | |
| 39 | std::string GetRegName(size_t reg); |
| 40 | |
| 41 | #endif // SIMPLE_PERF_PERF_REGS_H_ |