Functions¶
-
SDTProvider_t *
providerInit
(const char *name)¶ This function received a name as argument, creates a
SDTProvider_t
with all attributes correctly initialized and then returns a pointer to it, orNULL
if there was an error.Parameters: - name (string) – The name of this provider
Returns: A pointer to the new provider
Return type: SDTProvider_t*
-
SDTProbe_t *
providerAddProbe
(SDTProvider_t *provider, const char *name, int argCount, ...)¶ This function received a
SDTProvider_t
created byproviderInit()
, a name and any number ofArgType_t
(you must pass the actual number of arguments as argCount). It will then create aSDTProbe_t
with all attributes correctly initialized and register it to the givenSDTProvider_t
. The return would be a pointer to the createdSDTProbe_t
, orNULL
if there was an error.Parameters: - provider (SDTProvider_t*) – The provider where this probe will be created
- name (string) – The name of this probe
- argCount (int) – The number of arguments accepted by this probe
- ... (SDTArgTypes_t) – Any number of arguments (number of arguments must match argCount)
Returns: A pointer to the new provider
Return type: SDTProbe_t*
-
int
providerLoad
(SDTProvider_t *provider)¶ When you created all probes you wanted, you should call this function to load the provider correctly. The returning value will be
0
if everything went well, or another number otherwise.After calling this function, all probes will be efectively available for tracing, and you shouldn’t add new probes or load this provider again.
Parameters: - provider (SDTProvider_t*) – The provider to be loaded
Returns: A status code (
0
means success, other numbers indicates error)Return type: int
-
int
providerUnload
(SDTProvider_t *provider)¶ Once you don’t want your probes to be available anymore, you can call this function. This will clean-up everything that
providerLoad()
did. The returning value will be0
if everything went well, or another number otherwise.After calling this function all probes will be unavailable for tracing, and you can add new probes to the provider again.
Parameters: - provider (SDTProvider_t*) – The provider to be unloaded
Returns: A status code (
0
means success, other numbers indicates error)Return type: int
-
void
providerDestroy
(SDTProvider_t *provider)¶ This function frees a
SDTProvider_t
from memory, along with all registeredSDTProbe_t
created withproviderAddProbe()
.Parameters: - provider (SDTProvider_t*) – The provider to be freed from memory, along with it’s probes
-
void
probeFire
(SDTProbe_t *probe, ...)¶ This function fires a probe if it’s available for tracing (which means it will only fire the probe if
providerLoad()
was called before).Parameters: - probe (SDTProbe_t*) – The probe to be fired
- ... (any) – Any number of arguments (must match the expected number of arguments for this probe)
-
int
probeIsEnabled
(SDTProbe_t *probe)¶ This function returns
1
if the probe is being traced, or0
otherwise.Parameters: - probe (SDTProbe_t*) – The probe to be checked
Returns: 1
if probe is enabled,0
otherwiseReturn type: int