Symbolic constants

Vue supports some pre-defined symbolic constants, which are commonly used in AIX® programming. These constants are treated as keywords in Vue. During compilation, the constants are replaced by their definitions in system header files. Probe manager-specific symbolic constants are explained in their respective sections. Following are the generic symbolic constants.

AF_INET
This specifies the address family of type IPv4. This ensures that the data is of IPV4 type.
AF_INET6
This specifies the address family of type IPv6. This ensures that the data is of IPV6 type.
NULL
To set pointer types to a NULL or zero value. You cannot use NULL to set a String variable to the empty string.
Error numbers or "errno" names
These are the standard error names like EPERM, EAGAIN, ESRCH, ENOENT, and so on, specified by the POSIX and ANSI standards and defined in the /usr/include/sys/errno.h header file.

The following script traces when the bind system call fails with errno set to EADDRINUSE (address already in use).

/*
 * File: bind.e
 */

/*
 * Okay to use void for parameters since we are not planning to
 * access them in this script.
 */
int bind(void);

@@syscall:*:bind:exit
	when (__rv == -1)
{
	/*
	 * The following check could also be moved to the predicate,
	 * although it may not buy a lot because we are already in an
	 * error path that should be executed only rarely
	 */
	if (__errno == EADDRINUSE) 
 /* This check could also be moved to the predicate */
		printf("%d failed with EADDRINUSE for bind() call.\n", __pid);
}
Signal names
These are the standard signal names like SIGSEGV, SIGHUP, SIGILL, SIGABRT, and so on, specified by the ANSI standards and defined in the /usr/include/sys/signal.h header file.

The following script shows how to debug "who" killed a particular process by sending it a specific signal.

/*
 * File: signal.e
 *
 * Who sent SIGKILL to my process ?
 */

/* Process IDs are < 2^32, so using an 'int' here instead of pid_t is
 * good enough
 */
int kill(int pid, int signo);

@@syscall:*:kill:entry
	when (__arg1 == $1 && __arg2 == SIGKILL)
{
	/* Trace sender of SIGKILL */
	printf("Stack trace of %s: (PID = %d)\n", __pname, __pid);
	stktrace(PRINT_SYMBOLS|GET_USER_TRACE, -1);
	exit();
}
FUNCTION_ENTRY
Identifies if a probe point is a function entry point. Used with the get_location_point function.
FUNCTION_EXIT
Identifies if a probe point is a function exit point. Used with the get_location_point function.