2021-08-05 17:27:02 +08:00
|
|
|
|
|
|
|
|
#include <sys/resource.h>
|
|
|
|
|
|
2023-08-21 12:27:02 +08:00
|
|
|
#include "common/ratekeeper.h"
|
2022-05-18 14:11:57 -07:00
|
|
|
#include "common/util.h"
|
2022-06-02 17:02:25 -07:00
|
|
|
#include "system/proclogd/proclog.h"
|
2021-08-05 17:27:02 +08:00
|
|
|
|
|
|
|
|
ExitHandler do_exit;
|
|
|
|
|
|
|
|
|
|
int main(int argc, char **argv) {
|
|
|
|
|
setpriority(PRIO_PROCESS, 0, -15);
|
|
|
|
|
|
2023-08-21 12:27:02 +08:00
|
|
|
RateKeeper rk("proclogd", 0.5);
|
2021-08-05 17:27:02 +08:00
|
|
|
PubMaster publisher({"procLog"});
|
2023-08-21 12:27:02 +08:00
|
|
|
|
2021-08-05 17:27:02 +08:00
|
|
|
while (!do_exit) {
|
|
|
|
|
MessageBuilder msg;
|
|
|
|
|
buildProcLogMessage(msg);
|
|
|
|
|
publisher.send("procLog", msg);
|
|
|
|
|
|
2023-08-21 12:27:02 +08:00
|
|
|
rk.keepTime();
|
2021-08-05 17:27:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|