External variables
Kernel class variables, entry and exit class variables and built-in variables are all external variables.
They exist independent of the ProbeVue framework and derive their values outside the context of any Vue script. ProbeVue allows the current values of external variables to be made available inside a Vue script. These variables are always read-only within the context of the Vue script. Any program statements that attempt to modify the value of an external variable will be flagged by the compiler as an illegal statement.
Although external variables have a pre-defined type, ProbeVue requires explicit declarations of all external variables, except for the built-in ones, in the Vue script that accesses them. The following table describes how the types of external variables are determined:
| Variable | Type |
|---|---|
| Kernel global class | From the __kernel declaration statement of the kernel variable. |
| Entry class | From the function prototype declaration in the Vue script. Must specify the data types of each argument being used in the Vue script. |
| Return value from kernel functions | From the function prototype declaration in the Vue script. Must provide the type of the return value. |
| Built-ins | These are generally dependent upon the underlying kernel variable. Their defined types and the equivalent ProbeVue types are as follows: |
| Built-in | Defined type | ProbeVue type |
|---|---|---|
| __tid | tid_t | long long |
| __pid | pid_t | long long |
| __ppid | pid_t | long long |
| __pgid | pid_t | long long |
| __pname | char [32] | String [32] |
| __uid | uid_t | unsigned int |
| __euid | uid_t | unsigned int |
| __trcid | pid_t | long long |
| __errno | int | int |
| __kernelmode | int | int |
| __r3..__r10 | 32-bit for 32-bit process 64-bit for 64-bit process |
unsigned long |
| __curthread | N/A | All the members is long long |
| __curproc | N/A | All the members except for cwd is long long. The cwd member is of type string. |
| __ublock | N/A | All the members is long long |