selinux: print sum of chain lengths^2 for hash tables
authorChristian Göttsche <cgzones@googlemail.com>
Fri, 18 Aug 2023 15:12:18 +0000 (17:12 +0200)
committerPaul Moore <paul@paul-moore.com>
Wed, 13 Sep 2023 17:46:56 +0000 (13:46 -0400)
commitfb8142ff4a642f14c4805980efb7531854c5dbdf
treeec398363245cc9c291949eb844a095cd067f899e
parent34df25517a9bbec3436ab6f53074bcce9dc3eafc
selinux: print sum of chain lengths^2 for hash tables

Print the sum of chain lengths squared as a metric for hash tables to
provide more insights, similar to avtabs.

While on it add a comma in the avtab message to improve readability of
the output.

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
Reviewed-by: Stephen Smalley <stephen.smalley.work@gmail.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
security/selinux/ss/avtab.c
security/selinux/ss/hashtab.c
security/selinux/ss/hashtab.h
security/selinux/ss/policydb.c