Xinliang David Li | f556a7e | 2015-10-13 18:40:00 +0000 | [diff] [blame^] | 1 | /*===- InstrProfilingPlatformLinux.c - Profile data Linux platform ------===*\ |
| 2 | |* |
| 3 | |* The LLVM Compiler Infrastructure |
| 4 | |* |
| 5 | |* This file is distributed under the University of Illinois Open Source |
| 6 | |* License. See LICENSE.TXT for details. |
| 7 | |* |
| 8 | \*===----------------------------------------------------------------------===*/ |
| 9 | |
| 10 | #include "InstrProfiling.h" |
| 11 | |
| 12 | #if defined(__linux__) |
| 13 | #include <stdlib.h> |
| 14 | |
| 15 | extern __llvm_profile_data __start___llvm_prf_data |
| 16 | __attribute__((visibility("hidden"))); |
| 17 | extern __llvm_profile_data __stop___llvm_prf_data |
| 18 | __attribute__((visibility("hidden"))); |
| 19 | extern uint64_t __start___llvm_prf_cnts __attribute__((visibility("hidden"))); |
| 20 | extern uint64_t __stop___llvm_prf_cnts __attribute__((visibility("hidden"))); |
| 21 | extern char __start___llvm_prf_names __attribute__((visibility("hidden"))); |
| 22 | extern char __stop___llvm_prf_names __attribute__((visibility("hidden"))); |
| 23 | |
| 24 | __attribute__((visibility("hidden"))) const __llvm_profile_data * |
| 25 | __llvm_profile_begin_data(void) { |
| 26 | return &__start___llvm_prf_data; |
| 27 | } |
| 28 | __attribute__((visibility("hidden"))) const __llvm_profile_data * |
| 29 | __llvm_profile_end_data(void) { |
| 30 | return &__stop___llvm_prf_data; |
| 31 | } |
| 32 | __attribute__((visibility("hidden"))) const char *__llvm_profile_begin_names( |
| 33 | void) { |
| 34 | return &__start___llvm_prf_names; |
| 35 | } |
| 36 | __attribute__((visibility("hidden"))) const char *__llvm_profile_end_names( |
| 37 | void) { |
| 38 | return &__stop___llvm_prf_names; |
| 39 | } |
| 40 | __attribute__((visibility("hidden"))) uint64_t *__llvm_profile_begin_counters( |
| 41 | void) { |
| 42 | return &__start___llvm_prf_cnts; |
| 43 | } |
| 44 | __attribute__((visibility("hidden"))) uint64_t *__llvm_profile_end_counters( |
| 45 | void) { |
| 46 | return &__stop___llvm_prf_cnts; |
| 47 | } |
| 48 | #endif |