• 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 #ifndef HIPERF_SYMBOLS_FILE_TEST
16 #define HIPERF_SYMBOLS_FILE_TEST
17 
18 #include <string>
19 
20 #include "debug_logger.h"
21 #include "symbols_file.h"
22 #include "utilities.h"
23 
24 namespace OHOS {
25 namespace Developtools {
26 namespace HiPerf {
27 static const std::string PATH_KALLSYMS = "/proc/kallsyms";
28 static const std::string PATH_NOT_EXISTS = "data/";
29 static const std::string PATH_DATA_TEMP = "/.";
30 static const std::string PATH_DATA_TEMP_WINDOS = "\\.";
31 static const std::string PATH_ILLEGAL = "!@#$%^&*()";
32 static const std::string PATH_RESOURCE_TEST_DATA = "resource/testdata/";
33 static const std::string PATH_RESOURCE_TEST_DATA_NO_ENDPATH = "resource/testdata";
34 // elf
35 #ifdef __arm__
36 static const std::string TEST_SYMBOLS_FILE_ELF {"symbols_file_test_elf32"};
37 static const std::string TEST_FILE_ELF = "elf32_test";
38 static const std::string TEST_FILE_ELF_STRIPPED = "elf32_test_stripped";
39 static const std::string TEST_FILE_ELF_STRIPPED_NOBUILDID = "elf32_test_stripped_nobuildid";
40 static const std::string TEST_FILE_ELF_STRIPPED_BROKEN = "elf32_test_stripped_broken";
41 static const std::string TEST_FILE_ELF_STRIPPED_NOEFHDR = "elf32_test_stripped_noehframehdr";
42 #else
43 static const std::string TEST_SYMBOLS_FILE_ELF {"symbols_file_test_elf64"};
44 static const std::string TEST_FILE_ELF = "elf_test";
45 static const std::string TEST_FILE_ELF_STRIPPED = "elf_test_stripped";
46 static const std::string TEST_FILE_ELF_STRIPPED_NOBUILDID = "elf_test_stripped_nobuildid";
47 static const std::string TEST_FILE_ELF_STRIPPED_BROKEN = "elf_test_stripped_broken";
48 static const std::string TEST_FILE_ELF_STRIPPED_NOEFHDR = "elf_test_stripped_noehframehdr";
49 #endif
50 
51 // vmlinux
52 static const std::string TEST_FILE_VMLINUX = "vmlinux";
53 static const std::string TEST_FILE_VMLINUX_STRIPPED = "vmlinux_stripped";
54 static const std::string TEST_FILE_VMLINUX_STRIPPED_NOBUILDID = "vmlinux_stripped_nobuildid";
55 static const std::string TEST_FILE_VMLINUX_STRIPPED_BROKEN = "vmlinux_stripped_broken";
56 
57 static const std::string KPTR_RESTRICT = "/proc/sys/kernel/kptr_restrict";
58 
59 static const std::string TEST_FILE_SELF_ELF = "../../hiperf_test";
60 static const std::string TEST_FILE_ELF_FULL_PATH = PATH_RESOURCE_TEST_DATA + TEST_FILE_ELF;
61 } // namespace HiPerf
62 } // namespace Developtools
63 } // namespace OHOS
64 #endif // HIPERF_SYMBOLS_FILE_TEST
65