Topic: Check for RAM usage during handshake runtime

I am using wolfssl on Zephyr and would like to check the RAM usage during runtime, in particular the maximum RAM used during a DTLS Handshake.
Is there a way to do that in wolfssl?

Share

Re: Check for RAM usage during handshake runtime

Hello Sunnysunday,
My name is Anthony and I am a member of the wolfSSL team.  Please try defining the following macros in your user_settings.h file:


WOLFSSL_TRACK_MEMORY
WOLFSSL_TRACK_MEMORY_VERBOSE

Let me know if that gives you the desired output.

Warm regards, Anthony

Share

Re: Check for RAM usage during handshake runtime

Sunnysunday,

Can you please let me know a bit about what you are trying to do?  What are your goals?  Is this project out of academic, professional or personal interest?

Warm regards, Anthony

Share

4 (edited by Sunnysunday 2024-12-30 13:40:46)

Re: Check for RAM usage during handshake runtime

Hi Anthony,

Thank you for your answer. My project is academic. I am integrating wolfssl into an application on the nRF9160dk.

With

#define WOLFSSL_TRACK_MEMORY

I get a compile error:

In file included from C:/ncs/v2.8.0/modules/crypto/wolfssl/wolfcrypt/src/wc_port.c:31:
C:/ncs/v2.8.0/modules/crypto/wolfssl/wolfssl/wolfcrypt/mem_track.h: In function 'TrackMalloc':
C:/ncs/v2.8.0/modules/crypto/wolfssl/wolfssl/wolfcrypt/mem_track.h:181:29: error: 'memLock' undeclared (first use in this function)
    if (pthread_mutex_lock(&memLock) == 0)

Is memlock a variable I need to declare in my user_settings file or in main.c?

Share