- proc_t caller = PROC_NULL;
- proc_t caller_parent = PROC_NULL;
- char command_name[MAXCOMLEN + 1] = "";
- char parent_name[MAXCOMLEN + 1] = "";
-
- if ((caller = proc_self()) != PROC_NULL) {
- /* get process name */
- strlcpy(command_name, caller->p_comm, sizeof(command_name));
-
- /* get parent process name if possible */
- if ((caller_parent = proc_find(caller->p_ppid)) != PROC_NULL) {
- strlcpy(parent_name, caller_parent->p_comm,
- sizeof(parent_name));
- proc_rele(caller_parent);
- }
-
- if ((escape_str(command_name, strlen(command_name),
- sizeof(command_name)) == 0) &&
- (escape_str(parent_name, strlen(parent_name),
- sizeof(parent_name)) == 0)) {
- kern_asl_msg(LOG_DEBUG, "messagetracer",
- 5,
- "com.apple.message.domain",
- "com.apple.kernel.tcpstat", /* 1 */
- "com.apple.message.signature",
- "tcpinfo", /* 2 */
- "com.apple.message.signature2", command_name, /* 3 */
- "com.apple.message.signature3", parent_name, /* 4 */
- "com.apple.message.summarize", "YES", /* 5 */
- NULL);
- }
- }
-
- if (caller != PROC_NULL)
- proc_rele(caller);