#include <qtrc.h> int QtrcGetActiveLevel (const char *Component, unsigned int *Active_Level);Service Program Name: QTRCMGR
The QtrcGetActiveLevel() function retrieves the active trace level for the specified Component and places the result into the integer pointed to by Active_Level.
A successful call to the QtrcGetActiveLevel() function results in one of the following values for the Active_Level:
QTRC_LEVEL_NONE (0) | Trace is not active for the specified Component. |
QTRC_LEVEL_ERROR (1) | Trace level ERROR is active for the specified Component. |
QTRC_LEVEL_INFO (2) | Trace level INFO is active for the specified Component. |
QTRC_LEVEL_VERBOSE (3) | Trace level VERBOSE is active for the specified Component. |
If the specified Component is not defined to a trace collection, the Active_Level value is set to QTRC_LEVEL_NONE (0). Components are defined to a trace collection using the Start Trace (STRTRC) CL command.
A pointer to the null-terminated component name. The component name should be 10 characters in length or less. If more than 10 characters are specified, only the first 10 characters are used.
A pointer to the integer variable to receive the active trace level value.
None.
If QtrcGetActiveLevel() was not successful, the error condition returned usually indicates one of the following errors. Under some conditions, the value returned could indicate an error other than those listed here.
Error condition | Additional information |
---|---|
[EINVAL] |
The specified Component is not a valid component name. |
[EFAULT] | |
[EUNKNOWN] |
None.
The following example retrieves the active trace level for a component named MYCOMP. The example output assumes the Start Trace (STRTRC) CL command was used before calling the example, specifying TRCTYPE((MYCOMP *INFO)).
Note: By using the code examples, you agree to the terms of the Code license and disclaimer information.
#include <qtrc.h> #include <stdio.h> #include <errno.h> int main(int argc, char *argv[]) { unsigned int myCompActLvl = QTRC_LEVEL_NONE; const char *myComp = "MYCOMP"; int rc; rc = QtrcGetActiveLevel(myComp, &myCompActLvl); if (rc != 0) { printf("QtrcGetActiveLevel() failed with error %d\n", rc); return -1; } printf("%s active trace level is: ",myComp); switch (myCompActLvl) { case QTRC_LEVEL_NONE: printf("NONE\n"); break; case QTRC_LEVEL_ERROR: printf("ERROR\n"); break; case QTRC_LEVEL_INFO: printf("INFO\n"); break; case QTRC_LEVEL_VERBOSE: printf("VERBOSE\n"); break; } return 0; }Example Output:
MYCOMP active trace level is: INFO
[ Back to top | Problem Management APIs | APIs by category ]