summaryrefslogtreecommitdiff
path: root/security/selinux/ss/policydb.c
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2023-08-18 18:12:18 +0300
committerPaul Moore <paul@paul-moore.com>2023-09-13 20:46:56 +0300
commitfb8142ff4a642f14c4805980efb7531854c5dbdf (patch)
treeec398363245cc9c291949eb844a095cd067f899e /security/selinux/ss/policydb.c
parent34df25517a9bbec3436ab6f53074bcce9dc3eafc (diff)
downloadlinux-fb8142ff4a642f14c4805980efb7531854c5dbdf.tar.xz
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>
Diffstat (limited to 'security/selinux/ss/policydb.c')
-rw-r--r--security/selinux/ss/policydb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/security/selinux/ss/policydb.c b/security/selinux/ss/policydb.c
index 2d528f699a22..d420c6c12f54 100644
--- a/security/selinux/ss/policydb.c
+++ b/security/selinux/ss/policydb.c
@@ -684,9 +684,9 @@ static void hash_eval(struct hashtab *h, const char *hash_name)
struct hashtab_info info;
hashtab_stat(h, &info);
- pr_debug("SELinux: %s: %d entries and %d/%d buckets used, longest chain length %d\n",
+ pr_debug("SELinux: %s: %d entries and %d/%d buckets used, longest chain length %d, sum of chain length^2 %llu\n",
hash_name, h->nel, info.slots_used, h->size,
- info.max_chain_len);
+ info.max_chain_len, info.chain2_len_sum);
}
static void symtab_hash_eval(struct symtab *s)