From ef311f5a6c9d9c3578db836d68a3ad15727bdc15 Mon Sep 17 00:00:00 2001
From: wuchangye <wuchangye@huawei.com>
Date: Thu, 7 Dec 2023 14:17:49 +0800
Subject: [PATCH] The call stack is not printed in the proactive exit scenario.

---
 src/lstack/api/lstack_signal.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/lstack/api/lstack_signal.c b/src/lstack/api/lstack_signal.c
index 03118f5..285aaf3 100644
--- a/src/lstack/api/lstack_signal.c
+++ b/src/lstack/api/lstack_signal.c
@@ -64,7 +64,10 @@ static void lstack_sig_default_handler(int sig)
         dpdk_kni_release();
     }
     control_fd_close();
-    dump_stack();
+    /* When operations such as pressing Ctrl+C or Kill, the call stack exit is not displayed. */
+    if (sig != SIGINT && sig != SIGTERM && sig != SIGKILL) {
+        dump_stack();
+    }
     lwip_exit();
     (void)kill(getpid(), sig);
 }
-- 
2.27.0

