diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-20 00:22:53 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-20 00:22:53 -0400 |
commit | 257313b2a87795e07a0bdf58d0fffbdba8b31051 (patch) | |
tree | ff5043526b0381cdc1f1f68d3c6f8ed3635e0ddb /security/selinux/selinuxfs.c | |
parent | 044aea9b83614948c98564000db07d1d32b2d29b (diff) |
selinux: avoid unnecessary avc cache stat hit count
There is no point in counting hits - we can calculate it from the number
of lookups and misses.
This makes the avc statistics a bit smaller, and makes the code
generation better too.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'security/selinux/selinuxfs.c')
-rw-r--r-- | security/selinux/selinuxfs.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c index ea39cb742ae5..c0e1a0f52462 100644 --- a/security/selinux/selinuxfs.c +++ b/security/selinux/selinuxfs.c | |||
@@ -1380,10 +1380,14 @@ static int sel_avc_stats_seq_show(struct seq_file *seq, void *v) | |||
1380 | if (v == SEQ_START_TOKEN) | 1380 | if (v == SEQ_START_TOKEN) |
1381 | seq_printf(seq, "lookups hits misses allocations reclaims " | 1381 | seq_printf(seq, "lookups hits misses allocations reclaims " |
1382 | "frees\n"); | 1382 | "frees\n"); |
1383 | else | 1383 | else { |
1384 | seq_printf(seq, "%u %u %u %u %u %u\n", st->lookups, | 1384 | unsigned int lookups = st->lookups; |
1385 | st->hits, st->misses, st->allocations, | 1385 | unsigned int misses = st->misses; |
1386 | unsigned int hits = lookups - misses; | ||
1387 | seq_printf(seq, "%u %u %u %u %u %u\n", lookups, | ||
1388 | hits, misses, st->allocations, | ||
1386 | st->reclaims, st->frees); | 1389 | st->reclaims, st->frees); |
1390 | } | ||
1387 | return 0; | 1391 | return 0; |
1388 | } | 1392 | } |
1389 | 1393 | ||