From: Russ Combs (rucombs) Date: Tue, 3 Dec 2019 03:11:27 +0000 (+0000) Subject: Merge pull request #1867 in SNORT/snort3 from ~SHASLAD/snort3:bye_mallinfo to master X-Git-Tag: 3.0.0-266~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3acbbf9064cbe401bed69411574798076404e70d;p=thirdparty%2Fsnort3.git Merge pull request #1867 in SNORT/snort3 from ~SHASLAD/snort3:bye_mallinfo to master Squashed commit of the following: commit f9c843c9d43a77883ed7fd8d7095f72c17ca31ca Author: Shashi Lad Date: Tue Nov 26 13:23:05 2019 -0500 stats: removal of mallinfo as it only support 32bit --- diff --git a/cmake/sanity_checks.cmake b/cmake/sanity_checks.cmake index 3f2a46b20..8f2474fec 100644 --- a/cmake/sanity_checks.cmake +++ b/cmake/sanity_checks.cmake @@ -13,7 +13,6 @@ test_big_endian(WORDS_BIGENDIAN) # Checks for system library functions #-------------------------------------------------------------------------- -check_function_exists(mallinfo HAVE_MALLINFO) check_function_exists(malloc_trim HAVE_MALLOC_TRIM) check_function_exists(memrchr HAVE_MEMRCHR) check_function_exists(sigaction HAVE_SIGACTION) diff --git a/config.cmake.h.in b/config.cmake.h.in index b1631abef..a4e20b6c3 100644 --- a/config.cmake.h.in +++ b/config.cmake.h.in @@ -136,9 +136,6 @@ /* Availability of specific library functions */ -/* Define to 1 if you have the `mallinfo' function. */ -#cmakedefine HAVE_MALLINFO 1 - /* Define to 1 if you have the `malloc_trim' function. */ #cmakedefine HAVE_MALLOC_TRIM 1 diff --git a/src/helpers/process.cc b/src/helpers/process.cc index ef610238f..e6ba9c63e 100644 --- a/src/helpers/process.cc +++ b/src/helpers/process.cc @@ -24,7 +24,7 @@ #include -#if defined(HAVE_MALLINFO) || defined(HAVE_MALLOC_TRIM) +#if defined(HAVE_MALLOC_TRIM) #include #endif @@ -376,26 +376,3 @@ void trim_heap() malloc_trim(0); #endif } - -void log_malloc_info() -{ -#ifdef HAVE_MALLINFO - struct mallinfo mi = mallinfo(); - - LogLabel("heap usage"); - LogCount("total non-mmapped bytes", mi.arena); - LogCount("bytes in mapped regions", mi.hblkhd); - LogCount("total allocated space", mi.uordblks); - LogCount("total free space", mi.fordblks); - LogCount("topmost releasable block", mi.keepcost); - -#ifdef DEBUG - LogCount("free chunks", mi.ordblks); - LogCount("free fastbin blocks", mi.smblks); - LogCount("mapped regions", mi.hblks); - LogCount("max total alloc space", mi.usmblks); - LogCount("free bytes in fastbins", mi.fsmblks); -#endif -#endif -} - diff --git a/src/helpers/process.h b/src/helpers/process.h index d415586c4..4383ecb45 100644 --- a/src/helpers/process.h +++ b/src/helpers/process.h @@ -46,7 +46,6 @@ void set_quick_exit(bool); void set_main_thread(); void trim_heap(); -void log_malloc_info(); #endif diff --git a/src/utils/stats.cc b/src/utils/stats.cc index f1ba9f641..3957b8da9 100644 --- a/src/utils/stats.cc +++ b/src/utils/stats.cc @@ -228,8 +228,6 @@ void DropStats() LogLabel("Summary Statistics"); show_stats((PegCount*)&proc_stats, proc_names, array_size(proc_names)-1, "process"); - if ( SnortConfig::log_verbose() ) - log_malloc_info(); } //-------------------------------------------------------------------------