796 while (p < end) { 797 switch (unitsize) { 798 case 1: st->print("%02x", *(u1*)p); break; 799 case 2: st->print("%04x", *(u2*)p); break; 800 case 4: st->print("%08x", *(u4*)p); break; 801 case 8: st->print("%016" FORMAT64_MODIFIER "x", *(u8*)p); break; 802 } 803 p += unitsize; 804 cols++; 805 if (cols >= cols_per_line && p < end) { 806 cols = 0; 807 st->cr(); 808 st->print(PTR_FORMAT ": ", p); 809 } else { 810 st->print(" "); 811 } 812 } 813 st->cr(); 814 } 815 816 void os::print_environment_variables(outputStream* st, const char** env_list, 817 char* buffer, int len) { 818 if (env_list) { 819 st->print_cr("Environment Variables:"); 820 821 for (int i = 0; env_list[i] != NULL; i++) { 822 if (getenv(env_list[i], buffer, len)) { 823 st->print("%s", env_list[i]); 824 st->print("="); 825 st->print_cr("%s", buffer); 826 } 827 } 828 } 829 } 830 831 void os::print_cpu_info(outputStream* st) { 832 // cpu 833 st->print("CPU:"); 834 st->print("total %d", os::processor_count()); 835 // It's not safe to query number of active processors after crash 836 // st->print("(active %d)", os::active_processor_count()); 837 st->print(" %s", VM_Version::cpu_features()); 838 st->cr(); 839 pd_print_cpu_info(st); 840 } 841 842 void os::print_date_and_time(outputStream *st) { 843 const int secs_per_day = 86400; 844 const int secs_per_hour = 3600; 845 const int secs_per_min = 60; | 796 while (p < end) { 797 switch (unitsize) { 798 case 1: st->print("%02x", *(u1*)p); break; 799 case 2: st->print("%04x", *(u2*)p); break; 800 case 4: st->print("%08x", *(u4*)p); break; 801 case 8: st->print("%016" FORMAT64_MODIFIER "x", *(u8*)p); break; 802 } 803 p += unitsize; 804 cols++; 805 if (cols >= cols_per_line && p < end) { 806 cols = 0; 807 st->cr(); 808 st->print(PTR_FORMAT ": ", p); 809 } else { 810 st->print(" "); 811 } 812 } 813 st->cr(); 814 } 815 816 void os::print_environment_variables(outputStream* st, const char** env_list) { 817 if (env_list) { 818 st->print_cr("Environment Variables:"); 819 820 for (int i = 0; env_list[i] != NULL; i++) { 821 char *envvar = ::getenv(env_list[i]); 822 if (envvar != NULL) { 823 st->print("%s", env_list[i]); 824 st->print("="); 825 st->print_cr("%s", envvar); 826 } 827 } 828 } 829 } 830 831 void os::print_cpu_info(outputStream* st) { 832 // cpu 833 st->print("CPU:"); 834 st->print("total %d", os::processor_count()); 835 // It's not safe to query number of active processors after crash 836 // st->print("(active %d)", os::active_processor_count()); 837 st->print(" %s", VM_Version::cpu_features()); 838 st->cr(); 839 pd_print_cpu_info(st); 840 } 841 842 void os::print_date_and_time(outputStream *st) { 843 const int secs_per_day = 86400; 844 const int secs_per_hour = 3600; 845 const int secs_per_min = 60; |