diff --git a/common/tool_cmd.py b/common/tool_cmd.py index 51239c004ef8bd1d76c5dde35fa03a8c4961e1ca..ad9a9ea72450d0bf429570dfaf836c9bc161bf98 100644 --- a/common/tool_cmd.py +++ b/common/tool_cmd.py @@ -29,6 +29,18 @@ class ToolCmd: return error_msg return error_msg + def __check_offcpu_cmdline(self, args): + error_msg = [] + if args.offcpu: + if not args.offcpu_pid: + error_msg = "need to specify --offcpu_pid option" + return error_msg + if not args.offcpu: + if args.offcpu_pid or args.offcpu_duration: + error_msg = "need to specify --offcpu option" + return error_msg + return error_msg + def __check_perf_pid(self, val): if not Command.check_pid_list(val, False): raise argparse.ArgumentTypeError("should set to -1 or existed process id")