summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Vander Stoep2018-01-03 13:04:26 -0600
committerJeff Vander Stoep2018-01-03 14:52:58 -0600
commit54c7a5f1e7a0b3ce3df2b69129aff3477d2275d2 (patch)
treec33ab1a380292d04a224dfbd35879547e91d5541 /logd/libaudit.h
parent93d344d98cd02d66c3aac8067718be828ea283f9 (diff)
downloadplatform-system-core-54c7a5f1e7a0b3ce3df2b69129aff3477d2275d2.tar.gz
platform-system-core-54c7a5f1e7a0b3ce3df2b69129aff3477d2275d2.tar.xz
platform-system-core-54c7a5f1e7a0b3ce3df2b69129aff3477d2275d2.zip
LogAudit: remove dynamic rate limiter
Select a low rate-limit to cut down on logspam and resulting performance regressions. Functionally reverts 247d682fe1b0dd4c8f149b7f5c89c546df17873a (logd: sepolicy dynamic rate limiting) and sets a static low rate-limit. Before 247d682f, the limit was statically set to 20. 247d682f continued to support 20, but if sustained dropped the limit to 5. This revert leaves us at 5 so as not to impact performance. Test: /data/nativetest/logd-unit-tests/logd-unit-tests \ --gtest_filter=logd.sepolicy_rate_limiter [ PASSED ] 1 test. Bug: 71538411 Change-Id: I6c92f4ba825cc24beb8f1f1b79258fa8097c837b
Diffstat (limited to 'logd/libaudit.h')
-rw-r--r--logd/libaudit.h18
1 files changed, 2 insertions, 16 deletions
diff --git a/logd/libaudit.h b/logd/libaudit.h
index a2afe47b4..2a93ea361 100644
--- a/logd/libaudit.h
+++ b/logd/libaudit.h
@@ -89,22 +89,8 @@ extern int audit_get_reply(int fd, struct audit_message* rep, reply_t block,
89 */ 89 */
90extern int audit_setup(int fd, pid_t pid); 90extern int audit_setup(int fd, pid_t pid);
91 91
92/** 92/* Max audit messages per second */
93 * Sets the rate limit to receive audit netlink events from the kernel 93#define AUDIT_RATE_LIMIT 5
94 * @param fd
95 * The fd returned by a call to audit_open()
96 * @param max_rate
97 * The cap of the maximum number of audit messages a second
98 * @return
99 * This function returns 0 on success, -errno on error.
100 */
101
102/* Guidelines to follow for dynamic rate_limit */
103#define AUDIT_RATE_LIMIT_DEFAULT 20 /* acceptable burst rate */
104#define AUDIT_RATE_LIMIT_BURST_DURATION 10 /* number of seconds of burst */
105#define AUDIT_RATE_LIMIT_MAX 5 /* acceptable sustained rate */
106
107extern int audit_rate_limit(int fd, unsigned rate_limit);
108 94
109__END_DECLS 95__END_DECLS
110 96