src/hotspot/share/runtime/threadStatisticalInfo.hpp
author iklam
Fri, 29 Nov 2019 14:11:50 -0800
changeset 59328 f280911d3427
parent 53244 9807daeb47c4
permissions -rw-r--r--
8230385: [cds] No message is logged when shared image cannot be used due to mismatched configuration Reviewed-by: stuefe, dholmes, ccheung
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
50785
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents:
diff changeset
     1
/*
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 50785
diff changeset
     2
 * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
50785
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents:
diff changeset
     3
 * Copyright (c) 2018 SAP SE. All rights reserved.
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents:
diff changeset
     4
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents:
diff changeset
     5
 *
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents:
diff changeset
     6
 * This code is free software; you can redistribute it and/or modify it
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents:
diff changeset
     7
 * under the terms of the GNU General Public License version 2 only, as
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents:
diff changeset
     8
 * published by the Free Software Foundation.
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents:
diff changeset
     9
 *
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents:
diff changeset
    10
 * This code is distributed in the hope that it will be useful, but WITHOUT
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents:
diff changeset
    11
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents:
diff changeset
    12
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents:
diff changeset
    13
 * version 2 for more details (a copy is included in the LICENSE file that
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents:
diff changeset
    14
 * accompanied this code).
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents:
diff changeset
    15
 *
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents:
diff changeset
    16
 * You should have received a copy of the GNU General Public License version
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents:
diff changeset
    17
 * 2 along with this work; if not, write to the Free Software Foundation,
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents:
diff changeset
    18
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents:
diff changeset
    19
 *
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents:
diff changeset
    20
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents:
diff changeset
    21
 * or visit www.oracle.com if you need additional information or have any
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents:
diff changeset
    22
 * questions.
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents:
diff changeset
    23
 *
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents:
diff changeset
    24
 */
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents:
diff changeset
    25
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 50785
diff changeset
    26
#ifndef SHARE_RUNTIME_THREADSTATISTICALINFO_HPP
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 50785
diff changeset
    27
#define SHARE_RUNTIME_THREADSTATISTICALINFO_HPP
50785
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents:
diff changeset
    28
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents:
diff changeset
    29
#include "jni.h"
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents:
diff changeset
    30
#include "runtime/os.hpp"
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents:
diff changeset
    31
#include "utilities/globalDefinitions.hpp"
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents:
diff changeset
    32
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents:
diff changeset
    33
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents:
diff changeset
    34
class ThreadStatisticalInfo {
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents:
diff changeset
    35
  // The time stamp the thread was started.
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents:
diff changeset
    36
  const uint64_t _start_time_stamp;
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents:
diff changeset
    37
  uint64_t _define_class_count;
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents:
diff changeset
    38
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents:
diff changeset
    39
public:
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents:
diff changeset
    40
  ThreadStatisticalInfo() : _start_time_stamp(os::javaTimeMillis()), _define_class_count(0) {}
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents:
diff changeset
    41
  uint64_t getStartTime() const             { return _start_time_stamp; }
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents:
diff changeset
    42
  uint64_t getDefineClassCount() const                    { return  _define_class_count; }
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents:
diff changeset
    43
  void     setDefineClassCount(uint64_t defineClassCount) { _define_class_count = defineClassCount; }
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents:
diff changeset
    44
  void     incr_define_class_count()                      { _define_class_count += 1; }
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents:
diff changeset
    45
  uint64_t getElapsedTime() const           { return os::javaTimeMillis() - getStartTime(); }
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents:
diff changeset
    46
};
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents:
diff changeset
    47
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 50785
diff changeset
    48
#endif // SHARE_RUNTIME_THREADSTATISTICALINFO_HPP