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 3fc7578

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

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

‎micropython/utop/utop.py‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,23 @@ def top(update_interval_ms=1000, timeout_ms=None, thread_names={}):
7777
micropython.mem_info()
7878
line_count += 3
7979

80+
if esp32 is not None:
81+
print("\x1b[K")
82+
line_count += 1
83+
for name, cap in (("data", esp32.HEAP_DATA), ("exec", esp32.HEAP_EXEC)):
84+
heaps = esp32.idf_heap_info(cap)
85+
print(
86+
"IDF heap ({}): {} regions, {} total, {} free, {} largest contiguous, {} min free watermark\x1b[K".format(
87+
name,
88+
len(heaps),
89+
sum((h[0] for h in heaps)),
90+
sum((h[1] for h in heaps)),
91+
max((h[2] for h in heaps)),
92+
sum((h[3] for h in heaps)),
93+
)
94+
)
95+
line_count += 1
96+
8097
if previous_line_count > line_count:
8198
for _ in range(previous_line_count - line_count):
8299
print("\x1b[K")

0 commit comments

Comments
(0)

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