Remove CONFIG_CLOCK_MONOTONIC special code

since this opion doesn't exist anymore

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2022-02-15 16:16:54 +08:00 committed by Xiang Xiao
parent bc5d1165aa
commit 4cc0c755bf
9 changed files with 5 additions and 41 deletions

View File

@ -6,7 +6,6 @@
config EXAMPLES_CALIB_UDELAY
tristate "Calibration tool for udelay"
default n
select CLOCK_MONOTONIC
select LIBC_FLOATINGPOINT
---help---
Note that libm support is also required by this tool. You

View File

@ -6,7 +6,7 @@
config EXAMPLES_LIBCANARD
tristate "libcandard example"
default n
depends on CANUTILS_LIBCANARD && CLOCK_MONOTONIC && SYSTEM_TIME64
depends on CANUTILS_LIBCANARD && SYSTEM_TIME64
---help---
Enable the LIBCANARD example

View File

@ -6,7 +6,6 @@
config INTERPRETERS_WAMR
tristate "Webassembly Micro Runtime"
default n
select CLOCK_MONOTONIC
if INTERPRETERS_WAMR

View File

@ -233,14 +233,9 @@ static void iperf_report_task(void *arg)
struct timespec start;
uintmax_t now_len;
int ret;
#ifdef CONFIG_CLOCK_MONOTONIC
const clockid_t clockid = CLOCK_MONOTONIC;
#else
const clockid_t clockid = CLOCK_REALTIME;
#endif
now_len = s_iperf_ctrl.total_len;
ret = clock_gettime(clockid, &now);
ret = clock_gettime(CLOCK_MONOTONIC, &now);
if (ret != 0)
{
fprintf(stderr, "clock_gettime failed\n");
@ -258,7 +253,7 @@ static void iperf_report_task(void *arg)
last_len = now_len;
last = now;
now_len = s_iperf_ctrl.total_len;
ret = clock_gettime(clockid, &now);
ret = clock_gettime(CLOCK_MONOTONIC, &now);
if (ret != 0)
{
fprintf(stderr, "clock_gettime failed\n");

View File

@ -542,18 +542,14 @@ static void ntpc_settime(int64_t offset, FAR struct timespec *start_realtime,
{
struct timespec tp;
struct timespec curr_realtime;
#ifdef CONFIG_CLOCK_MONOTONIC
struct timespec curr_monotonic;
int64_t diffms_real;
int64_t diffms_mono;
int64_t diff_diff_ms;
#endif
/* Get the system times */
clock_gettime(CLOCK_REALTIME, &curr_realtime);
#ifdef CONFIG_CLOCK_MONOTONIC
clock_gettime(CLOCK_MONOTONIC, &curr_monotonic);
/* Check differences between monotonic and realtime. */
@ -583,9 +579,6 @@ static void ntpc_settime(int64_t offset, FAR struct timespec *start_realtime,
return;
}
#else
UNUSED(start_monotonic);
#endif
/* Apply offset */
@ -1293,9 +1286,7 @@ static int ntpc_daemon(int argc, FAR char **argv)
CONFIG_NETUTILS_NTPCLIENT_NUM_SAMPLES);
clock_gettime(CLOCK_REALTIME, &start_realtime);
#ifdef CONFIG_CLOCK_MONOTONIC
clock_gettime(CLOCK_MONOTONIC, &start_monotonic);
#endif
/* Collect samples. */

View File

@ -300,11 +300,7 @@ int cmd_dd(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
/* Then perform the data transfer */
#ifdef CONFIG_NSH_CMDOPT_DD_STATS
#ifdef CONFIG_CLOCK_MONOTONIC
clock_gettime(CLOCK_MONOTONIC, &ts0);
#else
clock_gettime(CLOCK_REALTIME, &ts0);
#endif
#endif
dd.sector = 0;
@ -353,11 +349,7 @@ int cmd_dd(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
ret = OK;
#ifdef CONFIG_NSH_CMDOPT_DD_STATS
#ifdef CONFIG_CLOCK_MONOTONIC
clock_gettime(CLOCK_MONOTONIC, &ts1);
#else
clock_gettime(CLOCK_REALTIME, &ts1);
#endif
elapsed = (((uint64_t)ts1.tv_sec * NSEC_PER_SEC) + ts1.tv_nsec);
elapsed -= (((uint64_t)ts0.tv_sec * NSEC_PER_SEC) + ts0.tv_nsec);

View File

@ -38,12 +38,6 @@
#define MAX_TIME_STRING 80
#ifdef CONFIG_CLOCK_MONOTONIC
# define TIME_CLOCK CLOCK_MONOTONIC
#else
# define TIME_CLOCK CLOCK_REALTIME
#endif
/****************************************************************************
* Private Function Prototypes
****************************************************************************/
@ -303,7 +297,7 @@ int cmd_time(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
/* Get the current time */
ret = clock_gettime(TIME_CLOCK, &start);
ret = clock_gettime(CLOCK_MONOTONIC, &start);
if (ret < 0)
{
nsh_error(vtbl, g_fmtcmdfailed, argv[0], "clock_gettime", NSH_ERRNO);
@ -329,7 +323,7 @@ int cmd_time(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
/* Get and print the elapsed time */
ret = clock_gettime(TIME_CLOCK, &end);
ret = clock_gettime(CLOCK_MONOTONIC, &end);
if (ret < 0)
{
nsh_error(vtbl, g_fmtcmdfailed,

View File

@ -48,12 +48,7 @@ CSRCS = $(EMBEDLOG_SOURCES)/src/el-options.c \
ifeq ($(CONFIG_EMBEDLOG_ENABLE_TIMESTAMP),y)
CFLAGS += -DENABLE_TIMESTAMP
CFLAGS += -DENABLE_REALTIME
ifeq ($(CONFIG_CLOCK_MONOTONIC),y)
CFLAGS += -DENABLE_MONOTONIC
else
CFLAGS += -DENABLE_MONOTONIC=0
endif
endif
ifeq ($(CONFIG_EMBEDLOG_ENABLE_FRACTIONS),y)

View File

@ -29,7 +29,6 @@ config LIBUV_ASYNC
config LIBUV_TIMER
bool "libuv software timers support"
default n
select CLOCK_MONOTONIC
---help---
Enable software timers support in libuv.