From 848b596a12a4eaaf50e82d56a4b259510909c7fe Mon Sep 17 00:00:00 2001 From: wanggang26 Date: Wed, 21 Aug 2024 11:26:28 +0800 Subject: [PATCH] coredump: measure the system's running time in milliseconds unit Signed-off-by: wanggang26 --- include/nuttx/coredump.h | 8 ++++---- sched/misc/coredump.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/nuttx/coredump.h b/include/nuttx/coredump.h index a48941b6d6..273c0f7cbf 100644 --- a/include/nuttx/coredump.h +++ b/include/nuttx/coredump.h @@ -51,10 +51,10 @@ struct coredump_info_s { - uint32_t magic; - struct utsname name; - time_t time; - size_t size; + uint32_t magic; + struct utsname name; + struct timespec time; + size_t size; }; /**************************************************************************** diff --git a/sched/misc/coredump.c b/sched/misc/coredump.c index d954a27b77..13947390cb 100644 --- a/sched/misc/coredump.c +++ b/sched/misc/coredump.c @@ -720,7 +720,7 @@ static void coredump_dump_blkdev(pid_t pid) info->magic = COREDUMP_MAGIC; info->size = g_blockstream.common.nput; - info->time = time(NULL); + clock_gettime(CLOCK_REALTIME, &info->time); uname(&info->name); ret = g_blockstream.inode->u.i_bops->write(g_blockstream.inode, (FAR void *)info, g_blockstream.geo.geo_nsectors - nsectors, nsectors);