Commit 98447da8 authored by Charlie Andrews's avatar Charlie Andrews Committed by Commit Bot

Create stub for NativeUnwinderAndroid

This class will contain the Android-specific unwinding implementation,
which will rely on libunwindstack. libunwindstack will be pulled in as a
dynamic feature module (DFM).

Having a stub version of this class will allow us to create
StackSamplerAndroid. (StackSamplerAndroid will need to create a
StackSamplerImpl, which accepts an Unwinder as a constructor parameter.)

TBR=gab@chromium.org
R=wittman@chromium.org

Bug: 988574
Change-Id: Id929731e94232f457add7914eb426ebcdb0bf0f0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1726829Reviewed-by: default avatarCharlie Andrews <charliea@chromium.org>
Reviewed-by: default avatarGabriel Charette <gab@chromium.org>
Reviewed-by: default avatarMike Wittman <wittman@chromium.org>
Commit-Queue: Charlie Andrews <charliea@chromium.org>
Cr-Commit-Position: refs/heads/master@{#682404}
parent f4402540
......@@ -613,6 +613,8 @@ jumbo_component("base") {
"profiler/metadata_recorder.cc",
"profiler/metadata_recorder.h",
"profiler/native_unwinder.h",
"profiler/native_unwinder_android.cc",
"profiler/native_unwinder_android.h",
"profiler/native_unwinder_mac.cc",
"profiler/native_unwinder_mac.h",
"profiler/native_unwinder_win.cc",
......
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/profiler/native_unwinder_android.h"
#include "base/profiler/native_unwinder.h"
#include "base/profiler/profile_builder.h"
#include "base/sampling_heap_profiler/module_cache.h"
namespace base {
bool NativeUnwinderAndroid::CanUnwindFrom(const Frame* current_frame) const {
return false;
}
UnwindResult NativeUnwinderAndroid::TryUnwind(RegisterContext* thread_context,
uintptr_t stack_top,
ModuleCache* module_cache,
std::vector<Frame>* stack) const {
return UnwindResult::ABORTED;
}
std::unique_ptr<Unwinder> CreateNativeUnwinder(ModuleCache* module_cache) {
return std::make_unique<NativeUnwinderAndroid>();
}
} // namespace base
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef BASE_PROFILER_NATIVE_UNWINDER_ANDROID_H_
#define BASE_PROFILER_NATIVE_UNWINDER_ANDROID_H_
#include "base/profiler/unwinder.h"
namespace base {
// Native unwinder implementation for Android, using libunwindstack.
//
// TODO(charliea): Implement this class.
// See: https://crbug.com/989102
class NativeUnwinderAndroid : public Unwinder {
public:
NativeUnwinderAndroid() = default;
NativeUnwinderAndroid(const NativeUnwinderAndroid&) = delete;
NativeUnwinderAndroid& operator=(const NativeUnwinderAndroid&) = delete;
// Unwinder
bool CanUnwindFrom(const Frame* current_frame) const override;
UnwindResult TryUnwind(RegisterContext* thread_context,
uintptr_t stack_top,
ModuleCache* module_cache,
std::vector<Frame>* stack) const override;
};
} // namespace base
#endif // BASE_PROFILER_NATIVE_UNWINDER_ANDROID_H_
......@@ -14,6 +14,7 @@ namespace base {
// Android.
//
// TODO(charliea): Implement this class.
// See: https://crbug.com/988574
class BASE_EXPORT ThreadDelegateAndroid : public ThreadDelegate {
public:
class ScopedSuspendThread : public ThreadDelegate::ScopedSuspendThread {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment