1 /* 2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef HIPERF_CPU_USAGE_TEST_H 17 #define HIPERF_CPU_USAGE_TEST_H 18 #include <stdio.h> 19 #include <stdlib.h> 20 #include <unistd.h> 21 #include <thread> 22 #include <chrono> 23 #include <string> 24 #include <sys/stat.h> 25 #include <sys/sysinfo.h> 26 #include <sys/time.h> 27 #include <string> 28 #include <fstream> 29 #include <gmock/gmock.h> 30 #include <gtest/gtest.h> 31 #include <sstream> 32 #include "subcommand_record.h" 33 #include "subcommand_stat.h" 34 #include "subcommand_report.h" 35 36 #define PROCESS_ITEM 14 37 #define HUNDRED 100 38 #define F100_FP_CPU_LIMIT_SYSTEM 6 39 #define F500_FP_CPU_LIMIT_SYSTEM 10 40 #define F1000_FP_CPU_LIMIT_SYSTEM 15 41 #define F2000_FP_CPU_LIMIT_SYSTEM 20 42 #define F4000_FP_CPU_LIMIT_SYSTEM 35 43 #define F8000_FP_CPU_LIMIT_SYSTEM 50 44 #define F100_DWARF_CPU_LIMIT_SYSTEM 30 45 #define F500_DWARF_CPU_LIMIT_SYSTEM 60 46 #define F1000_DWARF_CPU_LIMIT_SYSTEM 70 47 #define F2000_DWARF_CPU_LIMIT_SYSTEM 80 48 #define F4000_DWARF_CPU_LIMIT_SYSTEM 90 49 #define F8000_DWARF_CPU_LIMIT_SYSTEM 95 50 51 #define F100_FP_CPU_LIMIT_PROCESS 4 52 #define F500_FP_CPU_LIMIT_PROCESS 5 53 #define F1000_FP_CPU_LIMIT_PROCESS 6 54 #define F2000_FP_CPU_LIMIT_PROCESS 7 55 #define F4000_FP_CPU_LIMIT_PROCESS 10 56 #define F8000_FP_CPU_LIMIT_PROCESS 20 57 #define F100_DWARF_CPU_LIMIT_PROCESS 15 58 #define F500_DWARF_CPU_LIMIT_PROCESS 30 59 #define F1000_DWARF_CPU_LIMIT_PROCESS 60 60 #define F2000_DWARF_CPU_LIMIT_PROCESS 70 61 #define F4000_DWARF_CPU_LIMIT_PROCESS 80 62 #define F8000_DWARF_CPU_LIMIT_PROCESS 90 63 64 #endif // HIPERF_CPU_USAGE_TEST_H