• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 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_TEST
16 #define HIPERF_SYMBOLS_TEST
17 
18 #include <string>
19 
20 #include "debug_logger.h"
21 #include "symbols.h"
22 #include "utilities.h"
23 
24 namespace OHOS {
25 namespace Developtools {
26 namespace NativeDaemon {
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_FILE_ELF = "elf32_test";
37 static const std::string TEST_FILE_ELF_STRIPPED = "elf32_test_stripped";
38 static const std::string TEST_FILE_ELF_STRIPPED_NOBUILDID = "elf32_test_stripped_nobuildid";
39 static const std::string TEST_FILE_ELF_STRIPPED_BROKEN = "elf32_test_stripped_broken";
40 static const std::string TEST_FILE_ELF_STRIPPED_NOEFHDR = "elf32_test_stripped_noehframehdr";
41 #else
42 static const std::string TEST_FILE_ELF = "elf_test";
43 static const std::string TEST_FILE_ELF_STRIPPED = "elf_test_stripped";
44 static const std::string TEST_FILE_ELF_STRIPPED_NOBUILDID = "elf_test_stripped_nobuildid";
45 static const std::string TEST_FILE_ELF_STRIPPED_BROKEN = "elf_test_stripped_broken";
46 static const std::string TEST_FILE_ELF_STRIPPED_NOEFHDR = "elf_test_stripped_noehframehdr";
47 #endif
48 
49 // vmlinux
50 static const std::string TEST_FILE_VMLINUX = "vmlinux";
51 static const std::string TEST_FILE_VMLINUX_STRIPPED = "vmlinux_stripped";
52 static const std::string TEST_FILE_VMLINUX_STRIPPED_NOBUILDID = "vmlinux_stripped_nobuildid";
53 static const std::string TEST_FILE_VMLINUX_STRIPPED_BROKEN = "vmlinux_stripped_broken";
54 
55 static const std::string KPTR_RESTRICT = "/proc/sys/kernel/kptr_restrict";
56 
57 static const std::string TEST_FILE_SELF_ELF = "../../hiperf_test";
58 static const std::string TEST_FILE_ELF_FULL_PATH = PATH_RESOURCE_TEST_DATA + TEST_FILE_ELF;
59 } // namespace NativeDaemon
60 } // namespace Developtools
61 } // namespace OHOS
62 #endif