Hi Lijiang,

Thanks for checking the patch.

On 12/3/25 7:09 AM, lijiang wrote:
Hi, Shivang
Thank you for the patch.

On Thu, Nov 20, 2025 at 4:18 AM <[email protected]>
wrote:

Date: Wed, 19 Nov 2025 16:23:46 +0530
From: Shivang Upadhyay <[email protected]>
Subject: [Crash-utility] [PATCH] make the MAX_MALLOC_BUFS customizable
To: [email protected], [email protected]
Cc: [email protected], [email protected]
Message-ID: <[email protected]>

default value is kept to 2000, but can be changed with
command line with flag `--max-malloc-bufs`.

Signed-off-by: Shivang Upadhyay <[email protected]>
---
  defs.h  | 1 +
  main.c  | 4 ++++
  tools.c | 9 ++++++---
  3 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/defs.h b/defs.h
index ab4aee8..863baf9 100644
--- a/defs.h
+++ b/defs.h
@@ -5608,6 +5608,7 @@ void exec_args_input_file(struct command_table_entry
*, struct args_input_file *
  /*
   *  tools.c
   */
+extern int MAX_MALLOC_BUFS;
  FILE *set_error(char *);
  int __error(int, char *, ...);
  #define error __error               /* avoid conflict with gdb error() */
diff --git a/main.c b/main.c
index 71bcc15..e986792 100644
--- a/main.c
+++ b/main.c
@@ -46,6 +46,7 @@ static struct option long_options[] = {
         {"version", 0, 0, 0},
         {"buildinfo", 0, 0, 0},
          {"cpus", required_argument, 0, 0},
+        {"max-malloc-bufs", required_argument, 0, 0},
          {"no_ikconfig", 0, 0, 0},
          {"hyper", 0, 0, 0},
         {"p2m_mfn", required_argument, 0, 0},
@@ -163,6 +164,9 @@ main(int argc, char **argv)
                         else if (STREQ(long_options[option_index].name,
"cpus"))
                                 kt->cpus_override = optarg;

+                       else if (STREQ(long_options[option_index].name,
"max-malloc-bufs"))
+                               MAX_MALLOC_BUFS = atoi(optarg);
+
                         else if (STREQ(long_options[option_index].name,
"hyper"))
                                 pc->flags |= XEN_HYPER;

diff --git a/tools.c b/tools.c
index a9ad18d..c9867e1 100644
--- a/tools.c
+++ b/tools.c
@@ -5698,7 +5698,7 @@ ll_power(long long base, long long exp)
  #define B32K (4)

  #define SHARED_BUF_SIZES  (B32K+1)
-#define MAX_MALLOC_BUFS   (2000)
+int MAX_MALLOC_BUFS  = 2000; /* can be changed from command line args */

Think it again and discuss with customers, that should be good to fold
these two patches into one patch:
https://www.mail-archive.com/[email protected]/msg01829.html


That is to say, increase the default MAX_MALLOC_BUFS and also introduce the
--max-malloc-bufs options, which can handle both cases:
1. most customers never hit the max limit
2. deal with large vmcores without blocking analysis

What do you think?

Thank
Lianbo

I think its a good Idea. I can send the amended patch.

~Shivang.
--
Crash-utility mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://${domain_name}/admin/lists/devel.lists.crash-utility.osci.io/
Contribution Guidelines: https://github.com/crash-utility/crash/wiki

Reply via email to