mirror of
https://github.com/apache/nuttx.git
synced 2026-05-21 21:34:07 +08:00
driver/ramlog: Implement the rate limiting function for ramlog driver.
Limit the maximum number of log entries allowed within the specified time interval in seconds. Signed-off-by: yukangzhi <yukangzhi@xiaomi.com>
This commit is contained in:
@@ -88,6 +88,11 @@
|
||||
|
||||
#define SYSLOGIOC_SETFILTER _SYSLOGIOC(0x0002)
|
||||
|
||||
/* Set/Get syslog ratelimit */
|
||||
|
||||
#define SYSLOGIOC_SETRATELIMIT _SYSLOGIOC(0x0003)
|
||||
#define SYSLOGIOC_GETRATELIMIT _SYSLOGIOC(0x0004)
|
||||
|
||||
#define SYSLOG_CHANNEL_NAME_LEN 32
|
||||
|
||||
#define SYSLOG_CHANNEL_DISABLE 0x01
|
||||
@@ -127,6 +132,12 @@ struct syslog_channel_ops_s
|
||||
syslog_close_t sc_close; /* Channel close callback */
|
||||
};
|
||||
|
||||
struct syslog_ratelimit_s
|
||||
{
|
||||
unsigned int interval; /* The interval in seconds */
|
||||
unsigned int burst; /* The max allowed note number during interval */
|
||||
};
|
||||
|
||||
struct syslog_channel_info_s
|
||||
{
|
||||
char sc_name[SYSLOG_CHANNEL_NAME_LEN];
|
||||
|
||||
Reference in New Issue
Block a user