From 9b5d417f77bf976fe996a2e3882fbfd385effb4e Mon Sep 17 00:00:00 2001 From: "guangshui.li" Date: Thu, 31 Mar 2022 11:12:33 +0800 Subject: [PATCH 1/3] iosdiag: Fix compile warnning Signed-off-by: guangshui.li --- .../include/3.10.0-1062.1.1.el7.x86_64/nvme.h | 1 - .../include/3.10.0-1062.1.2.el7.x86_64/nvme.h | 1 - .../3.10.0-1062.12.1.el7.x86_64/nvme.h | 1 - .../3.10.0-1062.18.1.el7.x86_64/nvme.h | 1 - .../include/3.10.0-1062.4.1.el7.x86_64/nvme.h | 1 - .../include/3.10.0-1062.4.2.el7.x86_64/nvme.h | 1 - .../include/3.10.0-1062.4.3.el7.x86_64/nvme.h | 1 - .../include/3.10.0-1062.7.1.el7.x86_64/nvme.h | 1 - .../include/3.10.0-1062.9.1.el7.x86_64/nvme.h | 1 - .../include/3.10.0-1062.el7.x86_64/nvme.h | 1 - .../3.10.0-1127.10.1.el7.x86_64/nvme.h | 1 - .../3.10.0-1127.13.1.el7.x86_64/nvme.h | 1 - .../3.10.0-1127.18.2.el7.x86_64/nvme.h | 1 - .../3.10.0-1127.19.1.el7.x86_64/nvme.h | 1 - .../include/3.10.0-1127.8.2.el7.x86_64/nvme.h | 1 - .../include/3.10.0-1127.el7.x86_64/nvme.h | 1 - .../3.10.0-1160.11.1.el7.x86_64/nvme.h | 1 - .../3.10.0-1160.15.2.el7.x86_64/nvme.h | 1 - .../include/3.10.0-1160.2.1.el7.x86_64/nvme.h | 1 - .../include/3.10.0-1160.2.2.el7.x86_64/nvme.h | 1 - .../include/3.10.0-1160.6.1.el7.x86_64/nvme.h | 1 - .../include/3.10.0-1160.el7.x86_64/nvme.h | 1 - .../include/3.10.0-862.14.4.el7.x86_64/nvme.h | 1 - .../include/3.10.0-957.21.3.el7.x86_64/nvme.h | 1 - .../include/4.19.24-9.al7.x86_64/nvme.h | 1 - .../include/4.19.24-9.al7.x86_64/virtio_blk.h | 2 -- .../include/4.19.81-17.1.al7.x86_64/nvme.h | 1 - .../4.19.81-17.1.al7.x86_64/virtio_blk.h | 26 +----------------- .../include/4.19.81-17.2.al7.x86_64/nvme.h | 1 - .../4.19.81-17.2.al7.x86_64/virtio_blk.h | 26 +----------------- .../include/4.19.91-18.al7.x86_64/nvme.h | 1 - .../4.19.91-18.al7.x86_64/virtio_blk.h | 25 +---------------- .../include/4.19.91-19.1.al7.x86_64/nvme.h | 1 - .../4.19.91-19.1.al7.x86_64/virtio_blk.h | 26 +----------------- .../include/4.19.91-19.2.al7.x86_64/nvme.h | 1 - .../4.19.91-19.2.al7.x86_64/virtio_blk.h | 26 +----------------- .../include/4.19.91-21.2.al7.x86_64/nvme.h | 1 - .../4.19.91-21.2.al7.x86_64/virtio_blk.h | 26 +----------------- .../include/4.19.91-21.al7.x86_64/nvme.h | 1 - .../4.19.91-21.al7.x86_64/virtio_blk.h | 26 +----------------- .../include/4.19.91-22.1.al7.x86_64/nvme.h | 1 - .../4.19.91-22.1.al7.x86_64/virtio_blk.h | 26 +----------------- .../include/4.19.91-22.2.al7.x86_64/nvme.h | 1 - .../4.19.91-22.2.al7.x86_64/virtio_blk.h | 26 +----------------- .../include/4.19.91-23.4.an8.x86_64/nvme.h | 1 - .../4.19.91-23.4.an8.x86_64/virtio_blk.h | 26 +----------------- .../include/4.19.91-23.al7.x86_64/nvme.h | 1 - .../4.19.91-23.al7.x86_64/virtio_blk.h | 26 +----------------- .../include/4.19.91-24.1.al7.x86_64/nvme.h | 1 - .../4.19.91-24.1.al7.x86_64/virtio_blk.h | 26 +----------------- .../include/4.19.91-24.8.an8.x86_64/nvme.h | 1 - .../4.19.91-24.8.an8.x86_64/virtio_blk.h | 26 +----------------- .../include/4.19.91-24.al7.x86_64/nvme.h | 1 - .../4.19.91-24.al7.x86_64/virtio_blk.h | 27 ------------------- .../include/4.19.91-25.an8.x86_64/nvme.h | 1 - .../4.19.91-25.an8.x86_64/virtio_blk.h | 26 +----------------- .../kernel_module/modules/iosdiag/iosdiag.c | 5 +--- .../kernel_module/modules/iosdiag/rq_hang.c | 14 ++++------ .../modules/iosdiag/virtio_blk.c | 12 ++++----- 59 files changed, 26 insertions(+), 437 deletions(-) diff --git a/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1062.1.1.el7.x86_64/nvme.h b/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1062.1.1.el7.x86_64/nvme.h index 628ed56d..3190b86c 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1062.1.1.el7.x86_64/nvme.h +++ b/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1062.1.1.el7.x86_64/nvme.h @@ -57,5 +57,4 @@ static unsigned long get_cmd_ctx(struct nvme_queue *nvmeq, struct request *rq) //struct nvme_iod *iod = blk_mq_rq_to_pdu(req); return 0; } -void get_nvme_info(struct nvme_info *nvme_i, struct request *rq); #endif diff --git a/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1062.1.2.el7.x86_64/nvme.h b/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1062.1.2.el7.x86_64/nvme.h index 628ed56d..3190b86c 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1062.1.2.el7.x86_64/nvme.h +++ b/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1062.1.2.el7.x86_64/nvme.h @@ -57,5 +57,4 @@ static unsigned long get_cmd_ctx(struct nvme_queue *nvmeq, struct request *rq) //struct nvme_iod *iod = blk_mq_rq_to_pdu(req); return 0; } -void get_nvme_info(struct nvme_info *nvme_i, struct request *rq); #endif diff --git a/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1062.12.1.el7.x86_64/nvme.h b/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1062.12.1.el7.x86_64/nvme.h index 628ed56d..3190b86c 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1062.12.1.el7.x86_64/nvme.h +++ b/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1062.12.1.el7.x86_64/nvme.h @@ -57,5 +57,4 @@ static unsigned long get_cmd_ctx(struct nvme_queue *nvmeq, struct request *rq) //struct nvme_iod *iod = blk_mq_rq_to_pdu(req); return 0; } -void get_nvme_info(struct nvme_info *nvme_i, struct request *rq); #endif diff --git a/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1062.18.1.el7.x86_64/nvme.h b/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1062.18.1.el7.x86_64/nvme.h index 628ed56d..3190b86c 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1062.18.1.el7.x86_64/nvme.h +++ b/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1062.18.1.el7.x86_64/nvme.h @@ -57,5 +57,4 @@ static unsigned long get_cmd_ctx(struct nvme_queue *nvmeq, struct request *rq) //struct nvme_iod *iod = blk_mq_rq_to_pdu(req); return 0; } -void get_nvme_info(struct nvme_info *nvme_i, struct request *rq); #endif diff --git a/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1062.4.1.el7.x86_64/nvme.h b/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1062.4.1.el7.x86_64/nvme.h index 628ed56d..3190b86c 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1062.4.1.el7.x86_64/nvme.h +++ b/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1062.4.1.el7.x86_64/nvme.h @@ -57,5 +57,4 @@ static unsigned long get_cmd_ctx(struct nvme_queue *nvmeq, struct request *rq) //struct nvme_iod *iod = blk_mq_rq_to_pdu(req); return 0; } -void get_nvme_info(struct nvme_info *nvme_i, struct request *rq); #endif diff --git a/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1062.4.2.el7.x86_64/nvme.h b/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1062.4.2.el7.x86_64/nvme.h index 628ed56d..3190b86c 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1062.4.2.el7.x86_64/nvme.h +++ b/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1062.4.2.el7.x86_64/nvme.h @@ -57,5 +57,4 @@ static unsigned long get_cmd_ctx(struct nvme_queue *nvmeq, struct request *rq) //struct nvme_iod *iod = blk_mq_rq_to_pdu(req); return 0; } -void get_nvme_info(struct nvme_info *nvme_i, struct request *rq); #endif diff --git a/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1062.4.3.el7.x86_64/nvme.h b/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1062.4.3.el7.x86_64/nvme.h index 628ed56d..3190b86c 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1062.4.3.el7.x86_64/nvme.h +++ b/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1062.4.3.el7.x86_64/nvme.h @@ -57,5 +57,4 @@ static unsigned long get_cmd_ctx(struct nvme_queue *nvmeq, struct request *rq) //struct nvme_iod *iod = blk_mq_rq_to_pdu(req); return 0; } -void get_nvme_info(struct nvme_info *nvme_i, struct request *rq); #endif diff --git a/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1062.7.1.el7.x86_64/nvme.h b/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1062.7.1.el7.x86_64/nvme.h index 628ed56d..3190b86c 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1062.7.1.el7.x86_64/nvme.h +++ b/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1062.7.1.el7.x86_64/nvme.h @@ -57,5 +57,4 @@ static unsigned long get_cmd_ctx(struct nvme_queue *nvmeq, struct request *rq) //struct nvme_iod *iod = blk_mq_rq_to_pdu(req); return 0; } -void get_nvme_info(struct nvme_info *nvme_i, struct request *rq); #endif diff --git a/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1062.9.1.el7.x86_64/nvme.h b/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1062.9.1.el7.x86_64/nvme.h index 628ed56d..3190b86c 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1062.9.1.el7.x86_64/nvme.h +++ b/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1062.9.1.el7.x86_64/nvme.h @@ -57,5 +57,4 @@ static unsigned long get_cmd_ctx(struct nvme_queue *nvmeq, struct request *rq) //struct nvme_iod *iod = blk_mq_rq_to_pdu(req); return 0; } -void get_nvme_info(struct nvme_info *nvme_i, struct request *rq); #endif diff --git a/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1062.el7.x86_64/nvme.h b/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1062.el7.x86_64/nvme.h index 628ed56d..3190b86c 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1062.el7.x86_64/nvme.h +++ b/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1062.el7.x86_64/nvme.h @@ -57,5 +57,4 @@ static unsigned long get_cmd_ctx(struct nvme_queue *nvmeq, struct request *rq) //struct nvme_iod *iod = blk_mq_rq_to_pdu(req); return 0; } -void get_nvme_info(struct nvme_info *nvme_i, struct request *rq); #endif diff --git a/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1127.10.1.el7.x86_64/nvme.h b/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1127.10.1.el7.x86_64/nvme.h index 628ed56d..3190b86c 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1127.10.1.el7.x86_64/nvme.h +++ b/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1127.10.1.el7.x86_64/nvme.h @@ -57,5 +57,4 @@ static unsigned long get_cmd_ctx(struct nvme_queue *nvmeq, struct request *rq) //struct nvme_iod *iod = blk_mq_rq_to_pdu(req); return 0; } -void get_nvme_info(struct nvme_info *nvme_i, struct request *rq); #endif diff --git a/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1127.13.1.el7.x86_64/nvme.h b/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1127.13.1.el7.x86_64/nvme.h index 628ed56d..3190b86c 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1127.13.1.el7.x86_64/nvme.h +++ b/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1127.13.1.el7.x86_64/nvme.h @@ -57,5 +57,4 @@ static unsigned long get_cmd_ctx(struct nvme_queue *nvmeq, struct request *rq) //struct nvme_iod *iod = blk_mq_rq_to_pdu(req); return 0; } -void get_nvme_info(struct nvme_info *nvme_i, struct request *rq); #endif diff --git a/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1127.18.2.el7.x86_64/nvme.h b/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1127.18.2.el7.x86_64/nvme.h index 628ed56d..3190b86c 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1127.18.2.el7.x86_64/nvme.h +++ b/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1127.18.2.el7.x86_64/nvme.h @@ -57,5 +57,4 @@ static unsigned long get_cmd_ctx(struct nvme_queue *nvmeq, struct request *rq) //struct nvme_iod *iod = blk_mq_rq_to_pdu(req); return 0; } -void get_nvme_info(struct nvme_info *nvme_i, struct request *rq); #endif diff --git a/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1127.19.1.el7.x86_64/nvme.h b/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1127.19.1.el7.x86_64/nvme.h index 628ed56d..3190b86c 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1127.19.1.el7.x86_64/nvme.h +++ b/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1127.19.1.el7.x86_64/nvme.h @@ -57,5 +57,4 @@ static unsigned long get_cmd_ctx(struct nvme_queue *nvmeq, struct request *rq) //struct nvme_iod *iod = blk_mq_rq_to_pdu(req); return 0; } -void get_nvme_info(struct nvme_info *nvme_i, struct request *rq); #endif diff --git a/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1127.8.2.el7.x86_64/nvme.h b/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1127.8.2.el7.x86_64/nvme.h index 628ed56d..3190b86c 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1127.8.2.el7.x86_64/nvme.h +++ b/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1127.8.2.el7.x86_64/nvme.h @@ -57,5 +57,4 @@ static unsigned long get_cmd_ctx(struct nvme_queue *nvmeq, struct request *rq) //struct nvme_iod *iod = blk_mq_rq_to_pdu(req); return 0; } -void get_nvme_info(struct nvme_info *nvme_i, struct request *rq); #endif diff --git a/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1127.el7.x86_64/nvme.h b/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1127.el7.x86_64/nvme.h index 628ed56d..3190b86c 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1127.el7.x86_64/nvme.h +++ b/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1127.el7.x86_64/nvme.h @@ -57,5 +57,4 @@ static unsigned long get_cmd_ctx(struct nvme_queue *nvmeq, struct request *rq) //struct nvme_iod *iod = blk_mq_rq_to_pdu(req); return 0; } -void get_nvme_info(struct nvme_info *nvme_i, struct request *rq); #endif diff --git a/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1160.11.1.el7.x86_64/nvme.h b/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1160.11.1.el7.x86_64/nvme.h index 628ed56d..3190b86c 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1160.11.1.el7.x86_64/nvme.h +++ b/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1160.11.1.el7.x86_64/nvme.h @@ -57,5 +57,4 @@ static unsigned long get_cmd_ctx(struct nvme_queue *nvmeq, struct request *rq) //struct nvme_iod *iod = blk_mq_rq_to_pdu(req); return 0; } -void get_nvme_info(struct nvme_info *nvme_i, struct request *rq); #endif diff --git a/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1160.15.2.el7.x86_64/nvme.h b/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1160.15.2.el7.x86_64/nvme.h index 628ed56d..3190b86c 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1160.15.2.el7.x86_64/nvme.h +++ b/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1160.15.2.el7.x86_64/nvme.h @@ -57,5 +57,4 @@ static unsigned long get_cmd_ctx(struct nvme_queue *nvmeq, struct request *rq) //struct nvme_iod *iod = blk_mq_rq_to_pdu(req); return 0; } -void get_nvme_info(struct nvme_info *nvme_i, struct request *rq); #endif diff --git a/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1160.2.1.el7.x86_64/nvme.h b/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1160.2.1.el7.x86_64/nvme.h index 628ed56d..3190b86c 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1160.2.1.el7.x86_64/nvme.h +++ b/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1160.2.1.el7.x86_64/nvme.h @@ -57,5 +57,4 @@ static unsigned long get_cmd_ctx(struct nvme_queue *nvmeq, struct request *rq) //struct nvme_iod *iod = blk_mq_rq_to_pdu(req); return 0; } -void get_nvme_info(struct nvme_info *nvme_i, struct request *rq); #endif diff --git a/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1160.2.2.el7.x86_64/nvme.h b/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1160.2.2.el7.x86_64/nvme.h index 628ed56d..3190b86c 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1160.2.2.el7.x86_64/nvme.h +++ b/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1160.2.2.el7.x86_64/nvme.h @@ -57,5 +57,4 @@ static unsigned long get_cmd_ctx(struct nvme_queue *nvmeq, struct request *rq) //struct nvme_iod *iod = blk_mq_rq_to_pdu(req); return 0; } -void get_nvme_info(struct nvme_info *nvme_i, struct request *rq); #endif diff --git a/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1160.6.1.el7.x86_64/nvme.h b/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1160.6.1.el7.x86_64/nvme.h index 628ed56d..3190b86c 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1160.6.1.el7.x86_64/nvme.h +++ b/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1160.6.1.el7.x86_64/nvme.h @@ -57,5 +57,4 @@ static unsigned long get_cmd_ctx(struct nvme_queue *nvmeq, struct request *rq) //struct nvme_iod *iod = blk_mq_rq_to_pdu(req); return 0; } -void get_nvme_info(struct nvme_info *nvme_i, struct request *rq); #endif diff --git a/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1160.el7.x86_64/nvme.h b/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1160.el7.x86_64/nvme.h index 628ed56d..3190b86c 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1160.el7.x86_64/nvme.h +++ b/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-1160.el7.x86_64/nvme.h @@ -57,5 +57,4 @@ static unsigned long get_cmd_ctx(struct nvme_queue *nvmeq, struct request *rq) //struct nvme_iod *iod = blk_mq_rq_to_pdu(req); return 0; } -void get_nvme_info(struct nvme_info *nvme_i, struct request *rq); #endif diff --git a/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-862.14.4.el7.x86_64/nvme.h b/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-862.14.4.el7.x86_64/nvme.h index cf9e37b2..c0ff7648 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-862.14.4.el7.x86_64/nvme.h +++ b/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-862.14.4.el7.x86_64/nvme.h @@ -56,5 +56,4 @@ static unsigned long get_cmd_ctx(struct nvme_queue *nvmeq, struct request *rq) //struct nvme_iod *iod = blk_mq_rq_to_pdu(req); return 0; } -void get_nvme_info(struct nvme_info *nvme_i, struct request *rq); #endif diff --git a/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-957.21.3.el7.x86_64/nvme.h b/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-957.21.3.el7.x86_64/nvme.h index cf9e37b2..c0ff7648 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-957.21.3.el7.x86_64/nvme.h +++ b/source/lib/internal/kernel_module/modules/iosdiag/include/3.10.0-957.21.3.el7.x86_64/nvme.h @@ -56,5 +56,4 @@ static unsigned long get_cmd_ctx(struct nvme_queue *nvmeq, struct request *rq) //struct nvme_iod *iod = blk_mq_rq_to_pdu(req); return 0; } -void get_nvme_info(struct nvme_info *nvme_i, struct request *rq); #endif diff --git a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.24-9.al7.x86_64/nvme.h b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.24-9.al7.x86_64/nvme.h index 500b3bc2..b0aaeba4 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.24-9.al7.x86_64/nvme.h +++ b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.24-9.al7.x86_64/nvme.h @@ -56,5 +56,4 @@ static unsigned long get_cmd_ctx(struct nvme_queue *nvmeq, struct request *rq) //struct nvme_iod *iod = blk_mq_rq_to_pdu(req); return 0; } -void get_nvme_info(struct nvme_info *nvme_i, struct request *rq); #endif diff --git a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.24-9.al7.x86_64/virtio_blk.h b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.24-9.al7.x86_64/virtio_blk.h index f76c300e..fb79209c 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.24-9.al7.x86_64/virtio_blk.h +++ b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.24-9.al7.x86_64/virtio_blk.h @@ -151,7 +151,6 @@ struct blk_flush_queue { spinlock_t mq_flush_lock; }; -//only kernel ali4000 >= 007 static inline int enable_detect_flush_rq(void) { return 0; @@ -191,7 +190,6 @@ static inline unsigned long get_issue_driver_ns(struct request *rq) } /* - * (ALIKERNEL && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 151)) || * LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0) */ static inline u64 get_check_hang_time_ns(void) diff --git a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.81-17.1.al7.x86_64/nvme.h b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.81-17.1.al7.x86_64/nvme.h index 500b3bc2..b0aaeba4 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.81-17.1.al7.x86_64/nvme.h +++ b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.81-17.1.al7.x86_64/nvme.h @@ -56,5 +56,4 @@ static unsigned long get_cmd_ctx(struct nvme_queue *nvmeq, struct request *rq) //struct nvme_iod *iod = blk_mq_rq_to_pdu(req); return 0; } -void get_nvme_info(struct nvme_info *nvme_i, struct request *rq); #endif diff --git a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.81-17.1.al7.x86_64/virtio_blk.h b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.81-17.1.al7.x86_64/virtio_blk.h index 8aed3694..34e5cb77 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.81-17.1.al7.x86_64/virtio_blk.h +++ b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.81-17.1.al7.x86_64/virtio_blk.h @@ -151,7 +151,6 @@ struct blk_flush_queue { spinlock_t mq_flush_lock; }; -//only kernel ali4000 >= 007 static inline int enable_detect_flush_rq(void) { return 1; @@ -191,7 +190,6 @@ static inline unsigned long get_issue_driver_ns(struct request *rq) } /* - * (ALIKERNEL && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 151)) || * LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0) */ static inline u64 get_check_hang_time_ns(void) @@ -214,30 +212,8 @@ static void blk_mq_check_rq_hang(struct blk_mq_hw_ctx *hctx, static inline int iter_all_rq(struct request_queue *q, blk_mq_rq_iter fn, void *data) { fn_blk_mq_check_hang = fn; -/* -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0) -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0) - if (!percpu_ref_tryget(&q->q_usage_counter)) - return -EBUSY; -#endif -*/ + sym_blk_mq_queue_tag_busy_iter(q, blk_mq_check_rq_hang, data); -/* -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0) - blk_queue_exit(q); -#endif -#else - struct blk_mq_hw_ctx *hctx; - int i; - - queue_for_each_hw_ctx(q, hctx, i) { - if (!(hctx->nr_ctx && hctx->tags)) - continue; - blk_mq_tag_busy_iter(hctx, blk_mq_check_rq_hang, data); - } -#endif -*/ return 0; } -void get_vq_info(struct vq_info *vq_i, struct request *rq); #endif diff --git a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.81-17.2.al7.x86_64/nvme.h b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.81-17.2.al7.x86_64/nvme.h index 500b3bc2..b0aaeba4 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.81-17.2.al7.x86_64/nvme.h +++ b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.81-17.2.al7.x86_64/nvme.h @@ -56,5 +56,4 @@ static unsigned long get_cmd_ctx(struct nvme_queue *nvmeq, struct request *rq) //struct nvme_iod *iod = blk_mq_rq_to_pdu(req); return 0; } -void get_nvme_info(struct nvme_info *nvme_i, struct request *rq); #endif diff --git a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.81-17.2.al7.x86_64/virtio_blk.h b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.81-17.2.al7.x86_64/virtio_blk.h index 8aed3694..34e5cb77 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.81-17.2.al7.x86_64/virtio_blk.h +++ b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.81-17.2.al7.x86_64/virtio_blk.h @@ -151,7 +151,6 @@ struct blk_flush_queue { spinlock_t mq_flush_lock; }; -//only kernel ali4000 >= 007 static inline int enable_detect_flush_rq(void) { return 1; @@ -191,7 +190,6 @@ static inline unsigned long get_issue_driver_ns(struct request *rq) } /* - * (ALIKERNEL && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 151)) || * LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0) */ static inline u64 get_check_hang_time_ns(void) @@ -214,30 +212,8 @@ static void blk_mq_check_rq_hang(struct blk_mq_hw_ctx *hctx, static inline int iter_all_rq(struct request_queue *q, blk_mq_rq_iter fn, void *data) { fn_blk_mq_check_hang = fn; -/* -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0) -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0) - if (!percpu_ref_tryget(&q->q_usage_counter)) - return -EBUSY; -#endif -*/ + sym_blk_mq_queue_tag_busy_iter(q, blk_mq_check_rq_hang, data); -/* -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0) - blk_queue_exit(q); -#endif -#else - struct blk_mq_hw_ctx *hctx; - int i; - - queue_for_each_hw_ctx(q, hctx, i) { - if (!(hctx->nr_ctx && hctx->tags)) - continue; - blk_mq_tag_busy_iter(hctx, blk_mq_check_rq_hang, data); - } -#endif -*/ return 0; } -void get_vq_info(struct vq_info *vq_i, struct request *rq); #endif diff --git a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-18.al7.x86_64/nvme.h b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-18.al7.x86_64/nvme.h index 500b3bc2..b0aaeba4 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-18.al7.x86_64/nvme.h +++ b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-18.al7.x86_64/nvme.h @@ -56,5 +56,4 @@ static unsigned long get_cmd_ctx(struct nvme_queue *nvmeq, struct request *rq) //struct nvme_iod *iod = blk_mq_rq_to_pdu(req); return 0; } -void get_nvme_info(struct nvme_info *nvme_i, struct request *rq); #endif diff --git a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-18.al7.x86_64/virtio_blk.h b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-18.al7.x86_64/virtio_blk.h index 55f4db57..04f75180 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-18.al7.x86_64/virtio_blk.h +++ b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-18.al7.x86_64/virtio_blk.h @@ -157,7 +157,6 @@ struct blk_flush_queue { spinlock_t mq_flush_lock; }; -//only kernel ali4000 >= 007 static inline int enable_detect_flush_rq(void) { return 1; @@ -197,7 +196,6 @@ static inline unsigned long get_issue_driver_ns(struct request *rq) } /* - * (ALIKERNEL && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 151)) || * LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0) */ static inline u64 get_check_hang_time_ns(void) @@ -220,29 +218,8 @@ static void blk_mq_check_rq_hang(struct blk_mq_hw_ctx *hctx, static inline int iter_all_rq(struct request_queue *q, blk_mq_rq_iter fn, void *data) { fn_blk_mq_check_hang = fn; -/* -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0) -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0) - if (!percpu_ref_tryget(&q->q_usage_counter)) - return -EBUSY; -#endif -*/ + sym_blk_mq_queue_tag_busy_iter(q, blk_mq_check_rq_hang, data); -/* -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0) - blk_queue_exit(q); -#endif -#else - struct blk_mq_hw_ctx *hctx; - int i; - - queue_for_each_hw_ctx(q, hctx, i) { - if (!(hctx->nr_ctx && hctx->tags)) - continue; - blk_mq_tag_busy_iter(hctx, blk_mq_check_rq_hang, data); - } -#endif -*/ return 0; } void get_vq_info(struct vq_info *vq_i, struct request *rq); diff --git a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-19.1.al7.x86_64/nvme.h b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-19.1.al7.x86_64/nvme.h index 500b3bc2..b0aaeba4 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-19.1.al7.x86_64/nvme.h +++ b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-19.1.al7.x86_64/nvme.h @@ -56,5 +56,4 @@ static unsigned long get_cmd_ctx(struct nvme_queue *nvmeq, struct request *rq) //struct nvme_iod *iod = blk_mq_rq_to_pdu(req); return 0; } -void get_nvme_info(struct nvme_info *nvme_i, struct request *rq); #endif diff --git a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-19.1.al7.x86_64/virtio_blk.h b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-19.1.al7.x86_64/virtio_blk.h index 55f4db57..1a189196 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-19.1.al7.x86_64/virtio_blk.h +++ b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-19.1.al7.x86_64/virtio_blk.h @@ -157,7 +157,6 @@ struct blk_flush_queue { spinlock_t mq_flush_lock; }; -//only kernel ali4000 >= 007 static inline int enable_detect_flush_rq(void) { return 1; @@ -197,7 +196,6 @@ static inline unsigned long get_issue_driver_ns(struct request *rq) } /* - * (ALIKERNEL && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 151)) || * LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0) */ static inline u64 get_check_hang_time_ns(void) @@ -220,30 +218,8 @@ static void blk_mq_check_rq_hang(struct blk_mq_hw_ctx *hctx, static inline int iter_all_rq(struct request_queue *q, blk_mq_rq_iter fn, void *data) { fn_blk_mq_check_hang = fn; -/* -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0) -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0) - if (!percpu_ref_tryget(&q->q_usage_counter)) - return -EBUSY; -#endif -*/ + sym_blk_mq_queue_tag_busy_iter(q, blk_mq_check_rq_hang, data); -/* -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0) - blk_queue_exit(q); -#endif -#else - struct blk_mq_hw_ctx *hctx; - int i; - - queue_for_each_hw_ctx(q, hctx, i) { - if (!(hctx->nr_ctx && hctx->tags)) - continue; - blk_mq_tag_busy_iter(hctx, blk_mq_check_rq_hang, data); - } -#endif -*/ return 0; } -void get_vq_info(struct vq_info *vq_i, struct request *rq); #endif diff --git a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-19.2.al7.x86_64/nvme.h b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-19.2.al7.x86_64/nvme.h index 500b3bc2..b0aaeba4 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-19.2.al7.x86_64/nvme.h +++ b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-19.2.al7.x86_64/nvme.h @@ -56,5 +56,4 @@ static unsigned long get_cmd_ctx(struct nvme_queue *nvmeq, struct request *rq) //struct nvme_iod *iod = blk_mq_rq_to_pdu(req); return 0; } -void get_nvme_info(struct nvme_info *nvme_i, struct request *rq); #endif diff --git a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-19.2.al7.x86_64/virtio_blk.h b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-19.2.al7.x86_64/virtio_blk.h index 55f4db57..1a189196 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-19.2.al7.x86_64/virtio_blk.h +++ b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-19.2.al7.x86_64/virtio_blk.h @@ -157,7 +157,6 @@ struct blk_flush_queue { spinlock_t mq_flush_lock; }; -//only kernel ali4000 >= 007 static inline int enable_detect_flush_rq(void) { return 1; @@ -197,7 +196,6 @@ static inline unsigned long get_issue_driver_ns(struct request *rq) } /* - * (ALIKERNEL && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 151)) || * LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0) */ static inline u64 get_check_hang_time_ns(void) @@ -220,30 +218,8 @@ static void blk_mq_check_rq_hang(struct blk_mq_hw_ctx *hctx, static inline int iter_all_rq(struct request_queue *q, blk_mq_rq_iter fn, void *data) { fn_blk_mq_check_hang = fn; -/* -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0) -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0) - if (!percpu_ref_tryget(&q->q_usage_counter)) - return -EBUSY; -#endif -*/ + sym_blk_mq_queue_tag_busy_iter(q, blk_mq_check_rq_hang, data); -/* -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0) - blk_queue_exit(q); -#endif -#else - struct blk_mq_hw_ctx *hctx; - int i; - - queue_for_each_hw_ctx(q, hctx, i) { - if (!(hctx->nr_ctx && hctx->tags)) - continue; - blk_mq_tag_busy_iter(hctx, blk_mq_check_rq_hang, data); - } -#endif -*/ return 0; } -void get_vq_info(struct vq_info *vq_i, struct request *rq); #endif diff --git a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-21.2.al7.x86_64/nvme.h b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-21.2.al7.x86_64/nvme.h index 35cb9aba..9f328608 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-21.2.al7.x86_64/nvme.h +++ b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-21.2.al7.x86_64/nvme.h @@ -58,5 +58,4 @@ static unsigned long get_cmd_ctx(struct nvme_queue *nvmeq, struct request *rq) //struct nvme_iod *iod = blk_mq_rq_to_pdu(req); return 0; } -void get_nvme_info(struct nvme_info *nvme_i, struct request *rq); #endif diff --git a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-21.2.al7.x86_64/virtio_blk.h b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-21.2.al7.x86_64/virtio_blk.h index e7793610..853fa75e 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-21.2.al7.x86_64/virtio_blk.h +++ b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-21.2.al7.x86_64/virtio_blk.h @@ -173,7 +173,6 @@ struct blk_flush_queue { spinlock_t mq_flush_lock; }; -//only kernel ali4000 >= 007 static inline int enable_detect_flush_rq(void) { return 1; @@ -240,7 +239,6 @@ static inline unsigned long get_issue_driver_ns(struct request *rq) } /* - * (ALIKERNEL && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 151)) || * LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0) */ static inline u64 get_check_hang_time_ns(void) @@ -263,30 +261,8 @@ static void blk_mq_check_rq_hang(struct blk_mq_hw_ctx *hctx, static inline int iter_all_rq(struct request_queue *q, blk_mq_rq_iter fn, void *data) { fn_blk_mq_check_hang = fn; -/* -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0) -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0) - if (!percpu_ref_tryget(&q->q_usage_counter)) - return -EBUSY; -#endif -*/ + sym_blk_mq_queue_tag_busy_iter(q, blk_mq_check_rq_hang, data); -/* -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0) - blk_queue_exit(q); -#endif -#else - struct blk_mq_hw_ctx *hctx; - int i; - - queue_for_each_hw_ctx(q, hctx, i) { - if (!(hctx->nr_ctx && hctx->tags)) - continue; - blk_mq_tag_busy_iter(hctx, blk_mq_check_rq_hang, data); - } -#endif -*/ return 0; } -void get_vq_info(struct vq_info *vq_i, struct request *rq); #endif diff --git a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-21.al7.x86_64/nvme.h b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-21.al7.x86_64/nvme.h index 35cb9aba..9f328608 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-21.al7.x86_64/nvme.h +++ b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-21.al7.x86_64/nvme.h @@ -58,5 +58,4 @@ static unsigned long get_cmd_ctx(struct nvme_queue *nvmeq, struct request *rq) //struct nvme_iod *iod = blk_mq_rq_to_pdu(req); return 0; } -void get_nvme_info(struct nvme_info *nvme_i, struct request *rq); #endif diff --git a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-21.al7.x86_64/virtio_blk.h b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-21.al7.x86_64/virtio_blk.h index e7793610..853fa75e 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-21.al7.x86_64/virtio_blk.h +++ b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-21.al7.x86_64/virtio_blk.h @@ -173,7 +173,6 @@ struct blk_flush_queue { spinlock_t mq_flush_lock; }; -//only kernel ali4000 >= 007 static inline int enable_detect_flush_rq(void) { return 1; @@ -240,7 +239,6 @@ static inline unsigned long get_issue_driver_ns(struct request *rq) } /* - * (ALIKERNEL && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 151)) || * LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0) */ static inline u64 get_check_hang_time_ns(void) @@ -263,30 +261,8 @@ static void blk_mq_check_rq_hang(struct blk_mq_hw_ctx *hctx, static inline int iter_all_rq(struct request_queue *q, blk_mq_rq_iter fn, void *data) { fn_blk_mq_check_hang = fn; -/* -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0) -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0) - if (!percpu_ref_tryget(&q->q_usage_counter)) - return -EBUSY; -#endif -*/ + sym_blk_mq_queue_tag_busy_iter(q, blk_mq_check_rq_hang, data); -/* -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0) - blk_queue_exit(q); -#endif -#else - struct blk_mq_hw_ctx *hctx; - int i; - - queue_for_each_hw_ctx(q, hctx, i) { - if (!(hctx->nr_ctx && hctx->tags)) - continue; - blk_mq_tag_busy_iter(hctx, blk_mq_check_rq_hang, data); - } -#endif -*/ return 0; } -void get_vq_info(struct vq_info *vq_i, struct request *rq); #endif diff --git a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-22.1.al7.x86_64/nvme.h b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-22.1.al7.x86_64/nvme.h index 35cb9aba..9f328608 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-22.1.al7.x86_64/nvme.h +++ b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-22.1.al7.x86_64/nvme.h @@ -58,5 +58,4 @@ static unsigned long get_cmd_ctx(struct nvme_queue *nvmeq, struct request *rq) //struct nvme_iod *iod = blk_mq_rq_to_pdu(req); return 0; } -void get_nvme_info(struct nvme_info *nvme_i, struct request *rq); #endif diff --git a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-22.1.al7.x86_64/virtio_blk.h b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-22.1.al7.x86_64/virtio_blk.h index e7793610..853fa75e 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-22.1.al7.x86_64/virtio_blk.h +++ b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-22.1.al7.x86_64/virtio_blk.h @@ -173,7 +173,6 @@ struct blk_flush_queue { spinlock_t mq_flush_lock; }; -//only kernel ali4000 >= 007 static inline int enable_detect_flush_rq(void) { return 1; @@ -240,7 +239,6 @@ static inline unsigned long get_issue_driver_ns(struct request *rq) } /* - * (ALIKERNEL && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 151)) || * LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0) */ static inline u64 get_check_hang_time_ns(void) @@ -263,30 +261,8 @@ static void blk_mq_check_rq_hang(struct blk_mq_hw_ctx *hctx, static inline int iter_all_rq(struct request_queue *q, blk_mq_rq_iter fn, void *data) { fn_blk_mq_check_hang = fn; -/* -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0) -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0) - if (!percpu_ref_tryget(&q->q_usage_counter)) - return -EBUSY; -#endif -*/ + sym_blk_mq_queue_tag_busy_iter(q, blk_mq_check_rq_hang, data); -/* -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0) - blk_queue_exit(q); -#endif -#else - struct blk_mq_hw_ctx *hctx; - int i; - - queue_for_each_hw_ctx(q, hctx, i) { - if (!(hctx->nr_ctx && hctx->tags)) - continue; - blk_mq_tag_busy_iter(hctx, blk_mq_check_rq_hang, data); - } -#endif -*/ return 0; } -void get_vq_info(struct vq_info *vq_i, struct request *rq); #endif diff --git a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-22.2.al7.x86_64/nvme.h b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-22.2.al7.x86_64/nvme.h index 35cb9aba..9f328608 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-22.2.al7.x86_64/nvme.h +++ b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-22.2.al7.x86_64/nvme.h @@ -58,5 +58,4 @@ static unsigned long get_cmd_ctx(struct nvme_queue *nvmeq, struct request *rq) //struct nvme_iod *iod = blk_mq_rq_to_pdu(req); return 0; } -void get_nvme_info(struct nvme_info *nvme_i, struct request *rq); #endif diff --git a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-22.2.al7.x86_64/virtio_blk.h b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-22.2.al7.x86_64/virtio_blk.h index e7793610..853fa75e 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-22.2.al7.x86_64/virtio_blk.h +++ b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-22.2.al7.x86_64/virtio_blk.h @@ -173,7 +173,6 @@ struct blk_flush_queue { spinlock_t mq_flush_lock; }; -//only kernel ali4000 >= 007 static inline int enable_detect_flush_rq(void) { return 1; @@ -240,7 +239,6 @@ static inline unsigned long get_issue_driver_ns(struct request *rq) } /* - * (ALIKERNEL && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 151)) || * LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0) */ static inline u64 get_check_hang_time_ns(void) @@ -263,30 +261,8 @@ static void blk_mq_check_rq_hang(struct blk_mq_hw_ctx *hctx, static inline int iter_all_rq(struct request_queue *q, blk_mq_rq_iter fn, void *data) { fn_blk_mq_check_hang = fn; -/* -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0) -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0) - if (!percpu_ref_tryget(&q->q_usage_counter)) - return -EBUSY; -#endif -*/ + sym_blk_mq_queue_tag_busy_iter(q, blk_mq_check_rq_hang, data); -/* -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0) - blk_queue_exit(q); -#endif -#else - struct blk_mq_hw_ctx *hctx; - int i; - - queue_for_each_hw_ctx(q, hctx, i) { - if (!(hctx->nr_ctx && hctx->tags)) - continue; - blk_mq_tag_busy_iter(hctx, blk_mq_check_rq_hang, data); - } -#endif -*/ return 0; } -void get_vq_info(struct vq_info *vq_i, struct request *rq); #endif diff --git a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-23.4.an8.x86_64/nvme.h b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-23.4.an8.x86_64/nvme.h index 35cb9aba..9f328608 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-23.4.an8.x86_64/nvme.h +++ b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-23.4.an8.x86_64/nvme.h @@ -58,5 +58,4 @@ static unsigned long get_cmd_ctx(struct nvme_queue *nvmeq, struct request *rq) //struct nvme_iod *iod = blk_mq_rq_to_pdu(req); return 0; } -void get_nvme_info(struct nvme_info *nvme_i, struct request *rq); #endif diff --git a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-23.4.an8.x86_64/virtio_blk.h b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-23.4.an8.x86_64/virtio_blk.h index e7793610..853fa75e 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-23.4.an8.x86_64/virtio_blk.h +++ b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-23.4.an8.x86_64/virtio_blk.h @@ -173,7 +173,6 @@ struct blk_flush_queue { spinlock_t mq_flush_lock; }; -//only kernel ali4000 >= 007 static inline int enable_detect_flush_rq(void) { return 1; @@ -240,7 +239,6 @@ static inline unsigned long get_issue_driver_ns(struct request *rq) } /* - * (ALIKERNEL && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 151)) || * LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0) */ static inline u64 get_check_hang_time_ns(void) @@ -263,30 +261,8 @@ static void blk_mq_check_rq_hang(struct blk_mq_hw_ctx *hctx, static inline int iter_all_rq(struct request_queue *q, blk_mq_rq_iter fn, void *data) { fn_blk_mq_check_hang = fn; -/* -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0) -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0) - if (!percpu_ref_tryget(&q->q_usage_counter)) - return -EBUSY; -#endif -*/ + sym_blk_mq_queue_tag_busy_iter(q, blk_mq_check_rq_hang, data); -/* -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0) - blk_queue_exit(q); -#endif -#else - struct blk_mq_hw_ctx *hctx; - int i; - - queue_for_each_hw_ctx(q, hctx, i) { - if (!(hctx->nr_ctx && hctx->tags)) - continue; - blk_mq_tag_busy_iter(hctx, blk_mq_check_rq_hang, data); - } -#endif -*/ return 0; } -void get_vq_info(struct vq_info *vq_i, struct request *rq); #endif diff --git a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-23.al7.x86_64/nvme.h b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-23.al7.x86_64/nvme.h index 35cb9aba..9f328608 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-23.al7.x86_64/nvme.h +++ b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-23.al7.x86_64/nvme.h @@ -58,5 +58,4 @@ static unsigned long get_cmd_ctx(struct nvme_queue *nvmeq, struct request *rq) //struct nvme_iod *iod = blk_mq_rq_to_pdu(req); return 0; } -void get_nvme_info(struct nvme_info *nvme_i, struct request *rq); #endif diff --git a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-23.al7.x86_64/virtio_blk.h b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-23.al7.x86_64/virtio_blk.h index e7793610..853fa75e 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-23.al7.x86_64/virtio_blk.h +++ b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-23.al7.x86_64/virtio_blk.h @@ -173,7 +173,6 @@ struct blk_flush_queue { spinlock_t mq_flush_lock; }; -//only kernel ali4000 >= 007 static inline int enable_detect_flush_rq(void) { return 1; @@ -240,7 +239,6 @@ static inline unsigned long get_issue_driver_ns(struct request *rq) } /* - * (ALIKERNEL && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 151)) || * LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0) */ static inline u64 get_check_hang_time_ns(void) @@ -263,30 +261,8 @@ static void blk_mq_check_rq_hang(struct blk_mq_hw_ctx *hctx, static inline int iter_all_rq(struct request_queue *q, blk_mq_rq_iter fn, void *data) { fn_blk_mq_check_hang = fn; -/* -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0) -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0) - if (!percpu_ref_tryget(&q->q_usage_counter)) - return -EBUSY; -#endif -*/ + sym_blk_mq_queue_tag_busy_iter(q, blk_mq_check_rq_hang, data); -/* -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0) - blk_queue_exit(q); -#endif -#else - struct blk_mq_hw_ctx *hctx; - int i; - - queue_for_each_hw_ctx(q, hctx, i) { - if (!(hctx->nr_ctx && hctx->tags)) - continue; - blk_mq_tag_busy_iter(hctx, blk_mq_check_rq_hang, data); - } -#endif -*/ return 0; } -void get_vq_info(struct vq_info *vq_i, struct request *rq); #endif diff --git a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-24.1.al7.x86_64/nvme.h b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-24.1.al7.x86_64/nvme.h index 35cb9aba..9f328608 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-24.1.al7.x86_64/nvme.h +++ b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-24.1.al7.x86_64/nvme.h @@ -58,5 +58,4 @@ static unsigned long get_cmd_ctx(struct nvme_queue *nvmeq, struct request *rq) //struct nvme_iod *iod = blk_mq_rq_to_pdu(req); return 0; } -void get_nvme_info(struct nvme_info *nvme_i, struct request *rq); #endif diff --git a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-24.1.al7.x86_64/virtio_blk.h b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-24.1.al7.x86_64/virtio_blk.h index e7793610..853fa75e 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-24.1.al7.x86_64/virtio_blk.h +++ b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-24.1.al7.x86_64/virtio_blk.h @@ -173,7 +173,6 @@ struct blk_flush_queue { spinlock_t mq_flush_lock; }; -//only kernel ali4000 >= 007 static inline int enable_detect_flush_rq(void) { return 1; @@ -240,7 +239,6 @@ static inline unsigned long get_issue_driver_ns(struct request *rq) } /* - * (ALIKERNEL && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 151)) || * LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0) */ static inline u64 get_check_hang_time_ns(void) @@ -263,30 +261,8 @@ static void blk_mq_check_rq_hang(struct blk_mq_hw_ctx *hctx, static inline int iter_all_rq(struct request_queue *q, blk_mq_rq_iter fn, void *data) { fn_blk_mq_check_hang = fn; -/* -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0) -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0) - if (!percpu_ref_tryget(&q->q_usage_counter)) - return -EBUSY; -#endif -*/ + sym_blk_mq_queue_tag_busy_iter(q, blk_mq_check_rq_hang, data); -/* -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0) - blk_queue_exit(q); -#endif -#else - struct blk_mq_hw_ctx *hctx; - int i; - - queue_for_each_hw_ctx(q, hctx, i) { - if (!(hctx->nr_ctx && hctx->tags)) - continue; - blk_mq_tag_busy_iter(hctx, blk_mq_check_rq_hang, data); - } -#endif -*/ return 0; } -void get_vq_info(struct vq_info *vq_i, struct request *rq); #endif diff --git a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-24.8.an8.x86_64/nvme.h b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-24.8.an8.x86_64/nvme.h index 35cb9aba..9f328608 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-24.8.an8.x86_64/nvme.h +++ b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-24.8.an8.x86_64/nvme.h @@ -58,5 +58,4 @@ static unsigned long get_cmd_ctx(struct nvme_queue *nvmeq, struct request *rq) //struct nvme_iod *iod = blk_mq_rq_to_pdu(req); return 0; } -void get_nvme_info(struct nvme_info *nvme_i, struct request *rq); #endif diff --git a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-24.8.an8.x86_64/virtio_blk.h b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-24.8.an8.x86_64/virtio_blk.h index e7793610..853fa75e 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-24.8.an8.x86_64/virtio_blk.h +++ b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-24.8.an8.x86_64/virtio_blk.h @@ -173,7 +173,6 @@ struct blk_flush_queue { spinlock_t mq_flush_lock; }; -//only kernel ali4000 >= 007 static inline int enable_detect_flush_rq(void) { return 1; @@ -240,7 +239,6 @@ static inline unsigned long get_issue_driver_ns(struct request *rq) } /* - * (ALIKERNEL && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 151)) || * LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0) */ static inline u64 get_check_hang_time_ns(void) @@ -263,30 +261,8 @@ static void blk_mq_check_rq_hang(struct blk_mq_hw_ctx *hctx, static inline int iter_all_rq(struct request_queue *q, blk_mq_rq_iter fn, void *data) { fn_blk_mq_check_hang = fn; -/* -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0) -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0) - if (!percpu_ref_tryget(&q->q_usage_counter)) - return -EBUSY; -#endif -*/ + sym_blk_mq_queue_tag_busy_iter(q, blk_mq_check_rq_hang, data); -/* -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0) - blk_queue_exit(q); -#endif -#else - struct blk_mq_hw_ctx *hctx; - int i; - - queue_for_each_hw_ctx(q, hctx, i) { - if (!(hctx->nr_ctx && hctx->tags)) - continue; - blk_mq_tag_busy_iter(hctx, blk_mq_check_rq_hang, data); - } -#endif -*/ return 0; } -void get_vq_info(struct vq_info *vq_i, struct request *rq); #endif diff --git a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-24.al7.x86_64/nvme.h b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-24.al7.x86_64/nvme.h index 35cb9aba..9f328608 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-24.al7.x86_64/nvme.h +++ b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-24.al7.x86_64/nvme.h @@ -58,5 +58,4 @@ static unsigned long get_cmd_ctx(struct nvme_queue *nvmeq, struct request *rq) //struct nvme_iod *iod = blk_mq_rq_to_pdu(req); return 0; } -void get_nvme_info(struct nvme_info *nvme_i, struct request *rq); #endif diff --git a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-24.al7.x86_64/virtio_blk.h b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-24.al7.x86_64/virtio_blk.h index e7793610..42192d6d 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-24.al7.x86_64/virtio_blk.h +++ b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-24.al7.x86_64/virtio_blk.h @@ -173,7 +173,6 @@ struct blk_flush_queue { spinlock_t mq_flush_lock; }; -//only kernel ali4000 >= 007 static inline int enable_detect_flush_rq(void) { return 1; @@ -240,7 +239,6 @@ static inline unsigned long get_issue_driver_ns(struct request *rq) } /* - * (ALIKERNEL && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 151)) || * LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0) */ static inline u64 get_check_hang_time_ns(void) @@ -248,9 +246,7 @@ static inline u64 get_check_hang_time_ns(void) return ktime_get_ns(); } -//#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0) extern fn_queue_tag_busy_iter sym_blk_mq_queue_tag_busy_iter; -//#endif typedef void (*blk_mq_rq_iter)(struct request *, void *, bool); static blk_mq_rq_iter fn_blk_mq_check_hang = NULL; static void blk_mq_check_rq_hang(struct blk_mq_hw_ctx *hctx, @@ -263,30 +259,7 @@ static void blk_mq_check_rq_hang(struct blk_mq_hw_ctx *hctx, static inline int iter_all_rq(struct request_queue *q, blk_mq_rq_iter fn, void *data) { fn_blk_mq_check_hang = fn; -/* -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0) -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0) - if (!percpu_ref_tryget(&q->q_usage_counter)) - return -EBUSY; -#endif -*/ sym_blk_mq_queue_tag_busy_iter(q, blk_mq_check_rq_hang, data); -/* -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0) - blk_queue_exit(q); -#endif -#else - struct blk_mq_hw_ctx *hctx; - int i; - - queue_for_each_hw_ctx(q, hctx, i) { - if (!(hctx->nr_ctx && hctx->tags)) - continue; - blk_mq_tag_busy_iter(hctx, blk_mq_check_rq_hang, data); - } -#endif -*/ return 0; } -void get_vq_info(struct vq_info *vq_i, struct request *rq); #endif diff --git a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-25.an8.x86_64/nvme.h b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-25.an8.x86_64/nvme.h index 35cb9aba..9f328608 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-25.an8.x86_64/nvme.h +++ b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-25.an8.x86_64/nvme.h @@ -58,5 +58,4 @@ static unsigned long get_cmd_ctx(struct nvme_queue *nvmeq, struct request *rq) //struct nvme_iod *iod = blk_mq_rq_to_pdu(req); return 0; } -void get_nvme_info(struct nvme_info *nvme_i, struct request *rq); #endif diff --git a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-25.an8.x86_64/virtio_blk.h b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-25.an8.x86_64/virtio_blk.h index e7793610..853fa75e 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-25.an8.x86_64/virtio_blk.h +++ b/source/lib/internal/kernel_module/modules/iosdiag/include/4.19.91-25.an8.x86_64/virtio_blk.h @@ -173,7 +173,6 @@ struct blk_flush_queue { spinlock_t mq_flush_lock; }; -//only kernel ali4000 >= 007 static inline int enable_detect_flush_rq(void) { return 1; @@ -240,7 +239,6 @@ static inline unsigned long get_issue_driver_ns(struct request *rq) } /* - * (ALIKERNEL && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 151)) || * LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0) */ static inline u64 get_check_hang_time_ns(void) @@ -263,30 +261,8 @@ static void blk_mq_check_rq_hang(struct blk_mq_hw_ctx *hctx, static inline int iter_all_rq(struct request_queue *q, blk_mq_rq_iter fn, void *data) { fn_blk_mq_check_hang = fn; -/* -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0) -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0) - if (!percpu_ref_tryget(&q->q_usage_counter)) - return -EBUSY; -#endif -*/ + sym_blk_mq_queue_tag_busy_iter(q, blk_mq_check_rq_hang, data); -/* -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0) - blk_queue_exit(q); -#endif -#else - struct blk_mq_hw_ctx *hctx; - int i; - - queue_for_each_hw_ctx(q, hctx, i) { - if (!(hctx->nr_ctx && hctx->tags)) - continue; - blk_mq_tag_busy_iter(hctx, blk_mq_check_rq_hang, data); - } -#endif -*/ return 0; } -void get_vq_info(struct vq_info *vq_i, struct request *rq); #endif diff --git a/source/lib/internal/kernel_module/modules/iosdiag/iosdiag.c b/source/lib/internal/kernel_module/modules/iosdiag/iosdiag.c index c8efa55b..859cdf43 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/iosdiag.c +++ b/source/lib/internal/kernel_module/modules/iosdiag/iosdiag.c @@ -244,7 +244,7 @@ static ssize_t rq_hang_store(struct file *file, return -EFAULT; /* echo "vdb:253:16 1000" > /proc/xxxxx */ - if (p = strstr(chr, ":")) { + if ((p = strstr(chr, ":"))) { memcpy(diskname, chr, (p - chr)); ret = sscanf(p+1, "%d:%d %d %d", &major, &minor, &threshold, &g_bio_file_info); if (ret < 3 || threshold <= 0 || major < 1 || minor < 0) { @@ -335,7 +335,4 @@ int disk_hang_exit(void) remove_proc_subtree(DISKHANG_DIR_NAME, NULL); return 0; } -//module_init(disk_hang_init); -//module_exit(disk_hang_exit); -MODULE_LICENSE("GPL"); diff --git a/source/lib/internal/kernel_module/modules/iosdiag/rq_hang.c b/source/lib/internal/kernel_module/modules/iosdiag/rq_hang.c index fb4f56a2..b4a530fd 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/rq_hang.c +++ b/source/lib/internal/kernel_module/modules/iosdiag/rq_hang.c @@ -16,7 +16,6 @@ #include #include "iosdiag.h" #include -#include struct req_op_name{ int op; @@ -53,7 +52,10 @@ static const char *const blk_mq_rq_state_name_array[] = { extern fn_get_files_struct sym_get_files_struct; extern fn_put_files_struct sym_put_files_struct; extern int get_bio_file_info(void); + +extern void get_vq_info(struct vq_info *vq_i, struct request *rq); extern void get_scsi_info(struct scsi_info *scsi_i, struct request *rq); +extern void get_nvme_info(struct nvme_info *nvme_i, struct request *rq); static char *get_disk_name(struct gendisk *hd, int partno, char *buf) { @@ -83,8 +85,7 @@ static void blk_rq_op_name(int op_flags, char *op_buf, int buf_len) if ((len = strlen(op_buf)) >= buf_len) return; if (len) { - strncat(op_buf, "|", min((strlen("|") + 1), - (buf_len - len))); + strncat(op_buf, "|", min((strlen("|") + 1),(buf_len - len))); op_buf[buf_len - 1] = '\0'; if ((len = strlen(op_buf)) >= buf_len) return; @@ -265,17 +266,12 @@ static void get_bio_info(struct bio_info *bio_i, struct bio *bio) static void get_rq_info(struct rq_hang_info *rq_hi, struct request *rq) { char op_buf[MAX_OP_NAME_SIZE]; - int op; rq_hi->data_len = rq->__data_len; rq_hi->sector = rq->__sector; strcpy(op_buf, ""); - //rq_hi->cmd_flags = rq->cmd_flags; - //rq_hi->errors = rq->errors; #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0) - //op = rq->cmd_flags & REQ_OP_MASK; - op = req_op(rq); - blk_rq_op_name(op, op_buf, sizeof(op_buf)); + blk_rq_op_name(req_op(rq), op_buf, sizeof(op_buf)); #else blk_rq_op_name(rq->cmd_flags, op_buf, sizeof(op_buf)); #endif diff --git a/source/lib/internal/kernel_module/modules/iosdiag/virtio_blk.c b/source/lib/internal/kernel_module/modules/iosdiag/virtio_blk.c index 0e3dc830..920339d4 100644 --- a/source/lib/internal/kernel_module/modules/iosdiag/virtio_blk.c +++ b/source/lib/internal/kernel_module/modules/iosdiag/virtio_blk.c @@ -55,7 +55,6 @@ static int get_rq_avail_idx(struct request *rq) u16 last_used_idx; u16 current_avail_idx; int head; - void *data; if (!(vq = get_virtqueue_by_rq(rq))) return -1; @@ -65,11 +64,12 @@ static int get_rq_avail_idx(struct request *rq) while (last_used_idx <= current_avail_idx) { i = last_used_idx & (vring->num - 1); head = virtio16_to_cpu(vq->vdev, vring->avail->ring[i]); - if (head < vring->num) + if (head < vring->num) { if (desc_state_data_to_req(vq, head) == rq) return last_used_idx; - else + } else { return -1; + } last_used_idx++; } return -1; @@ -83,7 +83,6 @@ static int get_rq_used_idx(struct request *rq) u16 last_used_idx; u16 used_idx; int head; - void *data; if (!(vq = get_virtqueue_by_rq(rq))) return -1; @@ -93,11 +92,12 @@ static int get_rq_used_idx(struct request *rq) while (last_used_idx < used_idx) { i = last_used_idx & (vring->num - 1); head = virtio32_to_cpu(vq->vdev, vring->used->ring[i].id); - if (head < vring->num) + if (head < vring->num) { if (desc_state_data_to_req(vq, head) == rq) return last_used_idx; - else + } else { return -1; + } last_used_idx++; } return -1; -- Gitee From adaeeb89871d45c908d528ba68db052d5a35244a Mon Sep 17 00:00:00 2001 From: "guangshui.li" Date: Mon, 11 Apr 2022 14:34:31 +0800 Subject: [PATCH 2/3] fcachetop: Add tool fcachetop Signed-off-by: guangshui.li --- doc/fcachetop.txt | 84 +++++++ source/tools/detect/fcachetop/Makefile | 3 + source/tools/detect/fcachetop/README.md | 86 +++++++ source/tools/detect/fcachetop/fcachetop.py | 247 +++++++++++++++++++++ 4 files changed, 420 insertions(+) create mode 100644 doc/fcachetop.txt create mode 100644 source/tools/detect/fcachetop/Makefile create mode 100644 source/tools/detect/fcachetop/README.md create mode 100755 source/tools/detect/fcachetop/fcachetop.py diff --git a/doc/fcachetop.txt b/doc/fcachetop.txt new file mode 100644 index 00000000..82b827a2 --- /dev/null +++ b/doc/fcachetop.txt @@ -0,0 +1,84 @@ +1 fcachetop +统计系统当前已打开文件的page cache占用情况以及cache命中率 + +2 sysak打包 +在编译sysak的之前,需要在执行configure配置的时候加上--enable-target-fcachetop才能打包进sysak + +3 使用 +3.1 参数说明 +usage: fcachetop.py [-h] [-f FILE] [-i INTERVAL] [-T TOP] [-v] + +Statistics the file page cached. + +optional arguments: + -h, --help show this help message and exit + -f FILE, --file FILE Statistics the file pages cached from specified file. + -i INTERVAL, --interval INTERVAL + Display the file pages cached per N seconds(CTRL+C + exit). + -T TOP, --top TOP Display the file pages cached of TopN (default Top + 10). + -v, --verbo Display the full path of the file(By default, when the + file path exceeds 48 characters, the full path of the + file is hidden). + +e.g. +./fcachetop Display the file pages cached of Top10 +./fcachetop -f /xxx/file + Statistics the file pages cached for '/xxx/file' +./fcachetop -i 2 Display the file pages cached per N seconds(CTRL+C exit) +./fcachetop -T 30 Display the file pages cached of Top30 + +3.2 使用示例 +./fcachetop.py #统计一次正打开文件的pagecache占用情况(没有指定-T参数,默认只显示pagecache大小前top10的文件) + +The top10 Max cached open files: +Name Cached pages/size Total pages Hit percent Comm:Pid +/var/log/jour...6b05d-0005dc529a33350d.journal 16896/66.00MB 18432 91.67% syslog-ng:37270 +/var/log/jour...f3ac2-0005dc3046c2f0f8.journal 16878/65.93MB 18432 91.57% syslog-ng:37270 +/var/log/jour...26d50-0005dc3efde06626.journal 16871/65.90MB 18432 91.53% syslog-ng:37270 +/var/log/jour...04ba3-0005dc352f25db7c.journal 16864/65.88MB 18432 91.49% syslog-ng:37270 +/var/log/jour...37e1d-0005dc43e5e6b981.journal 16860/65.86MB 18432 91.47% syslog-ng:37270 +/var/log/jour...c0849-0005dc219110f1fa.journal 16852/65.83MB 18432 91.43% syslog-ng:37270 +/var/log/jour...e29ed-0005dc2b5f3649be.journal 16851/65.82MB 18432 91.42% syslog-ng:37270 +/var/log/jour...48ec5-0005dc48cc13376b.journal 16844/65.80MB 18432 91.38% syslog-ng:37270 +/var/log/jour...d1925-0005dc2677f2db59.journal 16843/65.79MB 18432 91.38% syslog-ng:37270 +/var/log/jour...59f90-0005dc4db42a2abc.journal 16840/65.78MB 18432 91.36% syslog-ng:37270 +/var/log/jour...af777-0005dc1ca9f8839c.journal 16837/65.77MB 18432 91.35% syslog-ng:37270 +Total cached 3.01GB for all open files + +Name:文件名称,默认情况下当文件路径长度大于48个字符会隐藏,可指定-v参数显示文件全路径 +Cached pages/size:文件目前占用的page页数/大小 +Total pages:当文件全部命中cache时,需要的page总数 +Hit percent:page cache命中率 +Comm:Pid:进程名:进程ID + + +./fcachetop.py -T 20 -i 1 #间隔1秒统计一次正打开文件的pagecache占用情况(指定-i参数,会持续统计,直到ctrl+c退出,指定-T 20,展示前top20的文件) + +The top20 Max cached open files: +Name Cached pages/size Total pages Hit percent Comm:Pid +/var/log/jour...6b05d-0005dc529a33350d.journal 16896/66.00MB 18432 91.67% syslog-ng:37270 +/var/log/jour...f3ac2-0005dc3046c2f0f8.journal 16878/65.93MB 18432 91.57% syslog-ng:37270 +/var/log/jour...26d50-0005dc3efde06626.journal 16871/65.90MB 18432 91.53% syslog-ng:37270 +/var/log/jour...04ba3-0005dc352f25db7c.journal 16864/65.88MB 18432 91.49% syslog-ng:37270 +/var/log/jour...37e1d-0005dc43e5e6b981.journal 16860/65.86MB 18432 91.47% syslog-ng:37270 +/var/log/jour...c0849-0005dc219110f1fa.journal 16852/65.83MB 18432 91.43% syslog-ng:37270 +/var/log/jour...e29ed-0005dc2b5f3649be.journal 16851/65.82MB 18432 91.42% syslog-ng:37270 +/var/log/jour...48ec5-0005dc48cc13376b.journal 16844/65.80MB 18432 91.38% syslog-ng:37270 +/var/log/jour...d1925-0005dc2677f2db59.journal 16843/65.79MB 18432 91.38% syslog-ng:37270 +/var/log/jour...59f90-0005dc4db42a2abc.journal 16840/65.78MB 18432 91.36% syslog-ng:37270 +/var/log/jour...af777-0005dc1ca9f8839c.journal 16837/65.77MB 18432 91.35% syslog-ng:37270 +/var/log/jour...15c74-0005dc3a1635c914.journal 16818/65.70MB 18432 91.24% syslog-ng:37270 +/var/log/jour...9e6b0-0005dc17c46c9cd0.journal 16802/65.63MB 18432 91.16% syslog-ng:37270 +/var/log/jour...38767-0005db674394a250.journal 13942/54.46MB 18432 75.64% syslog-ng:37270 +/var/log/jour...8dc3c-0005db7fc43e8df1.journal 13903/54.31MB 18432 75.43% syslog-ng:37270 +/var/log/jour...49885-0005db6c2a83cf57.journal 13888/54.25MB 18432 75.35% syslog-ng:37270 +/var/log/jour...5a955-0005db7111d7a0e6.journal 13888/54.25MB 18432 75.35% syslog-ng:37270 +/var/log/jour...afa50-0005dbd320e74823.journal 13881/54.22MB 18432 75.31% syslog-ng:37270 +/var/log/jour...7cb00-0005db7add3d2cb1.journal 13862/54.15MB 18432 75.21% syslog-ng:37270 +/var/log/jour...8d5e1-0005dc12dd077fd9.journal 13849/54.10MB 18432 75.14% syslog-ng:37270 +/var/log/jour...e2c9d-0005dbe1d58d4561.journal 13844/54.08MB 18432 75.11% syslog-ng:37270 +Total cached 3.01GB for all open files(ctrl+c exit) #这里显示统计到正打开的总文件缓存占用情况 + + diff --git a/source/tools/detect/fcachetop/Makefile b/source/tools/detect/fcachetop/Makefile new file mode 100644 index 00000000..c0d3fe3f --- /dev/null +++ b/source/tools/detect/fcachetop/Makefile @@ -0,0 +1,3 @@ +target = fcachetop + +include $(SRC)/mk/py.mk diff --git a/source/tools/detect/fcachetop/README.md b/source/tools/detect/fcachetop/README.md new file mode 100644 index 00000000..55d38155 --- /dev/null +++ b/source/tools/detect/fcachetop/README.md @@ -0,0 +1,86 @@ +# fcachetop +统计系统当前已打开文件的page cache占用情况以及cache命中率 + +# sysak打包 +在编译sysak的之前,需要在执行configure配置的时候加上--enable-target-fcachetop才能打包进sysak + +# 使用 +## 参数说明 +``` +usage: fcachetop.py [-h] [-f FILE] [-i INTERVAL] [-T TOP] [-v] + +Statistics the file page cached. + +optional arguments: + -h, --help show this help message and exit + -f FILE, --file FILE Statistics the file pages cached from specified file. + -i INTERVAL, --interval INTERVAL + Display the file pages cached per N seconds(CTRL+C + exit). + -T TOP, --top TOP Display the file pages cached of TopN (default Top + 10). + -v, --verbo Display the full path of the file(By default, when the + file path exceeds 48 characters, the full path of the + file is hidden). + +e.g. +./fcachetop Display the file pages cached of Top10 +./fcachetop -f /xxx/file + Statistics the file pages cached for '/xxx/file' +./fcachetop -i 2 Display the file pages cached per N seconds(CTRL+C exit) +./fcachetop -T 30 Display the file pages cached of Top30 +``` +## 使用示例 +``` +./fcachetop.py #统计一次正打开文件的pagecache占用情况(没有指定-T参数,默认只显示pagecache大小前top10的文件) + +The top10 Max cached open files: +Name Cached pages/size Total pages Hit percent Comm:Pid +/var/log/jour...6b05d-0005dc529a33350d.journal 16896/66.00MB 18432 91.67% syslog-ng:37270 +/var/log/jour...f3ac2-0005dc3046c2f0f8.journal 16878/65.93MB 18432 91.57% syslog-ng:37270 +/var/log/jour...26d50-0005dc3efde06626.journal 16871/65.90MB 18432 91.53% syslog-ng:37270 +/var/log/jour...04ba3-0005dc352f25db7c.journal 16864/65.88MB 18432 91.49% syslog-ng:37270 +/var/log/jour...37e1d-0005dc43e5e6b981.journal 16860/65.86MB 18432 91.47% syslog-ng:37270 +/var/log/jour...c0849-0005dc219110f1fa.journal 16852/65.83MB 18432 91.43% syslog-ng:37270 +/var/log/jour...e29ed-0005dc2b5f3649be.journal 16851/65.82MB 18432 91.42% syslog-ng:37270 +/var/log/jour...48ec5-0005dc48cc13376b.journal 16844/65.80MB 18432 91.38% syslog-ng:37270 +/var/log/jour...d1925-0005dc2677f2db59.journal 16843/65.79MB 18432 91.38% syslog-ng:37270 +/var/log/jour...59f90-0005dc4db42a2abc.journal 16840/65.78MB 18432 91.36% syslog-ng:37270 +/var/log/jour...af777-0005dc1ca9f8839c.journal 16837/65.77MB 18432 91.35% syslog-ng:37270 +Total cached 3.01GB for all open files +``` +Name:文件名称,默认情况下当文件路径长度大于48个字符会隐藏,可指定-v参数显示文件全路径 +Cached pages/size:文件目前占用的page页数/大小 +Total pages:当文件全部命中cache时,需要的page总数 +Hit percent:page cache命中率 +Comm:Pid:进程名:进程ID + +``` +./fcachetop.py -T 20 -i 1 #间隔1秒统计一次正打开文件的pagecache占用情况(指定-i参数,会持续统计,知道ctrl+c退出,指定-T 20,展示前top20的文件) + +The top20 Max cached open files: +Name Cached pages/size Total pages Hit percent Comm:Pid +/var/log/jour...6b05d-0005dc529a33350d.journal 16896/66.00MB 18432 91.67% syslog-ng:37270 +/var/log/jour...f3ac2-0005dc3046c2f0f8.journal 16878/65.93MB 18432 91.57% syslog-ng:37270 +/var/log/jour...26d50-0005dc3efde06626.journal 16871/65.90MB 18432 91.53% syslog-ng:37270 +/var/log/jour...04ba3-0005dc352f25db7c.journal 16864/65.88MB 18432 91.49% syslog-ng:37270 +/var/log/jour...37e1d-0005dc43e5e6b981.journal 16860/65.86MB 18432 91.47% syslog-ng:37270 +/var/log/jour...c0849-0005dc219110f1fa.journal 16852/65.83MB 18432 91.43% syslog-ng:37270 +/var/log/jour...e29ed-0005dc2b5f3649be.journal 16851/65.82MB 18432 91.42% syslog-ng:37270 +/var/log/jour...48ec5-0005dc48cc13376b.journal 16844/65.80MB 18432 91.38% syslog-ng:37270 +/var/log/jour...d1925-0005dc2677f2db59.journal 16843/65.79MB 18432 91.38% syslog-ng:37270 +/var/log/jour...59f90-0005dc4db42a2abc.journal 16840/65.78MB 18432 91.36% syslog-ng:37270 +/var/log/jour...af777-0005dc1ca9f8839c.journal 16837/65.77MB 18432 91.35% syslog-ng:37270 +/var/log/jour...15c74-0005dc3a1635c914.journal 16818/65.70MB 18432 91.24% syslog-ng:37270 +/var/log/jour...9e6b0-0005dc17c46c9cd0.journal 16802/65.63MB 18432 91.16% syslog-ng:37270 +/var/log/jour...38767-0005db674394a250.journal 13942/54.46MB 18432 75.64% syslog-ng:37270 +/var/log/jour...8dc3c-0005db7fc43e8df1.journal 13903/54.31MB 18432 75.43% syslog-ng:37270 +/var/log/jour...49885-0005db6c2a83cf57.journal 13888/54.25MB 18432 75.35% syslog-ng:37270 +/var/log/jour...5a955-0005db7111d7a0e6.journal 13888/54.25MB 18432 75.35% syslog-ng:37270 +/var/log/jour...afa50-0005dbd320e74823.journal 13881/54.22MB 18432 75.31% syslog-ng:37270 +/var/log/jour...7cb00-0005db7add3d2cb1.journal 13862/54.15MB 18432 75.21% syslog-ng:37270 +/var/log/jour...8d5e1-0005dc12dd077fd9.journal 13849/54.10MB 18432 75.14% syslog-ng:37270 +/var/log/jour...e2c9d-0005dbe1d58d4561.journal 13844/54.08MB 18432 75.11% syslog-ng:37270 +Total cached 3.01GB for all open files(ctrl+c exit) #这里显示统计到正打开的总文件缓存占用情况 +``` + diff --git a/source/tools/detect/fcachetop/fcachetop.py b/source/tools/detect/fcachetop/fcachetop.py new file mode 100755 index 00000000..07014e6c --- /dev/null +++ b/source/tools/detect/fcachetop/fcachetop.py @@ -0,0 +1,247 @@ +#!/usr/bin/python2.7 +# -*- coding: UTF-8 -*- + +import os, sys, getopt, signal, threading +import argparse +from ctypes import c_int +from ctypes import c_size_t +from ctypes import c_ulong +from ctypes import c_ubyte +from ctypes import c_void_p +from ctypes import c_longlong +from ctypes import get_errno +from ctypes import CDLL +from ctypes import POINTER +from ctypes import cast +from mmap import MAP_SHARED +from mmap import PROT_READ +from mmap import PAGESIZE +from time import sleep + +try: + from ctypes import c_ssize_t + c_off_t = c_ssize_t +except ImportError: + is_64bits = sys.maxsize > 2 ** 32 + c_off_t = c_longlong if is_64bits else c_int + +if os.geteuid() != 0: + print "This program must be run as root. Aborting." + sys.exit(1) + +MAP_FAILED = c_ulong(-1).value +libc = CDLL(None) + +_mmap = libc.mmap +_mmap.restype = c_void_p +_mmap.argtypes = c_void_p, c_size_t, c_int, c_int, c_off_t + +_munmap = libc.munmap +_munmap.restype = c_void_p +_munmap.argtypes = c_void_p, c_size_t + +_mincore = libc.mincore +_mincore.restypes = c_int +_mincore.argtypes = c_void_p, c_size_t, POINTER(c_ubyte) + +hide_long_filepath = True + +def execCmd(cmd): + r = os.popen(cmd) + text = r.read() + r.close() + return text + +def hum_convert(value): + units = ["B", "KB", "MB", "GB", "TB", "PB"] + size = 1024.0 + for i in range(len(units)): + if (value / size) < 1: + return "%.2f%s" % (value, units[i]) + value = value / size + +global_stop = False +def signal_exit_handler(signum, frame): + global global_stop + global_stop = True + sys.exit(0) + +class Filecachestat: + def __init__(self, name, comm, pagecached, nr_page): + self.filename = name + self.comm = comm if comm is not None else '-' + self.pagecached = pagecached + self.nr_page = nr_page + self.hit_percent = round(float(pagecached) * 100 / float(nr_page), 2) + + def dumpStat(self, hide): + len_filename = len(self.filename) + filename = self.filename + if len_filename > 48: + if hide == 1: + filename_end = (self.filename)[(len_filename-30):len_filename] + filename_start = (self.filename)[0:13] + filename = "%s...%s" % (filename_start, filename_end) + else: + filename += ' ' + print "%s%s%-16d%-16s%s" \ + % (filename.ljust(48),\ + (str(self.pagecached)+'/'+hum_convert(self.pagecached*PAGESIZE)).ljust(24),\ + self.nr_page,\ + str(self.hit_percent)+"%",\ + self.comm) + +def getCacheStat(filename, comm): + if os.path.isfile(filename) and os.access(filename, os.R_OK): + f = open(filename) + size = os.fstat(f.fileno()).st_size + if size == 0: + f.close() + return 0 + addr = _mmap(0, size, PROT_READ, MAP_SHARED, f.fileno(), 0) + if addr == MAP_FAILED: + #print "Failed to mmap %s (errno: %d)" % (filename, get_errno()) + f.close() + return 0 + + nr_pages = (size + PAGESIZE - 1) / PAGESIZE + vec = (c_ubyte * nr_pages)() + ret = _mincore(addr, size, cast(vec, POINTER(c_ubyte))) + if ret != 0: + #print "mincore failed: 0x%x, 0x%x: %d, filename: %s" % (addr, size, get_errno(), filename) + _munmap(addr, size) + f.close() + return 0 + + cached = list(vec).count(1) + _munmap(addr, size) + f.close() + return Filecachestat(filename, comm, cached, nr_pages) + else: + #print "%s not existed" % filename + return 0 + +def getLsofFiles(): + fDicts = {} + pidList = os.listdir("/proc") + #list the open files of the task + for pid in pidList: + if pid.isdigit() is False: + continue + piddir = "/proc/"+pid + try: + fdList = os.listdir(piddir+"/fd") + for f in fdList: + try: + path = os.readlink(piddir+"/fd/"+f) + if '/' not in path or ('/dev/' in path and '/shm/' not in path) or '/proc/' in path or '/sys/' in path: + continue + with open(piddir+"/comm") as f: + comm = f.read().rstrip('\n') + fDicts.setdefault(path, comm+':'+pid) + except (IOError, EOFError) as e: + continue + except Exception: + continue + return fDicts + +global_stat_list = [] +def threadStatListUpdata(interval): + global global_stop + while global_stop != True: + fDicts = getLsofFiles() + #print(f_list) + stat_list = filter(None, [getCacheStat(filename,comm) for filename,comm in fDicts.items()]) + #f_dict = getProcessFiles() + #stat_list = filter(None, [getCacheStat(filename) for filename,existed in f_dict.items()]) + global global_stat_list + global_stat_list = sorted(stat_list, key=lambda x:x.pagecached, reverse=True) + if interval == 0: + break + sleep(interval - 1) + +def topFileCache(interval, top): + if interval == 0: + threadStatListUpdata(0) + else: + t = threading.Thread(target=threadStatListUpdata, args=(interval,)) + t.start() + global global_stop + while global_stop != True: + topDisplay = 0 + total_cached = 0 + os.system("clear") + print "The top%d Max cached open files:" %top + print(head_txt) + global global_stat_list + for stat in global_stat_list: + if topDisplay <= top: + stat.dumpStat(hide_long_filepath) + total_cached += (stat.pagecached * PAGESIZE) + topDisplay += 1 + if total_cached != 0: + print "Total cached %s for all open files%s" %(hum_convert(total_cached),'(ctrl+c exit)' if interval else '') + if interval == 0: + break + sleep(interval) + sys.exit(0) + +head_txt = "Name".ljust(48)+"Cached pages/size".ljust(24)+"Total pages".ljust(16)+"Hit percent".ljust(16)+"Comm:Pid" +usage_txt = "usage: \n./fcachetop [option] Statistics the open files page cached\n\ +-f, --file=filepath Statistics the file pages cached from specified file\n\ +-i, --interval=n Display the file pages cached per N seconds(ctrl+c exit)\n\ +-T, --top=n Display the file pages cached of TopN (default Top 10)\n\ +-v Display the full path of the file\n\ + (By default, when the file path exceeds 48 characters, the full path of the file is hidden)\n\ne.g.\n\ +./fcachetop Display the file pages cached of Top10\n\ +./fcachetop -f /xxx/file\n\ + Statistics the file pages cached for \'/xxx/file\'\n\ +./fcachetop -i 2 Display the file pages cached per N seconds(ctrl+c exit)\n\ +./fcachetop -T 30 Display the file pages cached of Top30\n" + +def usage(err): + print(usage_txt) + sys.exit(err) + +def main(): + examples = """e.g. +./fcachetop Display the file pages cached of Top10\n\ +./fcachetop -f /xxx/file\n\ + Statistics the file pages cached for \'/xxx/file\'\n\ +./fcachetop -i 2 Display the file pages cached per N seconds(CTRL+C exit)\n\ +./fcachetop -T 30 Display the file pages cached of Top30\n" + """ + parser = argparse.ArgumentParser( + description="Statistics the file page cached.", + formatter_class=argparse.RawDescriptionHelpFormatter, + epilog=examples) + parser.add_argument('-f','--file',\ + help='Statistics the file pages cached from specified file.') + parser.add_argument('-i','--interval', help='Display the file pages cached per N seconds(CTRL+C exit).') + parser.add_argument('-T','--top', help='Display the file pages cached of TopN (default Top 10).') + parser.add_argument('-v','--verbo', action='store_true',\ + help='Display the full path of the file(By default, when the file path exceeds 48 characters, the full path of the file is hidden).') + args = parser.parse_args() + + filename = args.file + func_top = True if args.file is None else False + top = int(args.top) if args.top else 10 + interval = int(args.interval) if args.interval is not None else 0 + + global hide_long_filepath + hide_long_filepath = False if args.verbo is None else True + + signal.signal(signal.SIGINT, signal_exit_handler) + signal.signal(signal.SIGHUP, signal_exit_handler) + signal.signal(signal.SIGTERM, signal_exit_handler) + if func_top == True: + os.system("clear") + topFileCache(interval, top) + elif filename is not None: + print(head_txt) + stat = getCacheStat(filename, None) + assert stat != 0, "getCacheStat() failed" + stat.dumpStat(hide_long_filepath) + +if __name__ == "__main__": + main() -- Gitee From b7a434029bdf920e44f6888590aa6341d0e43ad4 Mon Sep 17 00:00:00 2001 From: "guangshui.li" Date: Mon, 11 Apr 2022 14:38:18 +0800 Subject: [PATCH 3/3] fcachetop: Fix bug where target cannot be found Signed-off-by: guangshui.li --- source/tools/detect/fcachetop/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/tools/detect/fcachetop/Makefile b/source/tools/detect/fcachetop/Makefile index c0d3fe3f..8307f4c6 100644 --- a/source/tools/detect/fcachetop/Makefile +++ b/source/tools/detect/fcachetop/Makefile @@ -1,3 +1,3 @@ -target = fcachetop +target := fcachetop include $(SRC)/mk/py.mk -- Gitee