diff mbox

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

Message ID 1485287190-476-1-git-send-email-sds@tycho.nsa.gov (mailing list archive)
State Not Applicable
Headers show

Commit Message

Stephen Smalley Jan. 24, 2017, 7:46 p.m. UTC
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.

Reported-by: Alan Jenkins <alan.christopher.jenkins@gmail.com>
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
---
 libselinux/src/selinux_restorecon.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Alan Jenkins Jan. 25, 2017, 12:07 a.m. UTC | #1
On 24/01/17 19:46, Stephen Smalley wrote:
> 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.
>
> Reported-by: Alan Jenkins <alan.christopher.jenkins@gmail.com>
> Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>

Thanks!
This patch looks exactly how I would want.

> ---
>   libselinux/src/selinux_restorecon.c | 6 ++++++
>   1 file changed, 6 insertions(+)
>
> diff --git a/libselinux/src/selinux_restorecon.c b/libselinux/src/selinux_restorecon.c
> index 7020669..38acbd2 100644
> --- a/libselinux/src/selinux_restorecon.c
> +++ b/libselinux/src/selinux_restorecon.c
> @@ -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.
diff mbox

Patch

diff --git a/libselinux/src/selinux_restorecon.c b/libselinux/src/selinux_restorecon.c
index 7020669..38acbd2 100644
--- a/libselinux/src/selinux_restorecon.c
+++ b/libselinux/src/selinux_restorecon.c
@@ -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.