Skip to content

Commit

Permalink
Add an attach syslog
Browse files Browse the repository at this point in the history
Adds an official attach syslog for better diagnostics in regular usage with
an attach approach.

Review-URL: https://codereview.appspot.com/319000044
  • Loading branch information
derekbruening committed Dec 20, 2016
1 parent 71427ac commit b5d3b27
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
7 changes: 7 additions & 0 deletions core/dynamo.c
Expand Up @@ -2748,6 +2748,13 @@ dynamorio_take_over_threads(dcontext_t *dcontext)
"Failed to take over all threads after multiple attempts");
ASSERT_NOT_REACHED();
}
DO_ONCE({
char buf[16];
snprintf(buf, BUFFER_SIZE_ELEMENTS(buf), "%d", get_num_threads());
NULL_TERMINATE_BUFFER(buf);
SYSLOG(SYSLOG_INFORMATION, INFO_ATTACHED, 3, buf, get_application_name(),
get_application_pid());
});
}

/* Called by dynamorio_app_take_over in arch-specific assembly file */
Expand Down
9 changes: 9 additions & 0 deletions core/win32/events.mc
Expand Up @@ -125,6 +125,15 @@ Language=English
Detaching from application %1!s! (%2!s!)
.
;// Info messages
MessageId =
Severity = Informational
Facility = DRCore
SymbolicName = MSG_INFO_ATTACHED
Language=English
Attached to %1!s! threads in application %2!s! (%3!s!)
.
;//;;;;;;;;;;;;;;;;;;; Security
MessageId =
Expand Down

0 comments on commit b5d3b27

Please sign in to comment.