From 74dbec5086ee2f964b98944e9623b0797611ccd7 Mon Sep 17 00:00:00 2001 From: Lizonghang <870644199@qq.com> Date: Tue, 3 Dec 2024 22:55:16 +0400 Subject: [PATCH] set default readahead size to 128KB if permission is needed --- common/profiler.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/common/profiler.cpp b/common/profiler.cpp index ed493ee5..6a6bc72f 100644 --- a/common/profiler.cpp +++ b/common/profiler.cpp @@ -649,7 +649,6 @@ static size_t get_default_readahead_size() { file.close(); return read_ahead_kb * 1024; // convert to bytes } else { - LOG_INF("Unable to open: %s\n", sysfs_path.c_str()); return 0; } #elif __APPLE__ @@ -717,8 +716,8 @@ numjobs=%d size_t readahead_size = get_default_readahead_size(); if (readahead_size == 0) { - LOG_INF("Error: Unable to get system readahead size\n"); - return; + LOG_INF("Error: Unable to get system readahead size, use 128KB by default\n"); + readahead_size = 128 * 1024; } // format the readahead size as a readable string (e.g., "128k" or "1m") char readahead_str[8];