1 /* 2 * Copyright (c) 2016 Facebook, Inc. 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 #ifndef LIBBCC_PERF_MAP_H 17 #define LIBBCC_PERF_MAP_H 18 19 #ifdef __cplusplus 20 extern "C" { 21 #endif 22 23 #include <stdint.h> 24 #include <stdbool.h> 25 #include <unistd.h> 26 27 // Symbol name, start address, length, payload 28 typedef int (*bcc_perf_map_symcb)(const char *, uint64_t, uint64_t, void *); 29 30 bool bcc_is_perf_map(const char *path); 31 bool bcc_is_valid_perf_map(const char *path); 32 33 int bcc_perf_map_nstgid(int pid); 34 bool bcc_perf_map_path(char *map_path, size_t map_len, int pid); 35 int bcc_perf_map_foreach_sym(const char *path, bcc_perf_map_symcb callback, 36 void* payload); 37 38 #ifdef __cplusplus 39 } 40 #endif 41 #endif 42