summaryrefslogtreecommitdiff
path: root/nptl/test-mutex-printers.py
diff options
context:
space:
mode:
authorTorvald Riegel <triegel@redhat.com>2017-01-20 14:54:49 +0100
committerTorvald Riegel <triegel@redhat.com>2017-01-20 14:56:39 +0100
commit6d523660e9f9f18e6c497d2d882c644e9c1b1c29 (patch)
tree407df07601c4e03c4e8679c2f0b1bd1cffc6a6c3 /nptl/test-mutex-printers.py
parent03b007771beb4dba3b16d6097a53bfa328a78efb (diff)
Fix mutex pretty printer test and pretty printer output.
This fixes the mutex pretty printer so that, if the owner ID isn't recorded (such as in the current lock elision implementation), "Owner ID" will be shown as "Unknown" instead of 0. It also changes the mutex printer output so that it says "Acquired" instead of "Locked". The mutex tests are updated accordingly. In addition, this adds a paragraph to the "Known issues" section of the printers README explaining that the printer output isn't guaranteed to cover every detail. 2017-01-14 Martin Galvan <martingalvan@sourceware.org> * README.pretty-printers (Known issues): Warn about printers not always covering everything. * nptl/nptl-printers.py (MutexPrinter): Change output. * nptl/test-mutex-printers.py: Fix test and adapt to changed output.
Diffstat (limited to 'nptl/test-mutex-printers.py')
-rw-r--r--nptl/test-mutex-printers.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/nptl/test-mutex-printers.py b/nptl/test-mutex-printers.py
index 23f16b0b71..687a32c4f7 100644
--- a/nptl/test-mutex-printers.py
+++ b/nptl/test-mutex-printers.py
@@ -39,15 +39,18 @@ try:
break_at(test_source, 'Test status (non-robust)')
continue_cmd() # Go to test_status_no_robust
- test_printer(var, to_string, {'Status': 'Unlocked'})
+ test_printer(var, to_string, {'Status': 'Not acquired'})
next_cmd()
thread_id = get_current_thread_lwpid()
- test_printer(var, to_string, {'Status': 'Locked, possibly with no waiters',
- 'Owner ID': thread_id})
+ # Owner ID might be reported either as the thread ID or as "Unknown"
+ # (if e.g. lock elision is enabled).
+ test_printer(var, to_string,
+ {'Status': 'Acquired, possibly with no waiters',
+ 'Owner ID': r'({0}|Unknown)'.format(thread_id)})
break_at(test_source, 'Test status (robust)')
continue_cmd() # Go to test_status_robust
- test_printer(var, to_string, {'Status': 'Unlocked'})
+ test_printer(var, to_string, {'Status': 'Not acquired'})
# We'll now test the robust mutex locking states. We'll create a new
# thread that will lock a robust mutex and exit without unlocking it.
@@ -75,15 +78,15 @@ try:
test_printer(var, to_string, {'Owner ID': thread_id,
'State protected by this mutex': 'Inconsistent'})
next_cmd()
- test_printer(var, to_string, {'Status': 'Unlocked',
+ test_printer(var, to_string, {'Status': 'Not acquired',
'State protected by this mutex': 'Not recoverable'})
set_scheduler_locking(False)
break_at(test_source, 'Test recursive locks')
continue_cmd() # Go to test_recursive_locks
- test_printer(var, to_string, {'Times locked recursively': '2'})
+ test_printer(var, to_string, {'Times acquired by the owner': '2'})
next_cmd()
- test_printer(var, to_string, {'Times locked recursively': '3'})
+ test_printer(var, to_string, {'Times acquired by the owner': '3'})
continue_cmd() # Exit
except (NoLineError, pexpect.TIMEOUT) as exception: