Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 2cbdcf5

Browse files
utop: Print IDF heap details.
Signed-off-by: Daniël van de Giessen <daniel@dvdgiessen.nl>
1 parent 2aa5438 commit 2cbdcf5

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

‎micropython/utop/utop.py‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,21 @@ def top(update_interval_ms=1000, timeout_ms=None):
5555
print('INFO: Platform does not support listing active tasks.\x1B[K')
5656
line_count += 1
5757

58+
if esp32 is not None:
59+
print('\x1B[K')
60+
line_count += 1
61+
for name, cap in (('data', esp32.HEAP_DATA), ('exec', esp32.HEAP_EXEC)):
62+
heaps = esp32.idf_heap_info(cap)
63+
print('IDF heap ({}): {} regions, {} total, {} free, {} largest contiguous, {} min free watermark\x1B[K'.format(
64+
name,
65+
len(heaps),
66+
sum((h[0] for h in heaps)),
67+
sum((h[1] for h in heaps)),
68+
max((h[2] for h in heaps)),
69+
sum((h[3] for h in heaps))
70+
))
71+
line_count += 1
72+
5873
if previous_line_count > line_count:
5974
for _ in range(previous_line_count - line_count):
6075
print('\x1B[K')

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /