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

Unified Diff: base/debug/trace_event_unittest.cc

Issue 15418002: Record Chrome trace events in tcmalloc heap profiles (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: json output, but no green dots on trace Created 7 years, 7 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/debug/trace_event_unittest.cc
diff --git a/base/debug/trace_event_unittest.cc b/base/debug/trace_event_unittest.cc
index a6dcef2af38eed94ab7888f7b79687435257e0ae..78e48aadac1880dc164605bc4647ea766195e612 100644
--- a/base/debug/trace_event_unittest.cc
+++ b/base/debug/trace_event_unittest.cc
@@ -23,6 +23,10 @@
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
+#if !defined(NO_TCMALLOC) && !defined(OS_NACL) && defined(OS_LINUX)
+#include "third_party/tcmalloc/chromium/src/gperftools/heap-profiler.h"
+#endif
+
using base::debug::HighResSleepForTraceTest;
namespace base {
@@ -1998,5 +2002,23 @@ TEST_F(TraceEventTestFixture, CategoryFilter) {
"good_category"));
}
+
+//TODO - move me
+TEST_F(TraceEventTestFixture, TraceMemory) {
+ ManualTestSetUp();
+ TraceMemoryStart();
+
+ scoped_ptr<char[]> not_in_trace(new char[10000]);
+
+ TRACE_EVENT0("category_foo", "trace_foo");
+ scoped_ptr<char[]> foo(new char[20000]);
+
+ TRACE_EVENT0("category_bar", "trace_bar");
+ scoped_ptr<char[]> bar(new char[30000]);
+
+ TraceMemoryDump();
+ TraceMemoryStop();
+}
+
} // namespace debug
} // namespace base

Powered by Google App Engine
This is Rietveld 408576698