From 61b535e5956122e8e07426218b718a05f9ff81b3 Mon Sep 17 00:00:00 2001
From: hkk <hankangkang5@huawei.com>
Date: Thu, 25 Jul 2024 20:20:50 +0800
Subject: [PATCH] virtio: fix dfx error with multiple cpus

---
 src/lstack/core/lstack_stack_stat.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/lstack/core/lstack_stack_stat.c b/src/lstack/core/lstack_stack_stat.c
index 91ca49a..406e27c 100644
--- a/src/lstack/core/lstack_stack_stat.c
+++ b/src/lstack/core/lstack_stack_stat.c
@@ -413,6 +413,10 @@ int handle_stack_cmd(int fd, struct gazelle_stat_msg_request *msg)
             (stat_mode == GAZELLE_STAT_LTRAN_START_LATENCY || stat_mode == GAZELLE_STAT_LTRAN_STOP_LATENCY)) {
             continue;
         }
+        
+        if (i > 0 && stat_mode == GAZELLE_STAT_LSTACK_SHOW_VIRTIO) {
+            break;
+        }
 
         dfx.tid = stack->tid;
         dfx.stack_id = i;
-- 
2.33.0

