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, or NULL 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 by providerInit(), a name and any number of ArgType_t (you must pass the actual number of arguments as argCount). It will then create a SDTProbe_t with all attributes correctly initialized and register it to the given SDTProvider_t. The return would be a pointer to the created SDTProbe_t, or NULL 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:
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 be 0 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:
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 registered SDTProbe_t created with providerAddProbe().

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, or 0 otherwise.

Parameters:
Returns:

1 if probe is enabled, 0 otherwise

Return type:

int