< prev index next >
src/share/vm/logging/logConfiguration.cpp
Print this page
rev 8933 : 8046148.01
@@ -39,26 +39,25 @@
LogOutput** LogConfiguration::_outputs = NULL;
size_t LogConfiguration::_n_outputs = 0;
void LogConfiguration::post_initialize() {
assert(LogConfiguration_lock != NULL, "Lock must be initialized before post-initialization");
- LogDiagnosticCommand::registerCommand();
LogHandle(logging) log;
log.info("Log configuration fully initialized.");
if (log.is_trace()) {
ResourceMark rm;
- MutexLocker ml(LogConfiguration_lock);
describe(log.trace_stream());
}
+ LogDiagnosticCommand::registerCommand();
}
void LogConfiguration::initialize(jlong vm_start_time) {
LogFileOutput::set_file_name_parameters(vm_start_time);
LogDecorations::set_vm_start_time_millis(vm_start_time);
assert(_outputs == NULL, "Should not initialize _outputs before this function, initialize called twice?");
- _outputs = NEW_C_HEAP_ARRAY(LogOutput*, 2, mtInternal);
+ _outputs = NEW_C_HEAP_ARRAY(LogOutput*, 2, mtLogging);
_outputs[0] = LogOutput::Stdout;
_outputs[1] = LogOutput::Stderr;
_n_outputs = 2;
}
@@ -105,11 +104,11 @@
return output;
}
size_t LogConfiguration::add_output(LogOutput* output) {
size_t idx = _n_outputs++;
- _outputs = REALLOC_C_HEAP_ARRAY(LogOutput*, _outputs, _n_outputs, mtInternal);
+ _outputs = REALLOC_C_HEAP_ARRAY(LogOutput*, _outputs, _n_outputs, mtLogging);
_outputs[idx] = output;
return idx;
}
void LogConfiguration::delete_output(size_t idx) {
@@ -117,11 +116,11 @@
err_msg("idx must be in range 1 < idx < _n_outputs, but idx = " SIZE_FORMAT
" and _n_outputs = " SIZE_FORMAT, idx, _n_outputs));
LogOutput* output = _outputs[idx];
// Swap places with the last output and shrink the array
_outputs[idx] = _outputs[--_n_outputs];
- _outputs = REALLOC_C_HEAP_ARRAY(LogOutput*, _outputs, _n_outputs, mtInternal);
+ _outputs = REALLOC_C_HEAP_ARRAY(LogOutput*, _outputs, _n_outputs, mtLogging);
delete output;
}
void LogConfiguration::configure_output(size_t idx, const LogTagLevelExpression& tag_level_expression, const LogDecorators& decorators) {
assert(idx < _n_outputs, err_msg("Invalid index, idx = " SIZE_FORMAT " and _n_outputs = " SIZE_FORMAT, idx, _n_outputs));
@@ -170,11 +169,11 @@
disable_output(i);
}
}
bool LogConfiguration::parse_command_line_arguments(const char* opts) {
- char* copy = os::strdup_check_oom(opts, mtInternal);
+ char* copy = os::strdup_check_oom(opts, mtLogging);
// Split the option string to its colon separated components.
char* what = NULL;
char* output_str = NULL;
char* decorators_str = NULL;
@@ -229,11 +228,11 @@
return false;
}
} else {
idx = find_output(outputstr);
if (idx == SIZE_MAX) {
- char* tmp = os::strdup_check_oom(outputstr, mtInternal);
+ char* tmp = os::strdup_check_oom(outputstr, mtLogging);
LogOutput* output = new_output(tmp, output_options);
os::free(tmp);
if (output == NULL) {
errstream->print("Unable to add output '%s'", outputstr);
if (output_options != NULL && strlen(output_options) > 0) {
< prev index next >