符号常量

Vue 支持一些预定义的符号常量,这些常量在AIX编程中很常用。 这些常量在 Vue中被视为关键字。 在编译期间,常量被替换为它们在系统头文件中的定义。 特定于探针管理器的符号常量是在其对应部分中说明。 以下是通用符号常量。

AF_INET
这将指定 IPv4 类型的地址系列。 这将确保数据为 IPv4 类型。
AF_INET6
这将指定 IPv6 类型的地址系列。 这将确保数据为 IPv6 类型。
NULL
将指针类型设置为 NULL 或零值。 不能使用 NULL 将字符串变量设为空字符串。
错误编号或“errno”名称
这些是标准的错误名称(如 EPERMEAGAINESRCHENOENT 等),由 POSIX 和 ANSI 标准指定并在 /usr/include/sys/errno.h 头文件中定义。

以下脚本跟踪 bind 系统调用失败且 errno 设为 EADDRINUSE(地址已在使用)的时间。

/*
 * 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);
}
信号名称
这些是标准的信号名称(如 SIGSEGVSIGHUPSIGILLSIGABRT 等),由 ANSI 标准指定并在 /usr/include/sys/signal.h 头文件中定义。

以下脚本通过向特定的进程发送一个特定的信号显示如何调试“谁”结束了该进程。

/*
 * 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
标识探针点是否为函数入口点。 与 get_location_point 函数一起使用。
FUNCTION_EXIT
标识探针点是否为函数出口点。 与 get_location_point 函数一起使用。