Add TRACE_EVENT macros to net.
This CL adds TRACE_EVENT macros to some of the interesting functions in
net which are useful to track memory usage.
These are points suggested by statistics from local experiments and
improvised by mmenke@.
The CL also changes the categories of some existing trace events and
cleans up some. Some events are marked under DISABLED_BY_DEFAULT
category since there are too many calls and should not crowd default
tracing with lot of points. This is chosen based on an average value
of trace events in other categories.
BUG=598377
Review URL: https://codereview.chromium.org/1834273002
Cr-Commit-Position: refs/heads/master@{#385246}
diff --git a/net/dns/host_resolver_impl.cc b/net/dns/host_resolver_impl.cc
index c19d0ac..1a6bd61 100644
--- a/net/dns/host_resolver_impl.cc
+++ b/net/dns/host_resolver_impl.cc
@@ -35,6 +35,7 @@
#include "base/thread_task_runner_handle.h"
#include "base/threading/worker_pool.h"
#include "base/time/time.h"
+#include "base/trace_event/trace_event.h"
#include "base/values.h"
#include "net/base/address_family.h"
#include "net/base/address_list.h"
@@ -768,6 +769,7 @@
const uint32_t attempt_number,
int error,
const int os_error) {
+ TRACE_EVENT0("net", "ProcTask::OnLookupComplete");
DCHECK(task_runner_->BelongsToCurrentThread());
// If results are empty, we should return an error.
bool empty_list_on_ok = (error == OK && results.empty());