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

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: Tagged category support cleanup, parameter renaming, documentation updated. 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 58bd02370bff9bbefb4f02c1aa5c4535d33112b4..9c6e71da3d4fc858094d8dbe19b025276dabb1dc 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:
+//
+// TRACE_EVENT_INSTANT0("MY_SUBSYSTEM_1, MY_SUB_SYSTEM_2", "ImportantEvent")
+//
+// 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",
// "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