From 4f3e46fec2846097f9d2c3c0aa66a1b3a85fc815 Mon Sep 17 00:00:00 2001 From: Mateusz Majewski Date: Thu, 9 Jan 2020 12:49:31 +0100 Subject: [PATCH] Rename dlogutil_entry_ts to dlogutil_entry_get_ts This is to fit Tizen's guidelines better. Change-Id: I3ec3548bd61346b94c76fd07b522b1f0129a7992 --- Makefile.am | 4 ++-- include/queued_entry_timestamp.h | 2 +- src/shared/fd_info.c | 2 +- src/shared/log_file.c | 2 +- src/shared/logretrieve.c | 2 +- src/shared/queued_entry_timestamp.c | 2 +- src/shared/sort_vector.c | 4 ++-- src/tests/fd_info.c | 2 +- src/tests/log_file.c | 2 +- src/tests/queued_entry.c | 8 ++++---- 10 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Makefile.am b/Makefile.am index c650426..3a0bd6d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -256,7 +256,7 @@ src_tests_sort_vector_LDFLAGS = $(AM_LDFLAGS) -Wl,--wrap=log_config_get_int,--wr src_tests_fd_info_SOURCES = src/tests/fd_info.c src/shared/fd_info.c src_tests_fd_info_CFLAGS = $(check_CFLAGS) -src_tests_fd_info_LDFLAGS = $(AM_LDFLAGS) -Wl,--wrap=sort_vector_push,--wrap=malloc,--wrap=free,--wrap=close,--wrap=dlogutil_entry_ts,--wrap=log_should_print_line +src_tests_fd_info_LDFLAGS = $(AM_LDFLAGS) -Wl,--wrap=sort_vector_push,--wrap=malloc,--wrap=free,--wrap=close,--wrap=dlogutil_entry_get_ts,--wrap=log_should_print_line src_tests_fdi_logger_SOURCES = src/tests/fdi_logger.c src/shared/fdi_logger.c src/shared/ptrs_list.c src/shared/logcommon.c src_tests_fdi_logger_CFLAGS = $(check_CFLAGS) @@ -284,7 +284,7 @@ src_tests_libdlog_base_LDFLAGS = $(AM_LDFLAGS) -lpthread -Wl,--wrap=log_config_r src_tests_log_file_SOURCES = src/tests/log_file.c src/shared/log_file.c src_tests_log_file_CFLAGS = $(check_CFLAGS) -src_tests_log_file_LDFLAGS = $(AM_LDFLAGS) -Wl,--wrap=strdup,--wrap=free,--wrap=memcpy,--wrap=snprintf,--wrap=open,--wrap=fstat,--wrap=rename,--wrap=dlogutil_entry_ts,--wrap=log_print_log_line,--wrap=dlogutil_entry_get_tag,--wrap=isatty +src_tests_log_file_LDFLAGS = $(AM_LDFLAGS) -Wl,--wrap=strdup,--wrap=free,--wrap=memcpy,--wrap=snprintf,--wrap=open,--wrap=fstat,--wrap=rename,--wrap=dlogutil_entry_get_ts,--wrap=log_print_log_line,--wrap=dlogutil_entry_get_tag,--wrap=isatty src_tests_queued_entry_SOURCES = src/tests/queued_entry.c src/shared/queued_entry.c src/shared/queued_entry_timestamp.c src/shared/parsers.c src/shared/translate_syslog.c src/shared/logconfig.c src/shared/logcommon.c src_tests_queued_entry_CFLAGS = $(check_CFLAGS) diff --git a/include/queued_entry_timestamp.h b/include/queued_entry_timestamp.h index 7814a11..f2acb71 100644 --- a/include/queued_entry_timestamp.h +++ b/include/queued_entry_timestamp.h @@ -27,7 +27,7 @@ void add_recv_timestamp(dlogutil_entry_s *le); void copy_recv_timestamp(dlogutil_entry_s *le); bool log_entry_is_earlier(const dlogutil_sorting_order_e sort_by, const dlogutil_entry_s *lhs, const dlogutil_entry_s *rhs); -struct timespec dlogutil_entry_ts(const dlogutil_entry_s *le, dlogutil_sorting_order_e stamp_type); +struct timespec dlogutil_entry_get_ts(const dlogutil_entry_s *le, dlogutil_sorting_order_e stamp_type); clockid_t get_proper_clock(dlogutil_sorting_order_e sort_by); #endif /* _QUEUED_ENTRY_TIMESTAMP_H */ diff --git a/src/shared/fd_info.c b/src/shared/fd_info.c index d4accad..5feb4e1 100644 --- a/src/shared/fd_info.c +++ b/src/shared/fd_info.c @@ -94,7 +94,7 @@ int fdi_push_log(struct fd_info *fdi, struct sort_vector *logs, dlogutil_entry_c int r; if (IS_VECTOR_SIZE_SORTABLE(logs->size)) { - struct timespec ts = dlogutil_entry_ts(temp, logs->sort_by); + struct timespec ts = dlogutil_entry_get_ts(temp, logs->sort_by); /* check if new entry is newer than util's start moment */ if (ts.tv_sec > logs->start.tv_sec || (ts.tv_sec == logs->start.tv_sec && ts.tv_nsec > logs->start.tv_nsec)) diff --git a/src/shared/log_file.c b/src/shared/log_file.c index 80c17b7..572b956 100644 --- a/src/shared/log_file.c +++ b/src/shared/log_file.c @@ -223,7 +223,7 @@ int logfile_write_with_rotation(const dlogutil_entry_s *e, struct log_file *file int written_bytes = 0; - struct timespec ts = dlogutil_entry_ts(e, sort_by); + struct timespec ts = dlogutil_entry_get_ts(e, sort_by); if (ts.tv_sec < file->prev_sec || (ts.tv_sec == file->prev_sec && ts.tv_nsec < file->prev_nsec)) { struct dlogutil_entry_with_msg msg; diff --git a/src/shared/logretrieve.c b/src/shared/logretrieve.c index bc821a2..dc98140 100644 --- a/src/shared/logretrieve.c +++ b/src/shared/logretrieve.c @@ -113,7 +113,7 @@ struct fd_info *find_earliest_log(struct fd_info **data_fds, int fd_count, dlogu continue; const dlogutil_entry_s *const le = fdi->ops->peek_entry(fdi); - struct timespec current_ts = dlogutil_entry_ts(le, sort_by); + struct timespec current_ts = dlogutil_entry_get_ts(le, sort_by); if (best_fdi && ((current_ts.tv_sec > best_ts.tv_sec) || (current_ts.tv_sec == best_ts.tv_sec && current_ts.tv_nsec > best_ts.tv_nsec))) continue; diff --git a/src/shared/queued_entry_timestamp.c b/src/shared/queued_entry_timestamp.c index a1184cf..4b884bb 100644 --- a/src/shared/queued_entry_timestamp.c +++ b/src/shared/queued_entry_timestamp.c @@ -95,7 +95,7 @@ bool log_entry_is_earlier(const dlogutil_sorting_order_e sort_by, const dlogutil return l_sec < r_sec || (l_sec == r_sec && l_nsec < r_nsec); } -struct timespec dlogutil_entry_ts(const dlogutil_entry_s *le, dlogutil_sorting_order_e stamp_type) +struct timespec dlogutil_entry_get_ts(const dlogutil_entry_s *le, dlogutil_sorting_order_e stamp_type) { assert(le); diff --git a/src/shared/sort_vector.c b/src/shared/sort_vector.c index 2beda89..3165f1f 100644 --- a/src/shared/sort_vector.c +++ b/src/shared/sort_vector.c @@ -198,7 +198,7 @@ long sort_vector_time_span(struct sort_vector *logs) if (sort_vector_empty(logs)) return 0; - struct timespec now, oldest = dlogutil_entry_ts(sort_vector_back(logs), logs->sort_by); + struct timespec now, oldest = dlogutil_entry_get_ts(sort_vector_back(logs), logs->sort_by); clock_gettime(get_proper_clock(logs->sort_by), &now); diff_s = now.tv_sec - oldest.tv_sec; @@ -230,7 +230,7 @@ bool process_log(const dlogutil_entry_s *e, struct timespec reference_ts, dlogut if (timeout != -1) { - struct timespec log_ts = dlogutil_entry_ts(e, stamp_type); + struct timespec log_ts = dlogutil_entry_get_ts(e, stamp_type); long s = reference_ts.tv_sec - log_ts.tv_sec; long ns = reference_ts.tv_nsec - log_ts.tv_nsec; diff --git a/src/tests/fd_info.c b/src/tests/fd_info.c index c6f56b0..23a1788 100644 --- a/src/tests/fd_info.c +++ b/src/tests/fd_info.c @@ -65,7 +65,7 @@ dlogutil_entry_s *test_extract(struct fd_info *fdi) return fail_extract ? NULL : (dlogutil_entry_s *) 0xBADFEEL; } -struct timespec __wrap_dlogutil_entry_ts(const dlogutil_entry_s *le, dlogutil_sorting_order_e stamp_type) +struct timespec __wrap_dlogutil_entry_get_ts(const dlogutil_entry_s *le, dlogutil_sorting_order_e stamp_type) { assert(le == (dlogutil_entry_s *)0xBADFEEL); return (struct timespec) { diff --git a/src/tests/log_file.c b/src/tests/log_file.c index 7a76a5f..d6207ab 100644 --- a/src/tests/log_file.c +++ b/src/tests/log_file.c @@ -34,7 +34,7 @@ int __wrap_rename(const char *oldpath, const char *newpath) return -1; } -struct timespec __wrap_dlogutil_entry_ts(const dlogutil_entry_s *le, dlogutil_sorting_order_e stamp_type) +struct timespec __wrap_dlogutil_entry_get_ts(const dlogutil_entry_s *le, dlogutil_sorting_order_e stamp_type) { assert(stamp_type == DLOGUTIL_SORT_SENT_MONO); assert(le == (dlogutil_entry_s *) 0xBA5EBALL); diff --git a/src/tests/queued_entry.c b/src/tests/queued_entry.c index 852ba23..1abe39b 100644 --- a/src/tests/queued_entry.c +++ b/src/tests/queued_entry.c @@ -58,16 +58,16 @@ int main() .sec_recv_real = 7, .nsec_recv_real = 8, }; - ts = dlogutil_entry_ts(&le, DLOGUTIL_SORT_SENT_MONO); + ts = dlogutil_entry_get_ts(&le, DLOGUTIL_SORT_SENT_MONO); assert(ts.tv_sec == le. sec_sent_mono); assert(ts.tv_nsec == le.nsec_sent_mono); - ts = dlogutil_entry_ts(&le, DLOGUTIL_SORT_RECV_REAL); + ts = dlogutil_entry_get_ts(&le, DLOGUTIL_SORT_RECV_REAL); assert(ts.tv_sec == le. sec_recv_real); assert(ts.tv_nsec == le.nsec_recv_real); - ts = dlogutil_entry_ts(&le, DLOGUTIL_SORT_SENT_REAL); + ts = dlogutil_entry_get_ts(&le, DLOGUTIL_SORT_SENT_REAL); assert(ts.tv_sec == le. sec_sent_real); assert(ts.tv_nsec == le.nsec_sent_real); - ts = dlogutil_entry_ts(&le, DLOGUTIL_SORT_RECV_MONO); + ts = dlogutil_entry_get_ts(&le, DLOGUTIL_SORT_RECV_MONO); assert(ts.tv_sec == le. sec_recv_mono); assert(ts.tv_nsec == le.nsec_recv_mono); -- 2.7.4