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

Side by Side Diff: base/trace_event/heap_profiler_scoped_ignore.h

Issue 1900223003: [tracing] Ignore tracing allocations in heap profiler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixes. 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef BASE_TRACE_EVENT_HEAP_PROFILER_SCOPED_IGNORE_H
Primiano Tucci (use gerrit) 2016/04/21 19:47:32 if you want feel free to call this file already he
ssid 2016/04/22 04:57:12 Done.
6 #define BASE_TRACE_EVENT_HEAP_PROFILER_SCOPED_IGNORE_H
7
8 #include "base/trace_event/heap_profiler_allocation_context_tracker.h"
9 #include "base/trace_event/trace_event.h"
Primiano Tucci (use gerrit) 2016/04/21 19:47:32 you are including this only for INTERNAL_TRACE_UID
ssid 2016/04/22 04:57:12 This does not seem to work. I had to add macros si
10
11 #define HEAP_PROFILER_SCOPED_IGNORE \
12 base::trace_event::HeapProfilerScopedIgnore INTERNAL_TRACE_EVENT_UID( \
13 heap_profiler_ignore); \
14 if (UNLIKELY( \
15 base::trace_event::AllocationContextTracker::capture_enabled())) { \
Primiano Tucci (use gerrit) 2016/04/21 19:47:32 remove the curly braces and make this if (UNLIKE
ssid 2016/04/22 04:57:12 Done.
16 base::trace_event::AllocationContextTracker::GetInstanceForCurrentThread() \
17 ->begin_ignore_scope(); \
18 }
19
20 namespace base {
21 namespace trace_event {
22
23 // A scoped ignore event used to tell AllocationContextTracker to ignore all the
Primiano Tucci (use gerrit) 2016/04/21 19:47:32 s/AllocationCOntextTracker/the memory-infra heap p
ssid 2016/04/22 04:57:12 Done.
24 // allocations in the scope. It is useful to exclude allocations made for
25 // tracing from the heap profiler dumps. This class is to be used only using the
26 // macro HEAP_PROFILER_SCOPED_IGNORE.
27 class BASE_EXPORT HeapProfilerScopedIgnore {
28 public:
29 HeapProfilerScopedIgnore();
30 ~HeapProfilerScopedIgnore();
31 };
32
33 } // namespace trace_event
34 } // namespace base
35
36 #endif // BASE_TRACE_EVENT_HEAP_PROFILER_SCOPED_IGNORE_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698