hotspot/src/share/vm/services/heapDumper.cpp
changeset 33604 ad1cd9269bd4
parent 33602 16053580a684
child 33606 af4ec8a4635b
equal deleted inserted replaced
33603:450d454670a7 33604:ad1cd9269bd4
  1846     }
  1846     }
  1847   }
  1847   }
  1848 }
  1848 }
  1849 
  1849 
  1850 // dump the heap to given path.
  1850 // dump the heap to given path.
  1851 PRAGMA_FORMAT_NONLITERAL_IGNORED_EXTERNAL
       
  1852 int HeapDumper::dump(const char* path) {
  1851 int HeapDumper::dump(const char* path) {
  1853   assert(path != NULL && strlen(path) > 0, "path missing");
  1852   assert(path != NULL && strlen(path) > 0, "path missing");
  1854 
  1853 
  1855   // print message in interactive case
  1854   // print message in interactive case
  1856   if (print_to_tty()) {
  1855   if (print_to_tty()) {
  1884 
  1883 
  1885   // print message in interactive case
  1884   // print message in interactive case
  1886   if (print_to_tty()) {
  1885   if (print_to_tty()) {
  1887     timer()->stop();
  1886     timer()->stop();
  1888     if (error() == NULL) {
  1887     if (error() == NULL) {
  1889       char msg[256];
  1888       tty->print_cr("Heap dump file created [" JLONG_FORMAT " bytes in %3.3f secs]",
  1890       sprintf(msg, "Heap dump file created [%s bytes in %3.3f secs]",
  1889                     writer.bytes_written(), timer()->seconds());
  1891         JLONG_FORMAT, timer()->seconds());
       
  1892 PRAGMA_DIAG_PUSH
       
  1893 PRAGMA_FORMAT_NONLITERAL_IGNORED_INTERNAL
       
  1894       tty->print_cr(msg, writer.bytes_written());
       
  1895 PRAGMA_DIAG_POP
       
  1896     } else {
  1890     } else {
  1897       tty->print_cr("Dump file is incomplete: %s", writer.error());
  1891       tty->print_cr("Dump file is incomplete: %s", writer.error());
  1898     }
  1892     }
  1899   }
  1893   }
  1900 
  1894