This commit is contained in:
Vladimir Kozlov 2012-10-12 09:22:52 -07:00
commit 5f132a5ec3
135 changed files with 2294 additions and 1132 deletions

View file

@ -1570,7 +1570,8 @@ void CompileBroker::compiler_thread_loop() {
}
CompileLog* log = thread->log();
if (log != NULL) {
log->begin_elem("start_compile_thread thread='" UINTX_FORMAT "' process='%d'",
log->begin_elem("start_compile_thread name='%s' thread='" UINTX_FORMAT "' process='%d'",
thread->name(),
os::current_thread_id(),
os::current_process_id());
log->stamp();

View file

@ -302,3 +302,48 @@ void CompileLog::finish_log(outputStream* file) {
char buf[4 * K];
finish_log_on_error(file, buf, sizeof(buf));
}
// ------------------------------------------------------------------
// CompileLog::inline_success
//
// Print about successful method inlining.
void CompileLog::inline_success(const char* reason) {
begin_elem("inline_success reason='");
text(reason);
end_elem("'");
}
// ------------------------------------------------------------------
// CompileLog::inline_fail
//
// Print about failed method inlining.
void CompileLog::inline_fail(const char* reason) {
begin_elem("inline_fail reason='");
text(reason);
end_elem("'");
}
// ------------------------------------------------------------------
// CompileLog::set_context
//
// Set XML tag as an optional marker - it is printed only if
// there are other entries after until it is reset.
void CompileLog::set_context(const char* format, ...) {
va_list ap;
va_start(ap, format);
clear_context();
_context.print("<");
_context.vprint(format, ap);
_context.print_cr("/>");
va_end(ap);
}
// ------------------------------------------------------------------
// CompileLog::code_cache_state
//
// Print code cache state.
void CompileLog::code_cache_state() {
begin_elem("code_cache");
CodeCache::log_state(this);
end_elem("");
}

View file

@ -62,7 +62,13 @@ class CompileLog : public xmlStream {
intx thread_id() { return _thread_id; }
const char* file() { return _file; }
// Optional context marker, to help place actions that occur during
// parsing. If there is no log output until the next context string
// or reset, context string will be silently ignored
stringStream* context() { return &_context; }
void clear_context() { context()->reset(); }
void set_context(const char* format, ...);
void name(ciSymbol* s); // name='s'
void name(Symbol* s) { xmlStream::name(s); }
@ -71,6 +77,9 @@ class CompileLog : public xmlStream {
int identify(ciBaseObject* obj);
void clear_identities();
void inline_fail (const char* reason);
void inline_success(const char* reason);
// virtuals
virtual void see_tag(const char* tag, bool push);
virtual void pop_tag(const char* tag);
@ -78,6 +87,9 @@ class CompileLog : public xmlStream {
// make a provisional end of log mark
void mark_file_end() { _file_end = out()->count(); }
// Print code cache statistics
void code_cache_state();
// copy all logs to the given stream
static void finish_log(outputStream* out);
static void finish_log_on_error(outputStream* out, char *buf, int buflen);