1 #ifndef HAWKTRACER_STRING_SCOPED_TRACEPOINT_H 2 #define HAWKTRACER_STRING_SCOPED_TRACEPOINT_H 4 #include <hawktracer/ht_config.h> 18 #define HT_TP_STRACEPOINT(timeline, label) \ 19 static HT_THREAD_LOCAL uintptr_t HT_UNIQUE_VAR_NAME(fnc_track) = ht_feature_cached_string_add_mapping(timeline, label); \ 20 HT_TP_SCOPED_INT(timeline, (uintptr_t)HT_UNIQUE_VAR_NAME(fnc_track)); 22 #elif defined(HT_USE_PTHREADS) && defined(HT_SCOPED_TRACEPOINT_MACRO_ENABLED) 26 #define HT_TP_STRACEPOINT(timeline, label) \ 27 static HT_THREAD_LOCAL pthread_once_t HT_UNIQUE_VAR_NAME(ht_var_once) = PTHREAD_ONCE_INIT; \ 28 static HT_THREAD_LOCAL uintptr_t HT_UNIQUE_VAR_NAME(fnc_track) = label; \ 29 ht_pthread_mapped_tracepoint_enter(timeline, HT_UNIQUE_VAR_NAME(fnc_track)); \ 30 pthread_once(&HT_UNIQUE_VAR_NAME(ht_var_once), ht_pthread_mapped_tracepoint_add_mapping); \ 31 ht_pthread_mapped_tracepoint_leave(); \ 32 HT_TP_SCOPED_INT(timeline, (uintptr_t)HT_UNIQUE_VAR_NAME(fnc_track)); 44 #define HT_TP_DYN_STRACEPOINT(timeline, label) \ 45 HT_TP_SCOPED_INT(timeline, (uintptr_t)ht_feature_cached_string_add_mapping_dynamic(timeline, label)); 54 #define HT_TP_FUNCTION(timeline) \ 55 HT_TP_STRACEPOINT(timeline, __func__)
Stores a map of strings and their hash values.