1 /* |
1 /* |
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
266 */ |
266 */ |
267 void outputStream::print_data(void* data, size_t len, bool with_ascii) { |
267 void outputStream::print_data(void* data, size_t len, bool with_ascii) { |
268 size_t limit = (len + 16) / 16 * 16; |
268 size_t limit = (len + 16) / 16 * 16; |
269 for (size_t i = 0; i < limit; ++i) { |
269 for (size_t i = 0; i < limit; ++i) { |
270 if (i % 16 == 0) { |
270 if (i % 16 == 0) { |
271 indent().print("%07x:", i); |
271 indent().print(INTPTR_FORMAT_W(07)":", i); |
272 } |
272 } |
273 if (i % 2 == 0) { |
273 if (i % 2 == 0) { |
274 print(" "); |
274 print(" "); |
275 } |
275 } |
276 if (i < len) { |
276 if (i < len) { |
604 |
604 |
605 // dump vm version, os version, platform info, build id, |
605 // dump vm version, os version, platform info, build id, |
606 // memory usage and command line flags into header |
606 // memory usage and command line flags into header |
607 void gcLogFileStream::dump_loggc_header() { |
607 void gcLogFileStream::dump_loggc_header() { |
608 if (is_open()) { |
608 if (is_open()) { |
609 print_cr(Abstract_VM_Version::internal_vm_info_string()); |
609 print_cr("%s", Abstract_VM_Version::internal_vm_info_string()); |
610 os::print_memory_info(this); |
610 os::print_memory_info(this); |
611 print("CommandLine flags: "); |
611 print("CommandLine flags: "); |
612 CommandLineFlags::printSetFlags(this); |
612 CommandLineFlags::printSetFlags(this); |
613 } |
613 } |
614 } |
614 } |
685 jio_snprintf(time_msg, sizeof(time_msg), "File %s rotated at %s\n", |
685 jio_snprintf(time_msg, sizeof(time_msg), "File %s rotated at %s\n", |
686 _file_name, os::local_time_string((char *)time_str, sizeof(time_str))); |
686 _file_name, os::local_time_string((char *)time_str, sizeof(time_str))); |
687 write(time_msg, strlen(time_msg)); |
687 write(time_msg, strlen(time_msg)); |
688 |
688 |
689 if (out != NULL) { |
689 if (out != NULL) { |
690 out->print(time_msg); |
690 out->print("%s", time_msg); |
691 } |
691 } |
692 |
692 |
693 dump_loggc_header(); |
693 dump_loggc_header(); |
694 return; |
694 return; |
695 } |
695 } |
718 os::local_time_string((char *)time_str, sizeof(time_str)), |
718 os::local_time_string((char *)time_str, sizeof(time_str)), |
719 msg, renamed_file_name); |
719 msg, renamed_file_name); |
720 write(time_msg, strlen(time_msg)); |
720 write(time_msg, strlen(time_msg)); |
721 |
721 |
722 if (out != NULL) { |
722 if (out != NULL) { |
723 out->print(time_msg); |
723 out->print("%s", time_msg); |
724 } |
724 } |
725 |
725 |
726 fclose(_file); |
726 fclose(_file); |
727 _file = NULL; |
727 _file = NULL; |
728 |
728 |
763 os::local_time_string((char *)time_str, sizeof(time_str)), |
763 os::local_time_string((char *)time_str, sizeof(time_str)), |
764 current_file_name); |
764 current_file_name); |
765 write(time_msg, strlen(time_msg)); |
765 write(time_msg, strlen(time_msg)); |
766 |
766 |
767 if (out != NULL) { |
767 if (out != NULL) { |
768 out->print(time_msg); |
768 out->print("%s", time_msg); |
769 } |
769 } |
770 |
770 |
771 dump_loggc_header(); |
771 dump_loggc_header(); |
772 // remove the existing file |
772 // remove the existing file |
773 if (access(current_file_name, F_OK) == 0) { |
773 if (access(current_file_name, F_OK) == 0) { |
843 // %%% Should be: jlong time_ms = os::start_time_milliseconds(), if |
843 // %%% Should be: jlong time_ms = os::start_time_milliseconds(), if |
844 // we ever get round to introduce that method on the os class |
844 // we ever get round to introduce that method on the os class |
845 xs->head("hotspot_log version='%d %d'" |
845 xs->head("hotspot_log version='%d %d'" |
846 " process='%d' time_ms='"INT64_FORMAT"'", |
846 " process='%d' time_ms='"INT64_FORMAT"'", |
847 LOG_MAJOR_VERSION, LOG_MINOR_VERSION, |
847 LOG_MAJOR_VERSION, LOG_MINOR_VERSION, |
848 os::current_process_id(), time_ms); |
848 os::current_process_id(), (int64_t)time_ms); |
849 // Write VM version header immediately. |
849 // Write VM version header immediately. |
850 xs->head("vm_version"); |
850 xs->head("vm_version"); |
851 xs->head("name"); xs->text("%s", VM_Version::vm_name()); xs->cr(); |
851 xs->head("name"); xs->text("%s", VM_Version::vm_name()); xs->cr(); |
852 xs->tail("name"); |
852 xs->tail("name"); |
853 xs->head("release"); xs->text("%s", VM_Version::vm_release()); xs->cr(); |
853 xs->head("release"); xs->text("%s", VM_Version::vm_release()); xs->cr(); |