324 } 325 326 static int col_width(julong n, const char *name) { 327 int w = julong_width(n); 328 int min = (int)(strlen(name)); 329 if (w < min) { 330 w = min; 331 } 332 // add a leading space for separation. 333 return w + 1; 334 } 335 336 public: 337 KlassInfoHisto(KlassInfoTable* cit); 338 ~KlassInfoHisto(); 339 void add(KlassInfoEntry* cie); 340 void print_histo_on(outputStream* st, bool print_class_stats, bool csv_format, const char *columns); 341 void sort(); 342 }; 343 344 #endif // INCLUDE_SERVICES 345 346 // These declarations are needed since the declaration of KlassInfoTable and 347 // KlassInfoClosure are guarded by #if INLCUDE_SERVICES 348 class KlassInfoTable; 349 class KlassInfoClosure; 350 351 class HeapInspection : public StackObj { 352 bool _csv_format; // "comma separated values" format for spreadsheet. 353 bool _print_help; 354 bool _print_class_stats; 355 const char* _columns; 356 public: 357 HeapInspection(bool csv_format, bool print_help, 358 bool print_class_stats, const char *columns) : 359 _csv_format(csv_format), _print_help(print_help), 360 _print_class_stats(print_class_stats), _columns(columns) {} 361 void heap_inspection(outputStream* st) NOT_SERVICES_RETURN; 362 size_t populate_table(KlassInfoTable* cit, BoolObjectClosure* filter = NULL) NOT_SERVICES_RETURN_(0); 363 static void find_instances_at_safepoint(Klass* k, GrowableArray<oop>* result) NOT_SERVICES_RETURN; | 324 } 325 326 static int col_width(julong n, const char *name) { 327 int w = julong_width(n); 328 int min = (int)(strlen(name)); 329 if (w < min) { 330 w = min; 331 } 332 // add a leading space for separation. 333 return w + 1; 334 } 335 336 public: 337 KlassInfoHisto(KlassInfoTable* cit); 338 ~KlassInfoHisto(); 339 void add(KlassInfoEntry* cie); 340 void print_histo_on(outputStream* st, bool print_class_stats, bool csv_format, const char *columns); 341 void sort(); 342 }; 343 344 class PrintClassLayout : AllStatic { 345 public: 346 static void print_class_layout(outputStream* st, char* classname); 347 }; 348 349 #endif // INCLUDE_SERVICES 350 351 // These declarations are needed since the declaration of KlassInfoTable and 352 // KlassInfoClosure are guarded by #if INLCUDE_SERVICES 353 class KlassInfoTable; 354 class KlassInfoClosure; 355 356 class HeapInspection : public StackObj { 357 bool _csv_format; // "comma separated values" format for spreadsheet. 358 bool _print_help; 359 bool _print_class_stats; 360 const char* _columns; 361 public: 362 HeapInspection(bool csv_format, bool print_help, 363 bool print_class_stats, const char *columns) : 364 _csv_format(csv_format), _print_help(print_help), 365 _print_class_stats(print_class_stats), _columns(columns) {} 366 void heap_inspection(outputStream* st) NOT_SERVICES_RETURN; 367 size_t populate_table(KlassInfoTable* cit, BoolObjectClosure* filter = NULL) NOT_SERVICES_RETURN_(0); 368 static void find_instances_at_safepoint(Klass* k, GrowableArray<oop>* result) NOT_SERVICES_RETURN; |