forked from wolfSSL/wolfssl
Merge pull request #931 from JacobBarthelmeh/Memory
add trackmemory enable option
This commit is contained in:
20
configure.ac
20
configure.ac
@@ -1244,7 +1244,7 @@ fi
|
|||||||
|
|
||||||
# STACK SIZE info for examples
|
# STACK SIZE info for examples
|
||||||
AC_ARG_ENABLE([stacksize],
|
AC_ARG_ENABLE([stacksize],
|
||||||
[ --enable-stacksize Enable stack size info on examples (default: disabled)],
|
[AS_HELP_STRING([--enable-stacksize],[Enable stack size info on examples (default: disabled)])],
|
||||||
[ ENABLED_STACKSIZE=$enableval ],
|
[ ENABLED_STACKSIZE=$enableval ],
|
||||||
[ ENABLED_STACKSIZE=no ]
|
[ ENABLED_STACKSIZE=no ]
|
||||||
)
|
)
|
||||||
@@ -1279,6 +1279,24 @@ fi
|
|||||||
AM_CONDITIONAL([BUILD_MEMORY], [test "x$ENABLED_MEMORY" = "xyes"])
|
AM_CONDITIONAL([BUILD_MEMORY], [test "x$ENABLED_MEMORY" = "xyes"])
|
||||||
|
|
||||||
|
|
||||||
|
# MEMORY SIZE info
|
||||||
|
AC_ARG_ENABLE([trackmemory],
|
||||||
|
[AS_HELP_STRING([--enable-trackmemory],[Enable memory use info on wolfCrypt and wolfSSL cleanup (default: disabled)])],
|
||||||
|
[ ENABLED_TRACKMEMORY=$enableval ],
|
||||||
|
[ ENABLED_TRACKMEMORY=no ]
|
||||||
|
)
|
||||||
|
|
||||||
|
if test "$ENABLED_TRACKMEMORY" = "yes"
|
||||||
|
then
|
||||||
|
if test "$ENABLED_MEMORY" = "yes"
|
||||||
|
then
|
||||||
|
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_TRACK_MEMORY"
|
||||||
|
else
|
||||||
|
AC_MSG_ERROR([trackmemory requires using wolfSSL memory (--enable-memory).])
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
# RSA
|
# RSA
|
||||||
AC_ARG_ENABLE([rsa],
|
AC_ARG_ENABLE([rsa],
|
||||||
[ --enable-rsa Enable RSA (default: enabled)],
|
[ --enable-rsa Enable RSA (default: enabled)],
|
||||||
|
@@ -265,7 +265,6 @@ static void Usage(void)
|
|||||||
printf("-d Disable client cert check\n");
|
printf("-d Disable client cert check\n");
|
||||||
printf("-b Bind to any interface instead of localhost only\n");
|
printf("-b Bind to any interface instead of localhost only\n");
|
||||||
printf("-s Use pre Shared keys\n");
|
printf("-s Use pre Shared keys\n");
|
||||||
printf("-t Track wolfSSL memory use\n");
|
|
||||||
printf("-u Use UDP DTLS,"
|
printf("-u Use UDP DTLS,"
|
||||||
" add -v 2 for DTLSv1, -v 3 for DTLSv1.2 (default)\n");
|
" add -v 2 for DTLSv1, -v 3 for DTLSv1.2 (default)\n");
|
||||||
#ifdef WOLFSSL_SCTP
|
#ifdef WOLFSSL_SCTP
|
||||||
|
@@ -219,15 +219,15 @@
|
|||||||
STATIC INLINE void ShowMemoryTracker(void)
|
STATIC INLINE void ShowMemoryTracker(void)
|
||||||
{
|
{
|
||||||
#ifdef DO_MEM_STATS
|
#ifdef DO_MEM_STATS
|
||||||
printf("total Allocs = %9lu\n",
|
printf("total Allocs = %9lu\n",
|
||||||
(unsigned long)ourMemStats.totalAllocs);
|
(unsigned long)ourMemStats.totalAllocs);
|
||||||
printf("total Deallocs = %9lu\n",
|
printf("total Deallocs = %9lu\n",
|
||||||
(unsigned long)ourMemStats.totalDeallocs);
|
(unsigned long)ourMemStats.totalDeallocs);
|
||||||
printf("total Bytes = %9lu\n",
|
printf("total Bytes = %9lu\n",
|
||||||
(unsigned long)ourMemStats.totalBytes);
|
(unsigned long)ourMemStats.totalBytes);
|
||||||
printf("peak Bytes = %9lu\n",
|
printf("peak Bytes = %9lu\n",
|
||||||
(unsigned long)ourMemStats.peakBytes);
|
(unsigned long)ourMemStats.peakBytes);
|
||||||
printf("current Bytes = %9lu\n",
|
printf("current Bytes = %9lu\n",
|
||||||
(unsigned long)ourMemStats.currentBytes);
|
(unsigned long)ourMemStats.currentBytes);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user