Skip to content

Commit

Permalink
Fixing parsing of memory of metrics.
Browse files Browse the repository at this point in the history
In mbed OS versions 5.4.x and older, memory metrics were printed in a
format that always included a hyphenated thread "entry" and "argument".
In the coming 5.5 release, this doesn't appear to be the case, only
containing the "entry". This PR allows greentea to parse both cases.
  • Loading branch information
bridadan committed Jun 8, 2017
1 parent a019601 commit 67046da
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions mbed_greentea/mbed_test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,14 +536,17 @@ def get_memory_metrics(output):
thread_stack_size = int(thread_stack_size)
thread_entry_arg_split = thread_entry_arg.split('-')
thread_entry = thread_entry_arg_split[0]
thread_arg = thread_entry_arg_split[1]

thread_info[thread_entry_arg] = {
'entry': thread_entry,
'arg': thread_arg,
'max_stack': thread_max_stack,
'stack_size': thread_stack_size
}

if len(thread_entry_arg_split) > 1:
thread_arg = thread_entry_arg_split[1]
thread_info[thread_entry_arg]['arg'] = thread_arg

thread_info_list = thread_info.values()

return max_heap_usage, thread_info_list
Expand Down

0 comments on commit 67046da

Please sign in to comment.