]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Merge pull request #1867 in SNORT/snort3 from ~SHASLAD/snort3:bye_mallinfo to master
authorRuss Combs (rucombs) <rucombs@cisco.com>
Tue, 3 Dec 2019 03:11:27 +0000 (03:11 +0000)
committerRuss Combs (rucombs) <rucombs@cisco.com>
Tue, 3 Dec 2019 03:11:27 +0000 (03:11 +0000)
Squashed commit of the following:

commit f9c843c9d43a77883ed7fd8d7095f72c17ca31ca
Author: Shashi Lad <shaslad@cisco.com>
Date:   Tue Nov 26 13:23:05 2019 -0500

    stats: removal of mallinfo as it only support 32bit

cmake/sanity_checks.cmake
config.cmake.h.in
src/helpers/process.cc
src/helpers/process.h
src/utils/stats.cc

index 3f2a46b2019bf0c7f30dfb534be99732becdb768..8f2474fec7467e4cdfca3d3e840ed9543eac5227 100644 (file)
@@ -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)
index b1631abef18c1a4bc331483365d72f25b2c15a26..a4e20b6c3e7e6c13401d481876b55343b780a650 100644 (file)
 
 /*  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
 
index ef610238ff9938d0fe8ca24eb07bc8ef8dc7fa2e..e6ba9c63edf9d3c3bb168ca7ad64267a692052b2 100644 (file)
@@ -24,7 +24,7 @@
 
 #include <fcntl.h>
 
-#if defined(HAVE_MALLINFO) || defined(HAVE_MALLOC_TRIM)
+#if defined(HAVE_MALLOC_TRIM)
 #include <malloc.h>
 #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
-}
-
index d415586c498302e0b32ed9ed2d43d9a51185a8f7..4383ecb4562647ef0da935254d16c0ade76cbde5 100644 (file)
@@ -46,7 +46,6 @@ void set_quick_exit(bool);
 void set_main_thread();
 
 void trim_heap();
-void log_malloc_info();
 
 #endif
 
index f1ba9f64161c7279460c4da13e902e79ddb6a64a..3957b8da99cba043e22b2c84731f6eacf0468740 100644 (file)
@@ -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();
 }
 
 //-------------------------------------------------------------------------