Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3521)

Unified Diff: base/trace_event/heap_profiler_allocation_context.h

Issue 1839503002: [tracing] Add native allocation tracing mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: base/trace_event/heap_profiler_allocation_context.h
diff --git a/base/trace_event/heap_profiler_allocation_context.h b/base/trace_event/heap_profiler_allocation_context.h
index 70ec7596661c8b2100e6d8083dbaddab36c0a4a7..04ed180cd181cef1a42d44f73408ebe230e1e800 100644
--- a/base/trace_event/heap_profiler_allocation_context.h
+++ b/base/trace_event/heap_profiler_allocation_context.h
@@ -44,6 +44,7 @@ struct BASE_EXPORT StackFrame {
enum class Type {
TRACE_EVENT_NAME, // const char* string
THREAD_NAME, // const char* thread name
+ PROGRAM_COUNTER, // as returned by stack tracing (e.g. by StackTrace)
};
static StackFrame FromTraceEventName(const char* name) {
@@ -52,6 +53,9 @@ struct BASE_EXPORT StackFrame {
static StackFrame FromThreadName(const char* name) {
return {Type::THREAD_NAME, name};
}
+ static StackFrame FromProgramCounter(const void* pc) {
+ return {Type::PROGRAM_COUNTER, pc};
+ }
Type type;
const void* value;

Powered by Google App Engine
This is Rietveld 408576698