summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorwittman <wittman@chromium.org>2015-03-23 20:25:47 -0700
committerCommit bot <commit-bot@chromium.org>2015-03-24 03:26:56 +0000
commitd19f5200062542283ffc6ab281ea961e481b5846 (patch)
treee81185d04ec4aebb634c7875e05cefa7e1df1092 /base
parent45816be817451773244bf491806806be2cbab1cf (diff)
downloadchromium_src-d19f5200062542283ffc6ab281ea961e481b5846.zip
chromium_src-d19f5200062542283ffc6ab281ea961e481b5846.tar.gz
chromium_src-d19f5200062542283ffc6ab281ea961e481b5846.tar.bz2
Metrics provider for statistical stack profiler
Provides a metrics provider that uploads statistical stack profiling state via UMA. This CL builds on top of the statistical profiler implementation in https://crrev.com/1016563004, which is under review. BUG=464929 Review URL: https://codereview.chromium.org/981143006 Cr-Commit-Position: refs/heads/master@{#321928}
Diffstat (limited to 'base')
-rw-r--r--base/profiler/stack_sampling_profiler.cc9
-rw-r--r--base/profiler/stack_sampling_profiler.h3
2 files changed, 12 insertions, 0 deletions
diff --git a/base/profiler/stack_sampling_profiler.cc b/base/profiler/stack_sampling_profiler.cc
index 57b7b35..f760507 100644
--- a/base/profiler/stack_sampling_profiler.cc
+++ b/base/profiler/stack_sampling_profiler.cc
@@ -65,6 +65,10 @@ void PendingProfiles::GetProfiles(
} // namespace
StackSamplingProfiler::Module::Module() : base_address(nullptr) {}
+StackSamplingProfiler::Module::Module(const void* base_address,
+ const std::string& id,
+ const FilePath& filename)
+ : base_address(base_address), id(id), filename(filename) {}
StackSamplingProfiler::Module::~Module() {}
@@ -72,6 +76,11 @@ StackSamplingProfiler::Frame::Frame()
: instruction_pointer(nullptr),
module_index(-1) {}
+StackSamplingProfiler::Frame::Frame(const void* instruction_pointer,
+ int module_index)
+ : instruction_pointer(instruction_pointer),
+ module_index(module_index) {}
+
StackSamplingProfiler::Frame::~Frame() {}
StackSamplingProfiler::Profile::Profile() : preserve_sample_ordering(false) {}
diff --git a/base/profiler/stack_sampling_profiler.h b/base/profiler/stack_sampling_profiler.h
index 8d7671e..4438786 100644
--- a/base/profiler/stack_sampling_profiler.h
+++ b/base/profiler/stack_sampling_profiler.h
@@ -53,6 +53,8 @@ class BASE_EXPORT StackSamplingProfiler {
// Module represents the module (DLL or exe) corresponding to a stack frame.
struct BASE_EXPORT Module {
Module();
+ Module(const void* base_address, const std::string& id,
+ const FilePath& filename);
~Module();
// Points to the base address of the module.
@@ -72,6 +74,7 @@ class BASE_EXPORT StackSamplingProfiler {
// Frame represents an individual sampled stack frame with module information.
struct BASE_EXPORT Frame {
Frame();
+ Frame(const void* instruction_pointer, int module_index);
~Frame();
// The sampled instruction pointer within the function.