From: Michal Bloch Date: Tue, 12 May 2020 12:51:09 +0000 (+0200) Subject: logger: optimize reader time book-keeping X-Git-Tag: accepted/tizen/unified/20200529.124143~11^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9077f1ce083d6fd1010845497a70dc0709e7e207;p=platform%2Fcore%2Fsystem%2Fdlog.git logger: optimize reader time book-keeping Change-Id: I8449236f1c15261aa7550f175de1942b519ecbc1 Signed-off-by: Michal Bloch --- diff --git a/src/logger/logger.c b/src/logger/logger.c index 2cdd3d7..33082ca 100644 --- a/src/logger/logger.c +++ b/src/logger/logger.c @@ -1092,7 +1092,8 @@ static int parse_command_line(const char *cmdl, struct writer *wr, struct logger reader->partial_log_size = 0; reader->service_reader = NULL; reader->log_storage_reader = NULL; - clock_gettime(CLOCK_MONOTONIC, &reader->last_read_time); + reader->last_read_time.tv_sec = server->now.tv_sec; + reader->last_read_time.tv_nsec = server->now.tv_nsec; static const struct option long_options[] = { {"tid", required_argument, NULL, 0}, @@ -2275,6 +2276,9 @@ static int finalize_init(struct logger_config_data *data, struct logger *server) if (r < 0) return r; + // used to populate the first readers + clock_gettime(CLOCK_MONOTONIC, &server->now); + //create files after resetting self privileges list_foreach(data->logfile_configs, server, parse_logfile_config);