Skip to content
Permalink
Browse files

8223968: Add abort type description to RTM statistic counters

Reviewed-by: mdoerr, kvn
  • Loading branch information
Gustavo Romero
Gustavo Romero committed May 10, 2019
1 parent 9d40ab9 commit 11d4e9f34d73d50c6b6572890dba3fe6c0cb5e6b
@@ -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 @@
* 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,15 +58,15 @@

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(
"(?<className>[^.\n]+)\\." +
"(?<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)+)");
}

0 comments on commit 11d4e9f

Please sign in to comment.
You can’t perform that action at this time.