From ebb01d2b9c070c33ca3090029c16394e998ab3f1 Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Thu, 9 Dec 2021 20:25:21 +0000 Subject: [PATCH] bpf: use map in nvmf_path.bt Modify nvmf_path.bt to collect the (ip, port) tuples in a map, and then print the map every second. This generates a lot less output than printing the path for every single I/O. Signed-off-by: Jim Harris Change-Id: I8f655ed7a4558735f51ddf1169134fbf6950cc1c Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10616 Community-CI: Broadcom CI Reviewed-by: Ben Walker Reviewed-by: Shuhei Matsumoto Reviewed-by: Monica Kenguva Tested-by: SPDK CI Jenkins --- scripts/bpf/nvmf_path.bt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/bpf/nvmf_path.bt b/scripts/bpf/nvmf_path.bt index 5452f6722..e67e9c63b 100644 --- a/scripts/bpf/nvmf_path.bt +++ b/scripts/bpf/nvmf_path.bt @@ -1,3 +1,8 @@ usdt:__EXE__:nvmf_request_io_exec_path { - printf("traddr:%s trsvcid:%s\n", str(arg2), str(arg3)); + @path[str(arg2), str(arg3)] = count(); +} + +interval:s:1 { + print(@path); + clear(@path); }