This is an automated email from the ASF dual-hosted git repository.

GUIDINGLI pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 90ccd7c42b9ed94d81fdeb410bb9776f6743c688
Author: dongjiuzhu1 <[email protected]>
AuthorDate: Mon Mar 24 18:03:09 2025 +0800

    drivers/timers/rpmsg_rtc: log the time sync messages
    
    Log the time carried by each sync and set message on the client and
    the server, to trace when and to what a core's clock was set.
    
    Signed-off-by: dongjiuzhu1 <[email protected]>
    Signed-off-by: Bowen Wang <[email protected]>
---
 drivers/timers/rpmsg_rtc.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/timers/rpmsg_rtc.c b/drivers/timers/rpmsg_rtc.c
index 10e141cf1fa..5c23b27c8f2 100644
--- a/drivers/timers/rpmsg_rtc.c
+++ b/drivers/timers/rpmsg_rtc.c
@@ -30,6 +30,7 @@
 #include <nuttx/list.h>
 #include <nuttx/clock.h>
 #include <nuttx/clock_notifier.h>
+#include <nuttx/debug.h>
 #include <nuttx/kmalloc.h>
 #include <nuttx/rpmsg/rpmsg.h>
 #include <nuttx/mutex.h>
@@ -302,6 +303,8 @@ static int rpmsg_rtc_ept_cb(FAR struct rpmsg_endpoint *ept, 
FAR void *data,
         {
           struct rpmsg_rtc_set_s *msg = data;
 
+          _info("rpmsg rtc client sync time:%"PRIi64"\n", msg->sec);
+
 #ifdef CONFIG_RTC_RPMSG_SYNC_BASETIME
           struct timespec ts;
           irqstate_t flags;
@@ -683,6 +686,8 @@ static int rpmsg_rtc_server_ept_cb(FAR struct 
rpmsg_endpoint *ept,
           gmtime_r(&time, (FAR struct tm *)&rtctime);
           rtctime.tm_nsec = msg->nsec;
 
+          _info("rpmsg rtc server set time:%"PRIi64"\n", msg->sec);
+
           header->result = rpmsg_rtc_server_settime(priv, &rtctime);
           return rpmsg_send(ept, msg, sizeof(*msg));
         }
@@ -751,6 +756,8 @@ static void rpmsg_rtc_server_sync(FAR struct 
rpmsg_rtc_server_s *server,
       msg.base_sec = g_basetime.tv_sec;
       msg.base_nsec = g_basetime.tv_nsec;
 
+      _info("rpmsg rtc server sync time:%"PRIi64"\n", msg.sec);
+
       msg.header.command = RPMSG_RTC_SYNC;
       rpmsg_send(&client->ept, &msg, sizeof(msg));
     }

Reply via email to