| 1 | /* |
| 2 | * ltt-facility-loader-user_tests.c |
| 3 | * |
| 4 | * (C) Copyright 2005 - |
| 5 | * Mathieu Desnoyers (mathieu.desnoyers@polymtl.ca) |
| 6 | * |
| 7 | * Contains the LTT user space facility loader. |
| 8 | * |
| 9 | */ |
| 10 | |
| 11 | |
| 12 | #define LTT_TRACE |
| 13 | #include <error.h> |
| 14 | #include <stdio.h> |
| 15 | #include <ltt/ltt-usertrace.h> |
| 16 | #include "ltt-facility-loader-user_tests.h" |
| 17 | |
| 18 | static struct user_facility_info facility = { |
| 19 | .name = LTT_FACILITY_NAME, |
| 20 | .num_events = LTT_FACILITY_NUM_EVENTS, |
| 21 | #ifndef LTT_PACK |
| 22 | .alignment = sizeof(void*), |
| 23 | #else |
| 24 | .alignment = 0, |
| 25 | #endif //LTT_PACK |
| 26 | .checksum = LTT_FACILITY_CHECKSUM, |
| 27 | .int_size = sizeof(int), |
| 28 | .long_size = sizeof(long), |
| 29 | .pointer_size = sizeof(void*), |
| 30 | .size_t_size = sizeof(size_t) |
| 31 | }; |
| 32 | |
| 33 | static void __attribute__((constructor)) __ltt_user_init(void) |
| 34 | { |
| 35 | int err; |
| 36 | #ifdef LTT_SHOW_DEBUG |
| 37 | printf("LTT : ltt-facility-user_tests init in userspace\n"); |
| 38 | #endif //LTT_SHOW_DEBUG |
| 39 | |
| 40 | err = ltt_register_generic(<T_FACILITY_SYMBOL, &facility); |
| 41 | LTT_FACILITY_CHECKSUM_SYMBOL = LTT_FACILITY_SYMBOL; |
| 42 | |
| 43 | if(err) { |
| 44 | #ifdef LTT_SHOW_DEBUG |
| 45 | perror("Error in ltt_register_generic"); |
| 46 | #endif //LTT_SHOW_DEBUG |
| 47 | } |
| 48 | } |
| 49 | |