From 8549db114fa5401d1c9456b92ebdd3ab82a48a47 Mon Sep 17 00:00:00 2001 From: xiejing Date: Tue, 9 Jul 2024 13:43:39 +0800 Subject: [PATCH] add function: __check_offcpu_pid --- category/get_perf_info.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/category/get_perf_info.py b/category/get_perf_info.py index 92afcc8..63d976c 100644 --- a/category/get_perf_info.py +++ b/category/get_perf_info.py @@ -144,6 +144,16 @@ class OffCPU(): else: return True + def __check_offcpu_pid(self): + if not (self.__pid.isdigit() and int(self.__pid) > 0): + Logger().error("检查参数 Application.OffCPU.pid 设置是否正确") + return False + if not Command.check_pid_exist(self.__pid, True): + Logger().error("检查参数 Application.OffCPU.pid 设置是否正确") + return False + else: + return True + # hotspot main function class Hotspot(): def __init__(self): -- Gitee