mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-21 12:54:56 +00:00
astobj2: Record lock usage to refs log when DEBUG_THREADS is enabled.
When DEBUG_THREADS is enabled we can know if the astobj2 mutex / rwlock was ever used, so it can be recorded in the REF_DEBUG destructor entry. Create contrib/scripts/reflocks.py to process locking used by allocator. This can be used to identify places where AO2_ALLOC_OPT_LOCK_NOLOCK should be used to reduce memory usage. Change-Id: I2e3cd23336a97df2692b545f548fd79b14b53bf4
This commit is contained in:
@@ -108,6 +108,10 @@ def process_file(options):
|
||||
else:
|
||||
current_objects[obj]['curcount'] += int(parsed_line['delta'])
|
||||
|
||||
if 'destructor' in parsed_line['state']:
|
||||
# refcounter.py doesn't care about lock-state.
|
||||
parsed_line['state'] = '**destructor**'
|
||||
|
||||
current_objects[obj]['log'].append(
|
||||
"[%s] %s:%s %s: %s %s - [%s]" % (
|
||||
parsed_line['thread_id'],
|
||||
|
Reference in New Issue
Block a user