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

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

Issue 109933006: Implement sampling profiler (chromium side change) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: first CL Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | base/debug/trace_event_impl.h » ('j') | base/debug/trace_event_impl.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This header file defines the set of trace_event macros without specifying 5 // This header file defines the set of trace_event macros without specifying
6 // how the events actually get collected and stored. If you need to expose trace 6 // how the events actually get collected and stored. If you need to expose trace
7 // events to some other universe, you can copy-and-paste this file as well as 7 // events to some other universe, you can copy-and-paste this file as well as
8 // trace_event.h, modifying the macros contained there as necessary for the 8 // trace_event.h, modifying the macros contained there as necessary for the
9 // target platform. The end result is that multiple libraries can funnel events 9 // target platform. The end result is that multiple libraries can funnel events
10 // through to a shared trace event collector. 10 // through to a shared trace event collector.
(...skipping 939 matching lines...) Expand 10 before | Expand all | Expand 10 after
950 #define TRACE_EVENT_PHASE_SAMPLE ('P') 950 #define TRACE_EVENT_PHASE_SAMPLE ('P')
951 #define TRACE_EVENT_PHASE_CREATE_OBJECT ('N') 951 #define TRACE_EVENT_PHASE_CREATE_OBJECT ('N')
952 #define TRACE_EVENT_PHASE_SNAPSHOT_OBJECT ('O') 952 #define TRACE_EVENT_PHASE_SNAPSHOT_OBJECT ('O')
953 #define TRACE_EVENT_PHASE_DELETE_OBJECT ('D') 953 #define TRACE_EVENT_PHASE_DELETE_OBJECT ('D')
954 954
955 // Flags for changing the behavior of TRACE_EVENT_API_ADD_TRACE_EVENT. 955 // Flags for changing the behavior of TRACE_EVENT_API_ADD_TRACE_EVENT.
956 #define TRACE_EVENT_FLAG_NONE (static_cast<unsigned char>(0)) 956 #define TRACE_EVENT_FLAG_NONE (static_cast<unsigned char>(0))
957 #define TRACE_EVENT_FLAG_COPY (static_cast<unsigned char>(1 << 0)) 957 #define TRACE_EVENT_FLAG_COPY (static_cast<unsigned char>(1 << 0))
958 #define TRACE_EVENT_FLAG_HAS_ID (static_cast<unsigned char>(1 << 1)) 958 #define TRACE_EVENT_FLAG_HAS_ID (static_cast<unsigned char>(1 << 1))
959 #define TRACE_EVENT_FLAG_MANGLE_ID (static_cast<unsigned char>(1 << 2)) 959 #define TRACE_EVENT_FLAG_MANGLE_ID (static_cast<unsigned char>(1 << 2))
960 #define TRACE_EVENT_FLAG_SCOPE_OFFSET (static_cast<unsigned char>(1 << 3)) 960 #define TRACE_EVENT_FLAG_SAMPLING (static_cast<unsigned char>(1 << 3))
nduca 2013/12/12 07:02:41 we might have to update Blink's TraceEvent.h too?
961 #define TRACE_EVENT_FLAG_SCOPE_OFFSET (static_cast<unsigned char>(1 << 4))
961 962
962 #define TRACE_EVENT_FLAG_SCOPE_MASK (static_cast<unsigned char>( \ 963 #define TRACE_EVENT_FLAG_SCOPE_MASK (static_cast<unsigned char>( \
963 TRACE_EVENT_FLAG_SCOPE_OFFSET | (TRACE_EVENT_FLAG_SCOPE_OFFSET << 1))) 964 TRACE_EVENT_FLAG_SCOPE_OFFSET | (TRACE_EVENT_FLAG_SCOPE_OFFSET << 1)))
964 965
965 // Type values for identifying types in the TraceValue union. 966 // Type values for identifying types in the TraceValue union.
966 #define TRACE_VALUE_TYPE_BOOL (static_cast<unsigned char>(1)) 967 #define TRACE_VALUE_TYPE_BOOL (static_cast<unsigned char>(1))
967 #define TRACE_VALUE_TYPE_UINT (static_cast<unsigned char>(2)) 968 #define TRACE_VALUE_TYPE_UINT (static_cast<unsigned char>(2))
968 #define TRACE_VALUE_TYPE_INT (static_cast<unsigned char>(3)) 969 #define TRACE_VALUE_TYPE_INT (static_cast<unsigned char>(3))
969 #define TRACE_VALUE_TYPE_DOUBLE (static_cast<unsigned char>(4)) 970 #define TRACE_VALUE_TYPE_DOUBLE (static_cast<unsigned char>(4))
970 #define TRACE_VALUE_TYPE_POINTER (static_cast<unsigned char>(5)) 971 #define TRACE_VALUE_TYPE_POINTER (static_cast<unsigned char>(5))
971 #define TRACE_VALUE_TYPE_STRING (static_cast<unsigned char>(6)) 972 #define TRACE_VALUE_TYPE_STRING (static_cast<unsigned char>(6))
972 #define TRACE_VALUE_TYPE_COPY_STRING (static_cast<unsigned char>(7)) 973 #define TRACE_VALUE_TYPE_COPY_STRING (static_cast<unsigned char>(7))
973 #define TRACE_VALUE_TYPE_CONVERTABLE (static_cast<unsigned char>(8)) 974 #define TRACE_VALUE_TYPE_CONVERTABLE (static_cast<unsigned char>(8))
974 975
975 // Enum reflecting the scope of an INSTANT event. Must fit within 976 // Enum reflecting the scope of an INSTANT event. Must fit within
976 // TRACE_EVENT_FLAG_SCOPE_MASK. 977 // TRACE_EVENT_FLAG_SCOPE_MASK.
977 #define TRACE_EVENT_SCOPE_GLOBAL (static_cast<unsigned char>(0 << 3)) 978 #define TRACE_EVENT_SCOPE_GLOBAL (static_cast<unsigned char>(0 << 4))
978 #define TRACE_EVENT_SCOPE_PROCESS (static_cast<unsigned char>(1 << 3)) 979 #define TRACE_EVENT_SCOPE_PROCESS (static_cast<unsigned char>(1 << 4))
979 #define TRACE_EVENT_SCOPE_THREAD (static_cast<unsigned char>(2 << 3)) 980 #define TRACE_EVENT_SCOPE_THREAD (static_cast<unsigned char>(2 << 4))
980 981
981 #define TRACE_EVENT_SCOPE_NAME_GLOBAL ('g') 982 #define TRACE_EVENT_SCOPE_NAME_GLOBAL ('g')
982 #define TRACE_EVENT_SCOPE_NAME_PROCESS ('p') 983 #define TRACE_EVENT_SCOPE_NAME_PROCESS ('p')
983 #define TRACE_EVENT_SCOPE_NAME_THREAD ('t') 984 #define TRACE_EVENT_SCOPE_NAME_THREAD ('t')
984 985
985 namespace trace_event_internal { 986 namespace trace_event_internal {
986 987
987 // Specify these values when the corresponding argument of AddTraceEvent is not 988 // Specify these values when the corresponding argument of AddTraceEvent is not
988 // used. 989 // used.
989 const int kZeroNumArgs = 0; 990 const int kZeroNumArgs = 0;
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
1488 const char* name_; 1489 const char* name_;
1489 IDType id_; 1490 IDType id_;
1490 1491
1491 DISALLOW_COPY_AND_ASSIGN(TraceScopedTrackableObject); 1492 DISALLOW_COPY_AND_ASSIGN(TraceScopedTrackableObject);
1492 }; 1493 };
1493 1494
1494 } // namespace debug 1495 } // namespace debug
1495 } // namespace base 1496 } // namespace base
1496 1497
1497 #endif /* BASE_DEBUG_TRACE_EVENT_H_ */ 1498 #endif /* BASE_DEBUG_TRACE_EVENT_H_ */
OLDNEW
« no previous file with comments | « no previous file | base/debug/trace_event_impl.h » ('j') | base/debug/trace_event_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698