< prev index next >

src/hotspot/share/gc/z/zStat.hpp

Print this page


   1 /*
   2  * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 #ifndef SHARE_GC_Z_ZSTAT_HPP
  25 #define SHARE_GC_Z_ZSTAT_HPP
  26 
  27 #include "gc/shared/concurrentGCThread.hpp"
  28 #include "gc/shared/gcCause.hpp"
  29 #include "gc/shared/gcTimer.hpp"
  30 #include "gc/z/zMetronome.hpp"
  31 #include "logging/logHandle.hpp"
  32 #include "memory/allocation.hpp"
  33 #include "utilities/globalDefinitions.hpp"
  34 #include "utilities/numberSeq.hpp"
  35 #include "utilities/ticks.hpp"
  36 
  37 class ZPage;


  38 class ZStatSampler;
  39 class ZStatSamplerHistory;
  40 struct ZStatCounterData;
  41 struct ZStatSamplerData;
  42 
  43 //
  44 // Stat unit printers
  45 //
  46 typedef void (*ZStatUnitPrinter)(LogTargetHandle log, const ZStatSampler&, const ZStatSamplerHistory&);
  47 
  48 void ZStatUnitTime(LogTargetHandle log, const ZStatSampler& sampler, const ZStatSamplerHistory& history);
  49 void ZStatUnitBytes(LogTargetHandle log, const ZStatSampler& sampler, const ZStatSamplerHistory& history);
  50 void ZStatUnitThreads(LogTargetHandle log, const ZStatSampler& sampler, const ZStatSamplerHistory& history);
  51 void ZStatUnitBytesPerSecond(LogTargetHandle log, const ZStatSampler& sampler, const ZStatSamplerHistory& history);
  52 void ZStatUnitOpsPerSecond(LogTargetHandle log, const ZStatSampler& sampler, const ZStatSamplerHistory& history);
  53 
  54 //
  55 // Stat value
  56 //
  57 class ZStatValue {


 401   static size_t _nproactiveflush;
 402   static size_t _nterminateflush;
 403   static size_t _ntrycomplete;
 404   static size_t _ncontinue;
 405 
 406 public:
 407   static void set_at_mark_start(size_t nstripes);
 408   static void set_at_mark_end(size_t nproactiveflush,
 409                               size_t nterminateflush,
 410                               size_t ntrycomplete,
 411                               size_t ncontinue);
 412 
 413   static void print();
 414 };
 415 
 416 //
 417 // Stat relocation
 418 //
 419 class ZStatRelocation : public AllStatic {
 420 private:
 421   static size_t _relocating;
 422   static bool   _success;


 423 
 424 public:
 425   static void set_at_select_relocation_set(size_t relocating);
 426   static void set_at_relocate_end(bool success);
 427 
 428   static void print();
 429 };
 430 
 431 //
 432 // Stat nmethods
 433 //
 434 class ZStatNMethods : public AllStatic {
 435 public:
 436   static void print();
 437 };
 438 
 439 //
 440 // Stat metaspace
 441 //
 442 class ZStatMetaspace : public AllStatic {
 443 public:
 444   static void print();
 445 };


 523     size_t free_high;
 524     size_t free_low;
 525   } _at_relocate_end;
 526 
 527   static size_t capacity_high();
 528   static size_t capacity_low();
 529   static size_t available(size_t used);
 530   static size_t reserve(size_t used);
 531   static size_t free(size_t used);
 532 
 533 public:
 534   static void set_at_initialize(size_t min_capacity,
 535                                 size_t max_capacity,
 536                                 size_t max_reserve);
 537   static void set_at_mark_start(size_t soft_max_capacity,
 538                                 size_t capacity,
 539                                 size_t used);
 540   static void set_at_mark_end(size_t capacity,
 541                               size_t allocated,
 542                               size_t used);
 543   static void set_at_select_relocation_set(size_t live,
 544                                            size_t garbage,
 545                                            size_t reclaimed);
 546   static void set_at_relocate_start(size_t capacity,
 547                                     size_t allocated,
 548                                     size_t used);
 549   static void set_at_relocate_end(size_t capacity,
 550                                   size_t allocated,
 551                                   size_t reclaimed,
 552                                   size_t used,
 553                                   size_t used_high,
 554                                   size_t used_low);
 555 
 556   static size_t max_capacity();
 557   static size_t used_at_mark_start();
 558   static size_t used_at_relocate_end();
 559 
 560   static void print();
 561 };
 562 
 563 #endif // SHARE_GC_Z_ZSTAT_HPP
   1 /*
   2  * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 #ifndef SHARE_GC_Z_ZSTAT_HPP
  25 #define SHARE_GC_Z_ZSTAT_HPP
  26 
  27 #include "gc/shared/concurrentGCThread.hpp"
  28 #include "gc/shared/gcCause.hpp"
  29 #include "gc/shared/gcTimer.hpp"
  30 #include "gc/z/zMetronome.hpp"
  31 #include "logging/logHandle.hpp"
  32 #include "memory/allocation.hpp"
  33 #include "utilities/globalDefinitions.hpp"
  34 #include "utilities/numberSeq.hpp"
  35 #include "utilities/ticks.hpp"
  36 
  37 class ZPage;
  38 class ZRelocationSetSelectorGroupStats;
  39 class ZRelocationSetSelectorStats;
  40 class ZStatSampler;
  41 class ZStatSamplerHistory;
  42 struct ZStatCounterData;
  43 struct ZStatSamplerData;
  44 
  45 //
  46 // Stat unit printers
  47 //
  48 typedef void (*ZStatUnitPrinter)(LogTargetHandle log, const ZStatSampler&, const ZStatSamplerHistory&);
  49 
  50 void ZStatUnitTime(LogTargetHandle log, const ZStatSampler& sampler, const ZStatSamplerHistory& history);
  51 void ZStatUnitBytes(LogTargetHandle log, const ZStatSampler& sampler, const ZStatSamplerHistory& history);
  52 void ZStatUnitThreads(LogTargetHandle log, const ZStatSampler& sampler, const ZStatSamplerHistory& history);
  53 void ZStatUnitBytesPerSecond(LogTargetHandle log, const ZStatSampler& sampler, const ZStatSamplerHistory& history);
  54 void ZStatUnitOpsPerSecond(LogTargetHandle log, const ZStatSampler& sampler, const ZStatSamplerHistory& history);
  55 
  56 //
  57 // Stat value
  58 //
  59 class ZStatValue {


 403   static size_t _nproactiveflush;
 404   static size_t _nterminateflush;
 405   static size_t _ntrycomplete;
 406   static size_t _ncontinue;
 407 
 408 public:
 409   static void set_at_mark_start(size_t nstripes);
 410   static void set_at_mark_end(size_t nproactiveflush,
 411                               size_t nterminateflush,
 412                               size_t ntrycomplete,
 413                               size_t ncontinue);
 414 
 415   static void print();
 416 };
 417 
 418 //
 419 // Stat relocation
 420 //
 421 class ZStatRelocation : public AllStatic {
 422 private:
 423   static ZRelocationSetSelectorStats _stats;
 424   static bool                        _success;
 425 
 426   static void print(const char* name, const ZRelocationSetSelectorGroupStats& group);
 427 
 428 public:
 429   static void set_at_select_relocation_set(const ZRelocationSetSelectorStats& stats);
 430   static void set_at_relocate_end(bool success);
 431 
 432   static void print();
 433 };
 434 
 435 //
 436 // Stat nmethods
 437 //
 438 class ZStatNMethods : public AllStatic {
 439 public:
 440   static void print();
 441 };
 442 
 443 //
 444 // Stat metaspace
 445 //
 446 class ZStatMetaspace : public AllStatic {
 447 public:
 448   static void print();
 449 };


 527     size_t free_high;
 528     size_t free_low;
 529   } _at_relocate_end;
 530 
 531   static size_t capacity_high();
 532   static size_t capacity_low();
 533   static size_t available(size_t used);
 534   static size_t reserve(size_t used);
 535   static size_t free(size_t used);
 536 
 537 public:
 538   static void set_at_initialize(size_t min_capacity,
 539                                 size_t max_capacity,
 540                                 size_t max_reserve);
 541   static void set_at_mark_start(size_t soft_max_capacity,
 542                                 size_t capacity,
 543                                 size_t used);
 544   static void set_at_mark_end(size_t capacity,
 545                               size_t allocated,
 546                               size_t used);
 547   static void set_at_select_relocation_set(const ZRelocationSetSelectorStats& stats,

 548                                            size_t reclaimed);
 549   static void set_at_relocate_start(size_t capacity,
 550                                     size_t allocated,
 551                                     size_t used);
 552   static void set_at_relocate_end(size_t capacity,
 553                                   size_t allocated,
 554                                   size_t reclaimed,
 555                                   size_t used,
 556                                   size_t used_high,
 557                                   size_t used_low);
 558 
 559   static size_t max_capacity();
 560   static size_t used_at_mark_start();
 561   static size_t used_at_relocate_end();
 562 
 563   static void print();
 564 };
 565 
 566 #endif // SHARE_GC_Z_ZSTAT_HPP
< prev index next >