Built-in class variables
In addition to the special built-in variables, __arg1 through __arg32 and __rv, Vue also defines a set of general-purpose built-in variables. These general-purpose built-in variables are discussed in more detail in this section and some probe manager specific built-in variables are discussed in their respective probe manager section. Built-in class variables are functions, but are treated as variables by ProbeVue. Therefore, you can use these built-in variables in the predicate section of a Vue clause.
The following built-in variables are supported in Vue:
- __tid
- Thread ID of traced thread.
- __pid
- Process ID of traced thread.
- __ppid
- Parent process ID of traced thread.
- __pgid
- Process group ID of traced thread.
- __pname
- Process name of traced thread.
- __uid, __euid
- Real and effective user ID of traced thread.
- __trcid
- Process ID of tracing process (that is, of the probevue command)
- __errno
- Current errno value for the traced thread.
- __kernelmode
- Current executable mode: is either 1 (in kernel mode) or 0 (in user mode).
- __r3, ..., __r10
- General purpose register values (for function parameters or return values).
- __curthread
- Current thread.
- __curproc
- Current process.
- __ublock
- User area of the current process.
- __mst
- Built-in variable to access the hardware register content of the current thread's machine state save area (MST).
- __stat
- Built-in variable to provides access to the system statistics for various AIX® kernel components.
The following script is an example using built-in variables:
@@syscall:*:read:entry
{
printf("Thread ID:%d, Process ID:%d, Parent Process ID:%d\n",
__tid, __pid, __ppid);
printf("Process Group ID: %d\n", __pgid);
printf("Process name = %s\n", __pname);
printf("Real UID=%d, Effective UID=%d\n", __uid, __euid);S
printf("probevue command process ID = %d\n", __trcid);
printf("Errno = %d\n", __errno);
printf("Mode = %s\n", __kernelmode == 1 ? "kernel" : "user");
printf("Current values of GPRs: r3=0x%016llx, r4=0x%016llx, r5=0x%016llx\n",
__r3, __r4, __r5);
printf(" r6=0x%016llx, r7=0x%016llx, r8=0x%016llx\n",
__r6, __r7, __r8);
printf(" r9=0x%016llx, r10=0x%016llx\n",
__r9, __r10);
}