Mon, 14 Jul 2014 03:26:52 -0700
8049530: Provide descriptive failure reason for compilation tasks removed for the queue
Reviewed-by: roland, iveresov
1.1 --- a/src/share/vm/ci/ciEnv.cpp Mon Jul 14 03:24:35 2014 -0700 1.2 +++ b/src/share/vm/ci/ciEnv.cpp Mon Jul 14 03:26:52 2014 -0700 1.3 @@ -1112,9 +1112,6 @@ 1.4 // ------------------------------------------------------------------ 1.5 // ciEnv::record_failure() 1.6 void ciEnv::record_failure(const char* reason) { 1.7 - if (log() != NULL) { 1.8 - log()->elem("failure reason='%s'", reason); 1.9 - } 1.10 if (_failure_reason == NULL) { 1.11 // Record the first failure reason. 1.12 _failure_reason = reason;
2.1 --- a/src/share/vm/compiler/compileBroker.cpp Mon Jul 14 03:24:35 2014 -0700 2.2 +++ b/src/share/vm/compiler/compileBroker.cpp Mon Jul 14 03:26:52 2014 -0700 2.3 @@ -287,6 +287,7 @@ 2.4 _hot_count = hot_count; 2.5 _time_queued = 0; // tidy 2.6 _comment = comment; 2.7 + _failure_reason = NULL; 2.8 2.9 if (LogCompilation) { 2.10 _time_queued = os::elapsed_counter(); 2.11 @@ -565,6 +566,11 @@ 2.12 methodHandle method(thread, this->method()); 2.13 ResourceMark rm(thread); 2.14 2.15 + if (!_is_success) { 2.16 + const char* reason = _failure_reason != NULL ? _failure_reason : "unknown"; 2.17 + log->elem("failure reason='%s'", reason); 2.18 + } 2.19 + 2.20 // <task_done ... stamp='1.234'> </task> 2.21 nmethod* nm = code(); 2.22 log->begin_elem("task_done success='%d' nmsize='%d' count='%d'", 2.23 @@ -714,6 +720,7 @@ 2.24 for (CompileTask* task = head; task != NULL; ) { 2.25 CompileTask* next_task = task->next(); 2.26 CompileTaskWrapper ctw(task); // Frees the task 2.27 + task->set_failure_reason("stale task"); 2.28 task = next_task; 2.29 } 2.30 } 2.31 @@ -1788,6 +1795,7 @@ 2.32 } else { 2.33 // After compilation is disabled, remove remaining methods from queue 2.34 method->clear_queued_for_compilation(); 2.35 + task->set_failure_reason("compilation is disabled"); 2.36 } 2.37 } 2.38 } 2.39 @@ -1975,6 +1983,7 @@ 2.40 compilable = ci_env.compilable(); 2.41 2.42 if (ci_env.failing()) { 2.43 + task->set_failure_reason(ci_env.failure_reason()); 2.44 const char* retry_message = ci_env.retry_message(); 2.45 if (_compilation_log != NULL) { 2.46 _compilation_log->log_failure(thread, task, ci_env.failure_reason(), retry_message);
3.1 --- a/src/share/vm/compiler/compileBroker.hpp Mon Jul 14 03:24:35 2014 -0700 3.2 +++ b/src/share/vm/compiler/compileBroker.hpp Mon Jul 14 03:26:52 2014 -0700 3.3 @@ -59,6 +59,7 @@ 3.4 jobject _hot_method_holder; 3.5 int _hot_count; // information about its invocation counter 3.6 const char* _comment; // more info about the task 3.7 + const char* _failure_reason; 3.8 3.9 public: 3.10 CompileTask() { 3.11 @@ -130,6 +131,10 @@ 3.12 void log_task_queued(); 3.13 void log_task_start(CompileLog* log); 3.14 void log_task_done(CompileLog* log); 3.15 + 3.16 + void set_failure_reason(const char* reason) { 3.17 + _failure_reason = reason; 3.18 + } 3.19 }; 3.20 3.21 // CompilerCounters