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/16 06:22:48 UTC
(nuttx-apps) 01/04: system/coredump:Increase coredump swap buffer size to improve speed
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-apps.git
commit 03f3ce7fd4cfd5088615b5305313217d4c2a37aa
Author: anjiahao <an...@xiaomi.com>
AuthorDate: Wed Mar 27 16:21:00 2024 +0800
system/coredump:Increase coredump swap buffer size to improve speed
Signed-off-by: anjiahao <an...@xiaomi.com>
---
system/coredump/Kconfig | 6 ++++++
system/coredump/coredump.c | 6 ++++--
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/system/coredump/Kconfig b/system/coredump/Kconfig
index 5f8673565..4ab9f6955 100644
--- a/system/coredump/Kconfig
+++ b/system/coredump/Kconfig
@@ -22,4 +22,10 @@ config SYSTEM_COREDUMP_PRIORITY
---help---
This is the task priority that will be used when starting the coredump.
+config SYSTEM_COREDUMP_SWAPBUFFER_NUMS
+ int "coredump read/write swap buffer nums"
+ default 64
+ ---help---
+ The coredump read/write swap buffer nums. swap buffer size = sectorsize * nums
+
endif # SYSTEM_COREDUMP
diff --git a/system/coredump/coredump.c b/system/coredump/coredump.c
index c4f725761..f67054803 100644
--- a/system/coredump/coredump.c
+++ b/system/coredump/coredump.c
@@ -202,7 +202,8 @@ static void coredump_restore(FAR char *savepath, size_t maxfile)
goto info_err;
}
- swap = malloc(geo.geo_sectorsize);
+ swap = malloc(geo.geo_sectorsize *
+ CONFIG_SYSTEM_COREDUMP_SWAPBUFFER_NUMS);
if (swap == NULL)
{
printf("Malloc fail\n");
@@ -212,7 +213,8 @@ static void coredump_restore(FAR char *savepath, size_t maxfile)
lseek(blkfd, 0, SEEK_SET);
while (offset < info->size)
{
- readsize = read(blkfd, swap, geo.geo_sectorsize);
+ readsize = read(blkfd, swap, geo.geo_sectorsize *
+ CONFIG_SYSTEM_COREDUMP_SWAPBUFFER_NUMS);
if (readsize < 0)
{
printf("Read %s fail\n", CONFIG_BOARD_COREDUMP_BLKDEV_PATH);