blob: 823b6e5d9600416e883060109402b8067dd80847 [file] [log] [blame]
Yabin Cui3c8c2132015-08-13 20:30:20 -07001/*
2 * Copyright (C) 2015 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17// Add fake functions to build successfully on darwin.
Elliott Hughes66dd09e2015-12-04 14:00:57 -080018#include <android-base/logging.h>
Yabin Cui3c8c2132015-08-13 20:30:20 -070019
Yabin Cui03381452017-12-13 11:31:53 -080020#include "OfflineUnwinder.h"
ThiƩbaud Weksteen4848ee02020-10-23 16:06:59 +020021#include "environment.h"
22#include "read_dex_file.h"
Yabin Cui3c8c2132015-08-13 20:30:20 -070023
Yabin Cuifaa7b922021-01-11 17:35:57 -080024namespace simpleperf {
25
Yabin Cui3c8c2132015-08-13 20:30:20 -070026bool GetKernelBuildId(BuildId*) {
27 return false;
28}
Yabin Cuif8974522017-07-17 14:36:37 -070029
30bool CanRecordRawData() {
31 return false;
32}
Yabin Cui516a87c2018-03-26 17:34:00 -070033
Yabin Cui2a53ff32018-05-21 17:37:00 -070034bool ReadSymbolsFromDexFileInMemory(void*, uint64_t, const std::vector<uint64_t>&,
35 std::vector<DexFileSymbol>*) {
36 return true;
37}
38
Yabin Cui516a87c2018-03-26 17:34:00 -070039bool ReadSymbolsFromDexFile(const std::string&, const std::vector<uint64_t>&,
40 std::vector<DexFileSymbol>*) {
41 return true;
42}
Yabin Cui5ac7a252019-07-18 10:43:32 -070043
Yabin Cuia22efeb2020-01-29 13:27:33 -080044const char* GetTraceFsDir() {
45 return nullptr;
46}
47
Yabin Cui17cffbb2020-07-28 17:11:39 -070048class NoOpOfflineUnwinder : public OfflineUnwinder {
Yabin Cui5ac7a252019-07-18 10:43:32 -070049 public:
50 bool UnwindCallChain(const ThreadEntry&, const RegSet&, const char*, size_t,
51 std::vector<uint64_t>*, std::vector<uint64_t>*) override {
52 return false;
53 }
54};
55
56std::unique_ptr<OfflineUnwinder> OfflineUnwinder::Create(bool) {
Yabin Cui17cffbb2020-07-28 17:11:39 -070057 return std::unique_ptr<OfflineUnwinder>(new NoOpOfflineUnwinder);
Yabin Cui5ac7a252019-07-18 10:43:32 -070058}
59
60} // namespace simpleperf