HawkTracer  0.9.0
string_scoped_tracepoint.h File Reference
#include <hawktracer/ht_config.h>
#include <hawktracer/scoped_tracepoint.h>
#include <hawktracer/feature_cached_string.h>

Go to the source code of this file.

Macros

#define HT_TP_STRACEPOINT(timeline, label)
 Creates a tracepoint that measures time spent in the scope. More...
 
#define HT_TP_DYN_STRACEPOINT(timeline, label)   HT_TP_SCOPED_INT(timeline, (uintptr_t)ht_feature_cached_string_add_mapping_dynamic(timeline, label));
 Creates a tracepoint that measures time spent in the scope. More...
 
#define HT_TP_FUNCTION(timeline)   HT_TP_STRACEPOINT(timeline, __func__)
 Generates a tracepoint that measures time spent in the function. More...
 

Macro Definition Documentation

◆ HT_TP_DYN_STRACEPOINT

#define HT_TP_DYN_STRACEPOINT (   timeline,
  label 
)    HT_TP_SCOPED_INT(timeline, (uintptr_t)ht_feature_cached_string_add_mapping_dynamic(timeline, label));

Creates a tracepoint that measures time spent in the scope.

This method is slower than HT_TP_STRACEPOINT(), but allows user to use dynamic strings for label.

Parameters
timelinea timeline where the event will be posted to.
labela string label of the tracepoint.

◆ HT_TP_FUNCTION

#define HT_TP_FUNCTION (   timeline)    HT_TP_STRACEPOINT(timeline, __func__)

Generates a tracepoint that measures time spent in the function.

The macro shoudl be called as a first instruction of the traced function.

Parameters
timelinea timeline where the event will be posted to.

◆ HT_TP_STRACEPOINT

#define HT_TP_STRACEPOINT (   timeline,
  label 
)
Value:
static HT_THREAD_LOCAL uintptr_t HT_UNIQUE_VAR_NAME(fnc_track) = ht_feature_cached_string_add_mapping(timeline, label); \
HT_TP_SCOPED_INT(timeline, (uintptr_t)HT_UNIQUE_VAR_NAME(fnc_track));
#define HT_UNIQUE_VAR_NAME(BASE_VAR_NAME)
Creates unique variable name by appending a line number to a base name.
Definition: macros.h:85
#define HT_THREAD_LOCAL
A thread storage duration.
Definition: macros.h:92
HT_API uintptr_t ht_feature_cached_string_add_mapping(HT_Timeline *timeline, const char *label)

Creates a tracepoint that measures time spent in the scope.

The label must be a static string. If it's not, use HT_TP_DYN_STRACEPOINT() instead.

Parameters
timelinea timeline where the event will be posted to.
labela string label of the tracepoint.