OpenJDK / amber / amber
changeset 59257:61446ba18984
8223968: Add abort type description to RTM statistic counters
Reviewed-by: mdoerr, kvn
author | gromero |
---|---|
date | Fri, 10 May 2019 18:20:02 -0400 |
parents | 44aa31d0dea3 |
children | daf317439415 |
files | src/hotspot/share/runtime/rtmLocking.cpp src/hotspot/share/runtime/rtmLocking.hpp test/hotspot/jtreg/compiler/testlibrary/rtm/RTMLockingStatistics.java |
diffstat | 3 files changed, 23 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/src/hotspot/share/runtime/rtmLocking.cpp Mon Dec 09 15:37:04 2019 +0100 +++ b/src/hotspot/share/runtime/rtmLocking.cpp Fri May 10 18:20:02 2019 -0400 @@ -55,12 +55,21 @@ } } +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); }
--- a/src/hotspot/share/runtime/rtmLocking.hpp Mon Dec 09 15:37:04 2019 +0100 +++ b/src/hotspot/share/runtime/rtmLocking.hpp Fri May 10 18:20:02 2019 -0400 @@ -82,6 +82,7 @@ // 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;
--- a/test/hotspot/jtreg/compiler/testlibrary/rtm/RTMLockingStatistics.java Mon Dec 09 15:37:04 2019 +0100 +++ b/test/hotspot/jtreg/compiler/testlibrary/rtm/RTMLockingStatistics.java Fri May 10 18:20:02 2019 -0400 @@ -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,7 +58,7 @@ 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 @@ "(?<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)+)"); }