1*387f9dfdSAndroid Build Coastguard Worker /* 2*387f9dfdSAndroid Build Coastguard Worker * Copyright (c) 2016 Facebook, Inc. 3*387f9dfdSAndroid Build Coastguard Worker * 4*387f9dfdSAndroid Build Coastguard Worker * Licensed under the Apache License, Version 2.0 (the "License"); 5*387f9dfdSAndroid Build Coastguard Worker * you may not use this file except in compliance with the License. 6*387f9dfdSAndroid Build Coastguard Worker * You may obtain a copy of the License at 7*387f9dfdSAndroid Build Coastguard Worker * 8*387f9dfdSAndroid Build Coastguard Worker * http://www.apache.org/licenses/LICENSE-2.0 9*387f9dfdSAndroid Build Coastguard Worker * 10*387f9dfdSAndroid Build Coastguard Worker * Unless required by applicable law or agreed to in writing, software 11*387f9dfdSAndroid Build Coastguard Worker * distributed under the License is distributed on an "AS IS" BASIS, 12*387f9dfdSAndroid Build Coastguard Worker * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13*387f9dfdSAndroid Build Coastguard Worker * See the License for the specific language governing permissions and 14*387f9dfdSAndroid Build Coastguard Worker * limitations under the License. 15*387f9dfdSAndroid Build Coastguard Worker */ 16*387f9dfdSAndroid Build Coastguard Worker #ifndef LIBBCC_PERF_MAP_H 17*387f9dfdSAndroid Build Coastguard Worker #define LIBBCC_PERF_MAP_H 18*387f9dfdSAndroid Build Coastguard Worker 19*387f9dfdSAndroid Build Coastguard Worker #ifdef __cplusplus 20*387f9dfdSAndroid Build Coastguard Worker extern "C" { 21*387f9dfdSAndroid Build Coastguard Worker #endif 22*387f9dfdSAndroid Build Coastguard Worker 23*387f9dfdSAndroid Build Coastguard Worker #include <stdint.h> 24*387f9dfdSAndroid Build Coastguard Worker #include <stdbool.h> 25*387f9dfdSAndroid Build Coastguard Worker #include <unistd.h> 26*387f9dfdSAndroid Build Coastguard Worker 27*387f9dfdSAndroid Build Coastguard Worker // Symbol name, start address, length, payload 28*387f9dfdSAndroid Build Coastguard Worker typedef int (*bcc_perf_map_symcb)(const char *, uint64_t, uint64_t, void *); 29*387f9dfdSAndroid Build Coastguard Worker 30*387f9dfdSAndroid Build Coastguard Worker bool bcc_is_perf_map(const char *path); 31*387f9dfdSAndroid Build Coastguard Worker bool bcc_is_valid_perf_map(const char *path); 32*387f9dfdSAndroid Build Coastguard Worker 33*387f9dfdSAndroid Build Coastguard Worker int bcc_perf_map_nstgid(int pid); 34*387f9dfdSAndroid Build Coastguard Worker bool bcc_perf_map_path(char *map_path, size_t map_len, int pid); 35*387f9dfdSAndroid Build Coastguard Worker int bcc_perf_map_foreach_sym(const char *path, bcc_perf_map_symcb callback, 36*387f9dfdSAndroid Build Coastguard Worker void* payload); 37*387f9dfdSAndroid Build Coastguard Worker 38*387f9dfdSAndroid Build Coastguard Worker #ifdef __cplusplus 39*387f9dfdSAndroid Build Coastguard Worker } 40*387f9dfdSAndroid Build Coastguard Worker #endif 41*387f9dfdSAndroid Build Coastguard Worker #endif 42