Skip to content

Commit 0be1196

Browse files
zhaoxingyu12xiaoxiang781216
authored andcommitted
note_driver: time_t outputs in 64-bit format
Signed-off-by: zhaoxingyu1 <[email protected]>
1 parent 19851c0 commit 0be1196

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

drivers/note/noteram_driver.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -650,8 +650,8 @@ static int noteram_dump_header(FAR struct lib_outstream_s *s,
650650
FAR struct noteram_dump_context_s *ctx)
651651
{
652652
pid_t pid;
653-
uint32_t nsec = note->nc_systime_nsec;
654-
uint32_t sec = note->nc_systime_sec;
653+
long nsec = note->nc_systime_nsec;
654+
time_t sec = note->nc_systime_sec;
655655
int ret;
656656

657657
pid = note->nc_pid;
@@ -661,8 +661,10 @@ static int noteram_dump_header(FAR struct lib_outstream_s *s,
661661
int cpu = 0;
662662
#endif
663663

664-
ret = lib_sprintf(s, "%8s-%-3u [%d] %3" PRIu32 ".%09" PRIu32 ": ",
665-
get_taskname(pid), get_pid(pid), cpu, sec, nsec);
664+
ret = lib_sprintf(s, "%8s-%-3u [%d] %3" PRIu64 ".%09lu: ",
665+
get_taskname(pid), get_pid(pid), cpu,
666+
(uint64_t)sec, nsec);
667+
666668
return ret;
667669
}
668670

drivers/note/notesnap_driver.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,12 +383,12 @@ void notesnap_dump_with_stream(FAR struct lib_outstream_s *stream)
383383

384384
perf_convert(note->count, &time);
385385
lib_sprintf(stream,
386-
"snapshoot: [%u.%09u] "
386+
"snapshoot: [%" PRIu64 ".%09u] "
387387
#ifdef CONFIG_SMP
388388
"[CPU%d] "
389389
#endif
390390
"[%d] %-16s %#" PRIxPTR "\n",
391-
(unsigned)time.tv_sec,
391+
(uint64_t)time.tv_sec,
392392
(unsigned)time.tv_nsec,
393393
#ifdef CONFIG_SMP
394394
note->cpu,

0 commit comments

Comments
 (0)