Default system heap listener

How can a heap listener be used on the system heap?  That is, the system heap that is used for k_malloc() and k_free(), with size set in kconfig as follows.  The kconfig to enable the listener is also added

Fullscreen
1
2
CONFIG_HEAP_MEM_POOL_SIZE=/* size in bytes */
CONFIG_SYS_HEAP_LISTENER=y
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

In particular, I'm trying to find out what _heap_id should be used with the macros

Fullscreen
1
2
HEAP_LISTENER_ALLOC_DEFINE(name, _heap_id, _alloc_cb)
HEAP_LISTENER_FREE_DEFINE(name, _heap_id, _free_cb)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


I tried using "HEAP_ID_LIBC" for the _heap_id in the above listener define macros.  It builds, but no calls to the _alloc_cb or _free_cb functions occur, despite many uses of k_malloc() and k_free().  I would assume HEAP_ID_LIBC is for C library calls with malloc() and free(), and not the Zephyr memory pool heap functions k_malloc() and k_free().

What should be used for the heap ID with the heap memory pool?  Is there an example of using the heap listener API?

Thank you,

Walt