You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2024/10/13 06:05:58 UTC
(nuttx) 02/13: note_driver: time_t outputs in 64-bit format
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 0be1196046a0a2962e6d5c008c35eeb728938424
Author: zhaoxingyu1 <zh...@xiaomi.com>
AuthorDate: Mon Jul 15 21:00:08 2024 +0800
note_driver: time_t outputs in 64-bit format
Signed-off-by: zhaoxingyu1 <zh...@xiaomi.com>
---
drivers/note/noteram_driver.c | 10 ++++++----
drivers/note/notesnap_driver.c | 4 ++--
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/drivers/note/noteram_driver.c b/drivers/note/noteram_driver.c
index b05777eef9..f111c8fdc7 100644
--- a/drivers/note/noteram_driver.c
+++ b/drivers/note/noteram_driver.c
@@ -650,8 +650,8 @@ static int noteram_dump_header(FAR struct lib_outstream_s *s,
FAR struct noteram_dump_context_s *ctx)
{
pid_t pid;
- uint32_t nsec = note->nc_systime_nsec;
- uint32_t sec = note->nc_systime_sec;
+ long nsec = note->nc_systime_nsec;
+ time_t sec = note->nc_systime_sec;
int ret;
pid = note->nc_pid;
@@ -661,8 +661,10 @@ static int noteram_dump_header(FAR struct lib_outstream_s *s,
int cpu = 0;
#endif
- ret = lib_sprintf(s, "%8s-%-3u [%d] %3" PRIu32 ".%09" PRIu32 ": ",
- get_taskname(pid), get_pid(pid), cpu, sec, nsec);
+ ret = lib_sprintf(s, "%8s-%-3u [%d] %3" PRIu64 ".%09lu: ",
+ get_taskname(pid), get_pid(pid), cpu,
+ (uint64_t)sec, nsec);
+
return ret;
}
diff --git a/drivers/note/notesnap_driver.c b/drivers/note/notesnap_driver.c
index c56d1d598d..e762b67225 100644
--- a/drivers/note/notesnap_driver.c
+++ b/drivers/note/notesnap_driver.c
@@ -383,12 +383,12 @@ void notesnap_dump_with_stream(FAR struct lib_outstream_s *stream)
perf_convert(note->count, &time);
lib_sprintf(stream,
- "snapshoot: [%u.%09u] "
+ "snapshoot: [%" PRIu64 ".%09u] "
#ifdef CONFIG_SMP
"[CPU%d] "
#endif
"[%d] %-16s %#" PRIxPTR "\n",
- (unsigned)time.tv_sec,
+ (uint64_t)time.tv_sec,
(unsigned)time.tv_nsec,
#ifdef CONFIG_SMP
note->cpu,