1
0
Fork 0
forked from nuttx/nuttx-update

note_driver: time_t outputs in 64-bit format

Signed-off-by: zhaoxingyu1 <zhaoxingyu1@xiaomi.com>
This commit is contained in:
zhaoxingyu1 2024-07-15 21:00:08 +08:00 committed by Xiang Xiao
parent 19851c0979
commit 0be1196046
2 changed files with 8 additions and 6 deletions

View file

@ -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;
}

View file

@ -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,