mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-04 13:10:15 +00:00
8223968: Add abort type description to RTM statistic counters
Reviewed-by: mdoerr, kvn
This commit is contained in:
parent
9d40ab91db
commit
11d4e9f34d
@ -55,12 +55,21 @@ void RTMLockingCounters::init() {
|
||||
}
|
||||
}
|
||||
|
||||
const char* RTMLockingCounters::_abortX_desc[ABORT_STATUS_LIMIT] = {
|
||||
"abort instruction ",
|
||||
"may succeed on retry",
|
||||
"thread conflict ",
|
||||
"buffer overflow ",
|
||||
"debug or trap hit ",
|
||||
"maximum nested depth"
|
||||
};
|
||||
|
||||
//------------------------------print_on-------------------------------
|
||||
void RTMLockingCounters::print_on(outputStream* st) const {
|
||||
tty->print_cr("# rtm locks total (estimated): " UINTX_FORMAT, _total_count * RTMTotalCountIncrRate);
|
||||
tty->print_cr("# rtm lock aborts : " UINTX_FORMAT, _abort_count);
|
||||
tty->print_cr("# rtm lock aborts (total): " UINTX_FORMAT, _abort_count);
|
||||
for (int i = 0; i < ABORT_STATUS_LIMIT; i++) {
|
||||
tty->print_cr("# rtm lock aborts %d: " UINTX_FORMAT, i, _abortX_count[i]);
|
||||
tty->print_cr("# rtm lock aborts %d (%s): " UINTX_FORMAT, i, _abortX_desc[i], _abortX_count[i]);
|
||||
}
|
||||
}
|
||||
void RTMLockingCounters::print() const { print_on(tty); }
|
||||
|
||||
@ -82,6 +82,7 @@ class RTMLockingCounters {
|
||||
// 5 Set if an abort occurred during execution of a nested transaction.
|
||||
private:
|
||||
uintx _abortX_count[ABORT_STATUS_LIMIT];
|
||||
static const char* _abortX_desc[ABORT_STATUS_LIMIT];
|
||||
|
||||
public:
|
||||
static uintx _calculation_flag;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -36,14 +36,14 @@ import java.util.regex.Pattern;
|
||||
* Example of locking statistics:
|
||||
*
|
||||
* java/lang/ClassLoader.loadClass@7
|
||||
* # rtm locks total (estimated): 0
|
||||
* # rtm lock aborts : 13
|
||||
* # rtm lock aborts 0: 12
|
||||
* # rtm lock aborts 1: 0
|
||||
* # rtm lock aborts 2: 0
|
||||
* # rtm lock aborts 3: 0
|
||||
* # rtm lock aborts 4: 0
|
||||
* # rtm lock aborts 5: 0
|
||||
* # rtm locks total (estimated): 6656
|
||||
* # rtm lock aborts (total): 10000
|
||||
* # rtm lock aborts 0 (abort instruction ): 9999
|
||||
* # rtm lock aborts 1 (may succeed on retry): 9999
|
||||
* # rtm lock aborts 2 (thread conflict ): 0
|
||||
* # rtm lock aborts 3 (buffer overflow ): 1
|
||||
* # rtm lock aborts 4 (debug or trap hit ): 0
|
||||
* # rtm lock aborts 5 (maximum nested depth): 0
|
||||
*/
|
||||
public class RTMLockingStatistics {
|
||||
/**
|
||||
@ -58,7 +58,7 @@ public class RTMLockingStatistics {
|
||||
|
||||
static {
|
||||
String abortRe
|
||||
= "# rtm lock aborts\\s+(?<type>[0-9]+):\\s(?<count>[0-9]+)";
|
||||
= "# rtm lock aborts\\s+(?<type>[0-9]+)\\s+\\([a-z\\s]+\\):\\s(?<count>[0-9]+)";
|
||||
|
||||
ABORT_PATTERN = Pattern.compile(abortRe);
|
||||
RTM_LOCKING_STATISTICS_PATTERN = Pattern.compile(
|
||||
@ -66,7 +66,7 @@ public class RTMLockingStatistics {
|
||||
"(?<methodName>[^@\n]+)@(?<bci>[0-9]+)\n" +
|
||||
"# rtm locks total \\(estimated\\):\\s*" +
|
||||
"(?<totalLocks>[0-9]+)\n" +
|
||||
"# rtm lock aborts\\s+:\\s*(?<totalAborts>[0-9]+)\n" +
|
||||
"# rtm lock aborts\\s+\\(total\\):\\s*(?<totalAborts>[0-9]+)\n" +
|
||||
"(?<abortStats>(" + abortRe + "\n)+)");
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user