Skip to contentSkip to conversation

libselinux: disable filespec hash table stats on non-debug builds

PATCH In review Stephen Smalley 2 participants 2 messages Jan 24, 2017 – Jan 25, 2017 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libselinux: disable filespec hash table stats on non-debug builds

Disable generating filespec hash table stats on non-debug builds, as they are not useful information for users and cause fixfiles check to produce noisy output.

---
 libselinux/src/selinux_restorecon.c | 6 ++++++
 1 file changed, 6 insertions(+)
libselinux/src/selinux_restorecon.c +6 -0
index 7020669..38acbd2 100644
@@ -487,6 +487,7 @@ oom:
 /*
  * Evaluate the association hash table distribution.
  */
+#ifdef DEBUG
 static void filespec_eval(void)
 {
 	file_spec_t *fl;
@@ -513,6 +514,11 @@ static void filespec_eval(void)
 		     "filespec hash table stats: %d elements, %d/%d buckets used, longest chain length %d\n",
 		     nel, used, HASH_BUCKETS, longest);
 }
+#else
+static void filespec_eval(void)
+{
+}
+#endif
 
 /*
  * Destroy the association hash table.
Signature · 1 line
2.7.4
#1 lore raw
Quoted 6 lines · Stephen Smalley

Disable generating filespec hash table stats on non-debug builds, as they are not useful information for users and cause fixfiles check to produce noisy output.

Thanks!
This patch looks exactly how I would want.

Quoted 28 lines
---
  libselinux/src/selinux_restorecon.c | 6 ++++++
  1 file changed, 6 insertions(+)
libselinux/src/selinux_restorecon.c +6 -0
index 7020669..38acbd2 100644
@@ -487,6 +487,7 @@ oom:
  /*
   * Evaluate the association hash table distribution.
   */
+#ifdef DEBUG
  static void filespec_eval(void)
  {
  	file_spec_t *fl;
@@ -513,6 +514,11 @@ static void filespec_eval(void)
  		     "filespec hash table stats: %d elements, %d/%d buckets used, longest chain length %d\n",
  		     nel, used, HASH_BUCKETS, longest);
  }
+#else
+static void filespec_eval(void)
+{
+}
+#endif
 
  /*
   * Destroy the association hash table.