Debian Codegraph @

libselinux/man/man3/avc_cache_stats.3

raw
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\"
3 .\" Author: Eamon Walsh ([email protected]) 2004
4 .TH "avc_cache_stats" "3" "27 May 2004" "" "SELinux API documentation"
5 .SH "NAME"
6 avc_cache_stats, avc_av_stats, avc_sid_stats \- obtain userspace SELinux AVC statistics
7 .
8 .SH "SYNOPSIS"
9 .B #include <selinux/selinux.h>
10 .br
11 .B #include <selinux/avc.h>
12 .sp
13 .BI "void avc_av_stats(void);"
14 .sp
15 .BI "void avc_sid_stats(void);"
16 .sp
17 .BI "void avc_cache_stats(struct avc_cache_stats *" stats ");"
18 .
19 .SH "DESCRIPTION"
20 The userspace AVC maintains two internal hash tables, one to store security ID's and one to cache access decisions.
21
22 .BR avc_av_stats ()
23 and
24 .BR avc_sid_stats ()
25 produce log messages indicating the status of the access decision and SID tables, respectively. The messages contain the number of entries in the table, number of hash buckets and number of buckets used, and maximum number of entries in a single bucket.
26
27 .BR avc_cache_stats ()
28 populates a structure whose fields reflect cache activity:
29
30 .RS
31 .ta 4n 14n
32 .nf
33 struct avc_cache_stats {
34 unsigned entry_lookups;
35 unsigned entry_hits;
36 unsigned entry_misses;
37 unsigned entry_discards;
38 unsigned cav_lookups;
39 unsigned cav_hits;
40 unsigned cav_probes;
41 unsigned cav_misses;
42 };
43 .fi
44 .ta
45 .RE
46
47 .TP
48 .I entry_lookups
49 Number of queries made.
50 .TP
51 .I entry_hits
52 Number of times a decision was found in the
53 .I aeref
54 argument.
55 .TP
56 .I entry_misses
57 Number of times a decision was not found in the
58 .I aeref
59 argument.
60 .TP
61 .I entry_discards
62 Number of times a decision was not found in the
63 .I aeref
64 argument and the
65 .I aeref
66 argument was non-NULL.
67 .TP
68 .I cav_lookups
69 Number of cache lookups.
70 .TP
71 .I cav_hits
72 Number of cache hits.
73 .TP
74 .I cav_misses
75 Number of cache misses.
76 .TP
77 .I cav_probes
78 Number of entries examined while searching the cache.
79 .
80 .SH "NOTES"
81 When the cache is flushed as a result of a call to
82 .BR avc_reset ()
83 or a policy change notification,
84 the statistics returned by
85 .BR avc_cache_stats ()
86 are reset to zero. The SID table, however, is left
87 unchanged.
88
89 When a policy change notification is received, a call to
90 .BR avc_av_stats ()
91 is made before the cache is flushed.
92 .
93 .SH "AUTHOR"
94 Eamon Walsh <[email protected]>
95 .
96 .SH "SEE ALSO"
97 .ad l
98 .nh
99 .BR avc_init (3),
100 .BR avc_has_perm (3),
101 .BR avc_context_to_sid (3),
102 .BR avc_add_callback (3),
103 .BR selinux (8)