• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 <cstdio>
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 <gtest/gtest.h>
30 #include <sstream>
31 #include "subcommand_record.h"
32 #include "subcommand_stat.h"
33 #include "subcommand_report.h"
34 
35 #define PROCESS_ITEM 14
36 #define HUNDRED 100
37 #define F100_FP_CPU_LIMIT_SYSTEM 6
38 #define F500_FP_CPU_LIMIT_SYSTEM 10
39 #define F1000_FP_CPU_LIMIT_SYSTEM 15
40 #define F2000_FP_CPU_LIMIT_SYSTEM 20
41 #define F4000_FP_CPU_LIMIT_SYSTEM 35
42 #define F8000_FP_CPU_LIMIT_SYSTEM 50
43 #define F100_DWARF_CPU_LIMIT_SYSTEM 30
44 #define F500_DWARF_CPU_LIMIT_SYSTEM 60
45 #define F1000_DWARF_CPU_LIMIT_SYSTEM 70
46 #define F2000_DWARF_CPU_LIMIT_SYSTEM 80
47 #define F4000_DWARF_CPU_LIMIT_SYSTEM 90
48 #define F8000_DWARF_CPU_LIMIT_SYSTEM 95
49 
50 #define F100_FP_CPU_LIMIT_PROCESS 4
51 #define F500_FP_CPU_LIMIT_PROCESS 5
52 #define F1000_FP_CPU_LIMIT_PROCESS 6
53 #define F2000_FP_CPU_LIMIT_PROCESS 7
54 #define F4000_FP_CPU_LIMIT_PROCESS 10
55 #define F8000_FP_CPU_LIMIT_PROCESS 20
56 #define F100_DWARF_CPU_LIMIT_PROCESS 15
57 #define F500_DWARF_CPU_LIMIT_PROCESS 30
58 #define F1000_DWARF_CPU_LIMIT_PROCESS 60
59 #define F2000_DWARF_CPU_LIMIT_PROCESS 70
60 #define F4000_DWARF_CPU_LIMIT_PROCESS 80
61 #define F8000_DWARF_CPU_LIMIT_PROCESS 90
62 
63 #endif // HIPERF_CPU_USAGE_TEST_H