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

Unified Diff: base/debug/trace_event.h

Issue 11823016: Trace category groups and category filter. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Minor edits from previous changeset, mainly fixing line exceeding 80 chars. Created 7 years, 11 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
« no previous file with comments | « no previous file | base/debug/trace_event_impl.h » ('j') | base/debug/trace_event_impl.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/debug/trace_event.h
diff --git a/base/debug/trace_event.h b/base/debug/trace_event.h
index fc8897e1e73cf5e928a72552a24a604ed16ba2a5..9a1ed7488e5577c0d65b13def5412bf30d2a2e5b 100644
--- a/base/debug/trace_event.h
+++ b/base/debug/trace_event.h
@@ -19,6 +19,13 @@
// implicitly with a string. For example:
// TRACE_EVENT_INSTANT0("MY_SUBSYSTEM", "SomeImportantEvent")
//
+// A category can be made up of several tags, for example:
nduca 2013/01/28 08:15:28 The first argument to traces is a comma-separated
+//
+// TRACE_EVENT_INSTANT0("MY_SUBSYSTEM_1, MY_SUB_SYSTEM_2", "ImportantEvent")
nduca 2013/01/28 08:15:28 Lets give a concerete example here so its less abs
+//
+// We can enable/disable tracing of ImportantEvent by enabling/disabling either
+// tag.
+//
// Events can be INSTANT, or can be pairs of BEGIN and END in the same scope:
// TRACE_EVENT_BEGIN0("MY_SUBSYSTEM", "SomethingCostly")
// doSomethingCostly()
@@ -101,7 +108,7 @@
// Tracing copies the pointers, not the string content, of the strings passed
// in for category, name, and arg_names. Thus, the following code will
// cause problems:
-// char* str = strdup("impprtantName");
+// char* str = strdup("importantName");
// TRACE_EVENT_INSTANT0("SUBSYSTEM", str); // BAD!
// free(str); // Trace system now has dangling pointer
//
@@ -113,13 +120,13 @@
//
// When are string argument values copied:
// const char* arg_values are only referenced by default:
-// TRACE_EVENT1("category", "name",
+// TRACE_EVENT1("category_tag1", "name",
nduca 2013/01/28 08:15:28 i think its safe to say category once we make the
// "arg1", "literal string is only referenced");
// Use TRACE_STR_COPY to force copying of a const char*:
-// TRACE_EVENT1("category", "name",
+// TRACE_EVENT1("category_tag1", "name",
// "arg1", TRACE_STR_COPY("string will be copied"));
// std::string arg_values are always copied:
-// TRACE_EVENT1("category", "name",
+// TRACE_EVENT1("category_tag1", "name",
// "arg1", std::string("string will be copied"));
//
//
« 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