Revert of Revert some other possible suspects of a 0.43% size increase of setup.exe: https://build.chromium.o… (patchset #1 id:1 of https://codereview.chromium.org/1124563003/)
Reason for revert:
Broke the compile because one of these CLs is already depended on (rch@'s bce10d97d6fc5233071427cf622aaad7abde9e19).
Original issue's description:
> Revert some other possible suspects of a 0.43% size increase of setup.exe: https://build.chromium.org/p/chromium/builders/Win/builds/31562
>
> Revert "Add granular base::File tracing."
>
> This reverts commit a6e05c977096a03774e5406d63ad80c0166f9adc.
>
> Revert "Add AllReadDataConsumed and AllWriteDataConsumed methods to SocketDataProvider"
>
> This reverts commit bce10d97d6fc5233071427cf622aaad7abde9e19.
>
> Revert "Avoid unnecessary memory allocations at PlatformThread::SetName()"
>
> This reverts commit 4839a142bf95776323647c82ca9dc0725f7c4f15.
>
> TBR=tdresser@chromium.org
> BUG=none
> TEST=green sizes
>
> Committed: https://chromium.googlesource.com/chromium/src/+/c41830d6f55f85e2f5c8841db4b6ed81239b671d
TBR=tdresser@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=none
Review URL: https://codereview.chromium.org/1123833003
Cr-Commit-Position: refs/heads/master@{#328207}
CrOS-Libchrome-Original-Commit: eb1e4d1dd2511083e1d5506d1edfbdff68e133cc
diff --git a/base/base.gypi b/base/base.gypi
index 4a8cd17..b84c405 100644
--- a/base/base.gypi
+++ b/base/base.gypi
@@ -209,6 +209,8 @@
'files/file_posix.cc',
'files/file_proxy.cc',
'files/file_proxy.h',
+ 'files/file_tracing.cc',
+ 'files/file_tracing.h',
'files/file_util.cc',
'files/file_util.h',
'files/file_util_android.cc',
diff --git a/base/files/file.cc b/base/files/file.cc
index 8030bf1..774539f 100644
--- a/base/files/file.cc
+++ b/base/files/file.cc
@@ -4,6 +4,7 @@
#include "base/files/file.h"
#include "base/files/file_path.h"
+#include "base/files/file_tracing.h"
#include "base/metrics/histogram.h"
#include "base/timer/elapsed_timer.h"
@@ -25,11 +26,11 @@
}
#if !defined(OS_NACL)
-File::File(const FilePath& name, uint32 flags)
+File::File(const FilePath& path, uint32 flags)
: error_details_(FILE_OK),
created_(false),
async_(false) {
- Initialize(name, flags);
+ Initialize(path, flags);
}
#endif
@@ -51,6 +52,7 @@
File::File(RValue other)
: file_(other.object->TakePlatformFile()),
+ path_(other.object->path_),
error_details_(other.object->error_details()),
created_(other.object->created()),
async_(other.object->async_) {
@@ -65,6 +67,7 @@
if (this != other.object) {
Close();
SetPlatformFile(other.object->TakePlatformFile());
+ path_ = other.object->path_;
error_details_ = other.object->error_details();
created_ = other.object->created();
async_ = other.object->async_;
@@ -73,12 +76,14 @@
}
#if !defined(OS_NACL)
-void File::Initialize(const FilePath& name, uint32 flags) {
- if (name.ReferencesParent()) {
+void File::Initialize(const FilePath& path, uint32 flags) {
+ if (path.ReferencesParent()) {
error_details_ = FILE_ERROR_ACCESS_DENIED;
return;
}
- DoInitialize(name, flags);
+ path_ = path;
+ SCOPED_FILE_TRACE("Initialize");
+ DoInitialize(flags);
}
#endif
@@ -128,9 +133,18 @@
bool File::Flush() {
ElapsedTimer timer;
+ SCOPED_FILE_TRACE("Flush");
bool return_value = DoFlush();
UMA_HISTOGRAM_TIMES("PlatformFile.FlushTime", timer.Elapsed());
return return_value;
}
+File::TraceEnabler::TraceEnabler() {
+ FILE_TRACING_BEGIN();
+}
+
+File::TraceEnabler::~TraceEnabler() {
+ FILE_TRACING_END();
+}
+
} // namespace base
diff --git a/base/files/file.h b/base/files/file.h
index 89077b4..589403d 100644
--- a/base/files/file.h
+++ b/base/files/file.h
@@ -18,6 +18,7 @@
#include "base/base_export.h"
#include "base/basictypes.h"
+#include "base/files/file_path.h"
#include "base/files/scoped_file.h"
#include "base/gtest_prod_util.h"
#include "base/move.h"
@@ -31,8 +32,6 @@
namespace base {
-class FilePath;
-
#if defined(OS_WIN)
typedef HANDLE PlatformFile;
#elif defined(OS_POSIX)
@@ -162,8 +161,8 @@
File();
// Creates or opens the given file. This will fail with 'access denied' if the
- // |name| contains path traversal ('..') components.
- File(const FilePath& name, uint32 flags);
+ // |path| contains path traversal ('..') components.
+ File(const FilePath& path, uint32 flags);
// Takes ownership of |platform_file|.
explicit File(PlatformFile platform_file);
@@ -180,7 +179,7 @@
File& operator=(RValue other);
// Creates or opens the given file.
- void Initialize(const FilePath& name, uint32 flags);
+ void Initialize(const FilePath& path, uint32 flags);
bool IsValid() const;
@@ -191,7 +190,7 @@
// Returns the OS result of opening this file. Note that the way to verify
// the success of the operation is to use IsValid(), not this method:
- // File file(name, flags);
+ // File file(path, flags);
// if (!file.IsValid())
// return;
Error error_details() const { return error_details_; }
@@ -305,6 +304,8 @@
private:
FRIEND_TEST_ALL_PREFIXES(::FileTest, MemoryCorruption);
+ friend class ScopedFileTrace;
+
#if defined(OS_POSIX)
// Encloses a single ScopedFD, saving a cheap tamper resistent memory checksum
// alongside it. This checksum is validated at every access, allowing early
@@ -350,9 +351,9 @@
};
#endif
- // Creates or opens the given file. Only called if |name| has no traversal
- // ('..') components.
- void DoInitialize(const FilePath& name, uint32 flags);
+ // Creates or opens the given file. Only called if |path_| has no
+ // traversal ('..') components.
+ void DoInitialize(uint32 flags);
// TODO(tnagel): Reintegrate into Flush() once histogram isn't needed anymore,
// cf. issue 473337.
@@ -366,6 +367,18 @@
MemoryCheckingScopedFD file_;
#endif
+ // Path that |Initialize()| was called with. Only set if safe (i.e. no '..').
+ FilePath path_;
+
+ class TraceEnabler {
+ public:
+ TraceEnabler();
+ ~TraceEnabler();
+ };
+
+ // Object tied to the lifetime of this File that enables/disables tracing.
+ TraceEnabler trace_enabler_;
+
Error error_details_;
bool created_;
bool async_;
diff --git a/base/files/file_posix.cc b/base/files/file_posix.cc
index 4c79057..563dba1 100644
--- a/base/files/file_posix.cc
+++ b/base/files/file_posix.cc
@@ -10,6 +10,7 @@
#include <unistd.h>
#include "base/files/file_path.h"
+#include "base/files/file_tracing.h"
#include "base/logging.h"
#include "base/metrics/sparse_histogram.h"
#include "base/posix/eintr_wrapper.h"
@@ -173,6 +174,7 @@
if (!IsValid())
return;
+ SCOPED_FILE_TRACE("Close");
ThreadRestrictions::AssertIOAllowed();
file_.reset();
}
@@ -181,6 +183,8 @@
ThreadRestrictions::AssertIOAllowed();
DCHECK(IsValid());
+ SCOPED_FILE_TRACE_WITH_SIZE("Seek", offset);
+
#if defined(OS_ANDROID)
COMPILE_ASSERT(sizeof(int64) == sizeof(off64_t), off64_t_64_bit);
return lseek64(file_.get(), static_cast<off64_t>(offset),
@@ -198,6 +202,8 @@
if (size < 0)
return -1;
+ SCOPED_FILE_TRACE_WITH_SIZE("Read", size);
+
int bytes_read = 0;
int rv;
do {
@@ -218,6 +224,8 @@
if (size < 0)
return -1;
+ SCOPED_FILE_TRACE_WITH_SIZE("ReadAtCurrentPos", size);
+
int bytes_read = 0;
int rv;
do {
@@ -234,7 +242,7 @@
int File::ReadNoBestEffort(int64 offset, char* data, int size) {
ThreadRestrictions::AssertIOAllowed();
DCHECK(IsValid());
-
+ SCOPED_FILE_TRACE_WITH_SIZE("ReadNoBestEffort", size);
return HANDLE_EINTR(pread(file_.get(), data, size, offset));
}
@@ -244,6 +252,7 @@
if (size < 0)
return -1;
+ SCOPED_FILE_TRACE_WITH_SIZE("ReadAtCurrentPosNoBestEffort", size);
return HANDLE_EINTR(read(file_.get(), data, size));
}
@@ -257,6 +266,8 @@
if (size < 0)
return -1;
+ SCOPED_FILE_TRACE_WITH_SIZE("Write", size);
+
int bytes_written = 0;
int rv;
do {
@@ -277,6 +288,8 @@
if (size < 0)
return -1;
+ SCOPED_FILE_TRACE_WITH_SIZE("WriteAtCurrentPos", size);
+
int bytes_written = 0;
int rv;
do {
@@ -297,12 +310,15 @@
if (size < 0)
return -1;
+ SCOPED_FILE_TRACE_WITH_SIZE("WriteAtCurrentPosNoBestEffort", size);
return HANDLE_EINTR(write(file_.get(), data, size));
}
int64 File::GetLength() {
DCHECK(IsValid());
+ SCOPED_FILE_TRACE("GetLength");
+
stat_wrapper_t file_info;
if (CallFstat(file_.get(), &file_info))
return false;
@@ -313,6 +329,8 @@
bool File::SetLength(int64 length) {
ThreadRestrictions::AssertIOAllowed();
DCHECK(IsValid());
+
+ SCOPED_FILE_TRACE_WITH_SIZE("SetLength", length);
return !CallFtruncate(file_.get(), length);
}
@@ -320,6 +338,8 @@
ThreadRestrictions::AssertIOAllowed();
DCHECK(IsValid());
+ SCOPED_FILE_TRACE("SetTimes");
+
timeval times[2];
times[0] = last_access_time.ToTimeVal();
times[1] = last_modified_time.ToTimeVal();
@@ -330,6 +350,8 @@
bool File::GetInfo(Info* info) {
DCHECK(IsValid());
+ SCOPED_FILE_TRACE("GetInfo");
+
stat_wrapper_t file_info;
if (CallFstat(file_.get(), &file_info))
return false;
@@ -339,10 +361,12 @@
}
File::Error File::Lock() {
+ SCOPED_FILE_TRACE("Lock");
return CallFctnlFlock(file_.get(), true);
}
File::Error File::Unlock() {
+ SCOPED_FILE_TRACE("Unlock");
return CallFctnlFlock(file_.get(), false);
}
@@ -350,6 +374,8 @@
if (!IsValid())
return File();
+ SCOPED_FILE_TRACE("Duplicate");
+
PlatformFile other_fd = dup(GetPlatformFile());
if (other_fd == -1)
return File(OSErrorToFileError(errno));
@@ -442,7 +468,7 @@
// NaCl doesn't implement system calls to open files directly.
#if !defined(OS_NACL)
// TODO(erikkay): does it make sense to support FLAG_EXCLUSIVE_* here?
-void File::DoInitialize(const FilePath& name, uint32 flags) {
+void File::DoInitialize(uint32 flags) {
ThreadRestrictions::AssertIOAllowed();
DCHECK(!IsValid());
@@ -497,7 +523,7 @@
mode |= S_IRGRP | S_IROTH;
#endif
- int descriptor = HANDLE_EINTR(open(name.value().c_str(), open_flags, mode));
+ int descriptor = HANDLE_EINTR(open(path_.value().c_str(), open_flags, mode));
if (flags & FLAG_OPEN_ALWAYS) {
if (descriptor < 0) {
@@ -505,7 +531,7 @@
if (flags & FLAG_EXCLUSIVE_READ || flags & FLAG_EXCLUSIVE_WRITE)
open_flags |= O_EXCL; // together with O_CREAT implies O_NOFOLLOW
- descriptor = HANDLE_EINTR(open(name.value().c_str(), open_flags, mode));
+ descriptor = HANDLE_EINTR(open(path_.value().c_str(), open_flags, mode));
if (descriptor >= 0)
created_ = true;
}
@@ -520,7 +546,7 @@
created_ = true;
if (flags & FLAG_DELETE_ON_CLOSE)
- unlink(name.value().c_str());
+ unlink(path_.value().c_str());
async_ = ((flags & FLAG_ASYNC) == FLAG_ASYNC);
error_details_ = FILE_OK;
@@ -531,6 +557,7 @@
bool File::DoFlush() {
ThreadRestrictions::AssertIOAllowed();
DCHECK(IsValid());
+
#if defined(OS_NACL)
NOTIMPLEMENTED(); // NaCl doesn't implement fsync.
return true;
diff --git a/base/files/file_tracing.cc b/base/files/file_tracing.cc
new file mode 100644
index 0000000..3326e2d
--- /dev/null
+++ b/base/files/file_tracing.cc
@@ -0,0 +1,47 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/files/file_tracing.h"
+
+#include "base/files/file.h"
+#include "base/files/file_path.h"
+
+namespace base {
+
+const char kFileTracingEventCategoryGroup[] = TRACE_DISABLED_BY_DEFAULT("file");
+
+ScopedFileTrace::ScopedFileTrace() : initialized_(false) {}
+
+ScopedFileTrace::~ScopedFileTrace() {
+ if (initialized_) {
+ if (size_) {
+ TRACE_EVENT_NESTABLE_ASYNC_END2(
+ kFileTracingEventCategoryGroup, name_, &file_->trace_enabler_,
+ "path", file_->path_.AsUTF8Unsafe(), "size", size_);
+ } else {
+ TRACE_EVENT_NESTABLE_ASYNC_END1(
+ kFileTracingEventCategoryGroup, name_, &file_->trace_enabler_,
+ "path", file_->path_.AsUTF8Unsafe());
+ }
+ }
+}
+
+void ScopedFileTrace::Initialize(const char* name, File* file, int64 size) {
+ file_ = file;
+ name_ = name;
+ size_ = size;
+ initialized_ = true;
+
+ if (size_) {
+ TRACE_EVENT_NESTABLE_ASYNC_BEGIN2(
+ kFileTracingEventCategoryGroup, name_, &file_->trace_enabler_,
+ "path", file_->path_.AsUTF8Unsafe(), "size", size_);
+ } else {
+ TRACE_EVENT_NESTABLE_ASYNC_BEGIN1(
+ kFileTracingEventCategoryGroup, name_, &file_->trace_enabler_,
+ "path", file_->path_.AsUTF8Unsafe());
+ }
+}
+
+} // namespace base
diff --git a/base/files/file_tracing.h b/base/files/file_tracing.h
new file mode 100644
index 0000000..f3bb631
--- /dev/null
+++ b/base/files/file_tracing.h
@@ -0,0 +1,68 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BASE_FILES_FILE_TRACING_H_
+#define BASE_FILES_FILE_TRACING_H_
+
+#include "base/basictypes.h"
+#include "base/macros.h"
+#include "base/trace_event/trace_event.h"
+
+#define FILE_TRACING_PREFIX "File"
+
+#define FILE_TRACING_BEGIN() \
+ TRACE_EVENT_NESTABLE_ASYNC_BEGIN0( \
+ base::kFileTracingEventCategoryGroup, FILE_TRACING_PREFIX, this)
+
+#define FILE_TRACING_END() \
+ TRACE_EVENT_NESTABLE_ASYNC_END0( \
+ base::kFileTracingEventCategoryGroup, FILE_TRACING_PREFIX, this)
+
+#define SCOPED_FILE_TRACE_WITH_SIZE(name, size) \
+ base::ScopedFileTrace scoped_file_trace; \
+ do { \
+ bool category_enabled; \
+ TRACE_EVENT_CATEGORY_GROUP_ENABLED( \
+ base::kFileTracingEventCategoryGroup, &category_enabled); \
+ if (category_enabled) \
+ scoped_file_trace.Initialize( \
+ FILE_TRACING_PREFIX "::" name, this, size); \
+ } while (0)
+
+#define SCOPED_FILE_TRACE(name) SCOPED_FILE_TRACE_WITH_SIZE(name, 0)
+
+namespace base {
+
+class File;
+
+extern const char kFileTracingEventCategoryGroup[];
+
+class ScopedFileTrace {
+ public:
+ ScopedFileTrace();
+ ~ScopedFileTrace();
+
+ // Called only if the tracing category is enabled.
+ void Initialize(const char* event, File* file, int64 size);
+
+ private:
+ // True if |Initialize()| has been called. Don't touch |path_|, |event_|,
+ // or |bytes_| if |initialized_| is false.
+ bool initialized_;
+
+ // The event name to trace (e.g. "Read", "Write"). Prefixed with "base::File".
+ const char* name_;
+
+ // The file being traced. Must outlive this class.
+ File* file_;
+
+ // The size (in bytes) of this trace. Not reported if 0.
+ int64 size_;
+
+ DISALLOW_COPY_AND_ASSIGN(ScopedFileTrace);
+};
+
+} // namespace base
+
+#endif // BASE_FILES_FILE_TRACING_H_
diff --git a/base/threading/platform_thread.h b/base/threading/platform_thread.h
index 653961d..d8f06e5 100644
--- a/base/threading/platform_thread.h
+++ b/base/threading/platform_thread.h
@@ -156,9 +156,8 @@
static void Sleep(base::TimeDelta duration);
// Sets the thread name visible to debuggers/tools. This has no effect
- // otherwise. This name pointer is not copied internally. Thus, it must stay
- // valid until the thread ends.
- static void SetName(const char* name);
+ // otherwise.
+ static void SetName(const std::string& name);
// Gets the thread name, if previously set by SetName.
static const char* GetName();
diff --git a/base/threading/platform_thread_android.cc b/base/threading/platform_thread_android.cc
index a31f659..11e5e2e 100644
--- a/base/threading/platform_thread_android.cc
+++ b/base/threading/platform_thread_android.cc
@@ -64,7 +64,7 @@
} // namespace internal
-void PlatformThread::SetName(const char* name) {
+void PlatformThread::SetName(const std::string& name) {
ThreadIdNameManager::GetInstance()->SetName(CurrentId(), name);
tracked_objects::ThreadData::InitializeThreadContext(name);
@@ -76,7 +76,7 @@
return;
// Set the name for the LWP (which gets truncated to 15 characters).
- int err = prctl(PR_SET_NAME, name);
+ int err = prctl(PR_SET_NAME, name.c_str());
if (err < 0 && errno != EPERM)
DPLOG(ERROR) << "prctl(PR_SET_NAME)";
}
diff --git a/base/threading/platform_thread_linux.cc b/base/threading/platform_thread_linux.cc
index b72fb5b..9f74374 100644
--- a/base/threading/platform_thread_linux.cc
+++ b/base/threading/platform_thread_linux.cc
@@ -70,7 +70,7 @@
} // namespace internal
// static
-void PlatformThread::SetName(const char* name) {
+void PlatformThread::SetName(const std::string& name) {
ThreadIdNameManager::GetInstance()->SetName(CurrentId(), name);
tracked_objects::ThreadData::InitializeThreadContext(name);
@@ -87,7 +87,7 @@
// Note that glibc also has a 'pthread_setname_np' api, but it may not be
// available everywhere and it's only benefit over using prctl directly is
// that it can set the name of threads other than the current thread.
- int err = prctl(PR_SET_NAME, name);
+ int err = prctl(PR_SET_NAME, name.c_str());
// We expect EPERM failures in sandboxed processes, just ignore those.
if (err < 0 && errno != EPERM)
DPLOG(ERROR) << "prctl(PR_SET_NAME)";
diff --git a/base/threading/simple_thread.cc b/base/threading/simple_thread.cc
index 028d4f4..1bc3113 100644
--- a/base/threading/simple_thread.cc
+++ b/base/threading/simple_thread.cc
@@ -52,7 +52,7 @@
// Construct our full name of the form "name_prefix_/TID".
name_.push_back('/');
name_.append(IntToString(tid_));
- PlatformThread::SetName(name_.c_str());
+ PlatformThread::SetName(name_);
// We've initialized our new thread, signal that we're done to Start().
event_.Signal();
diff --git a/base/threading/thread.cc b/base/threading/thread.cc
index bab3991..0e4aab2 100644
--- a/base/threading/thread.cc
+++ b/base/threading/thread.cc
@@ -208,7 +208,7 @@
// Complete the initialization of our Thread object.
thread_id_ = PlatformThread::CurrentId();
- PlatformThread::SetName(name_.c_str());
+ PlatformThread::SetName(name_);
ANNOTATE_THREAD_NAME(name_.c_str()); // Tell the name to race detector.
message_loop->set_thread_name(name_);
message_loop->SetTimerSlack(startup_data_->options.timer_slack);
diff --git a/base/threading/thread_id_name_manager.cc b/base/threading/thread_id_name_manager.cc
index 7c85c1b..56cfa27 100644
--- a/base/threading/thread_id_name_manager.cc
+++ b/base/threading/thread_id_name_manager.cc
@@ -48,17 +48,16 @@
name_to_interned_name_[kDefaultName];
}
-void ThreadIdNameManager::SetName(PlatformThreadId id, const char* name) {
- std::string str_name(name);
-
+void ThreadIdNameManager::SetName(PlatformThreadId id,
+ const std::string& name) {
AutoLock locked(lock_);
- NameToInternedNameMap::iterator iter = name_to_interned_name_.find(str_name);
+ NameToInternedNameMap::iterator iter = name_to_interned_name_.find(name);
std::string* leaked_str = NULL;
if (iter != name_to_interned_name_.end()) {
leaked_str = iter->second;
} else {
- leaked_str = new std::string(str_name);
- name_to_interned_name_[str_name] = leaked_str;
+ leaked_str = new std::string(name);
+ name_to_interned_name_[name] = leaked_str;
}
ThreadIdToHandleMap::iterator id_to_handle_iter =
diff --git a/base/threading/thread_id_name_manager.h b/base/threading/thread_id_name_manager.h
index 0ea59df..927d25f 100644
--- a/base/threading/thread_id_name_manager.h
+++ b/base/threading/thread_id_name_manager.h
@@ -27,7 +27,7 @@
void RegisterThread(PlatformThreadHandle::Handle handle, PlatformThreadId id);
// Set the name for the given id.
- void SetName(PlatformThreadId id, const char* name);
+ void SetName(PlatformThreadId id, const std::string& name);
// Get the name for the given id.
const char* GetName(PlatformThreadId id);
diff --git a/base/threading/watchdog.cc b/base/threading/watchdog.cc
index 769119e..c063799 100644
--- a/base/threading/watchdog.cc
+++ b/base/threading/watchdog.cc
@@ -169,7 +169,7 @@
void Watchdog::ThreadDelegate::SetThreadName() const {
std::string name = watchdog_->thread_watched_name_ + " Watchdog";
- PlatformThread::SetName(name.c_str());
+ PlatformThread::SetName(name);
DVLOG(1) << "Watchdog active: " << name;
}
diff --git a/base/threading/worker_pool_posix.cc b/base/threading/worker_pool_posix.cc
index 8c55a2c..349b5d7 100644
--- a/base/threading/worker_pool_posix.cc
+++ b/base/threading/worker_pool_posix.cc
@@ -77,7 +77,7 @@
const std::string name = base::StringPrintf(
"%s/%d", name_prefix_.c_str(), PlatformThread::CurrentId());
// Note |name.c_str()| must remain valid for for the whole life of the thread.
- PlatformThread::SetName(name.c_str());
+ PlatformThread::SetName(name);
for (;;) {
PendingTask pending_task = pool_->WaitForTask();
diff --git a/base/trace_event/trace_event.h b/base/trace_event/trace_event.h
index e0249f5..9511f80 100644
--- a/base/trace_event/trace_event.h
+++ b/base/trace_event/trace_event.h
@@ -702,15 +702,31 @@
// NESTABLE_ASYNC event of that id. Corresponding warning messages for
// unmatched events will be shown in the analysis view.
-// Records a single NESTABLE_ASYNC_BEGIN event called "name" immediately, with 2
-// associated arguments. If the category is not enabled, then this does nothing.
+// Records a single NESTABLE_ASYNC_BEGIN event called "name" immediately, with 1
+// or 2 associated arguments. If the category is not enabled, then this does
+// nothing.
+#define TRACE_EVENT_NESTABLE_ASYNC_BEGIN0(category_group, name, id) \
+ INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN, \
+ category_group, name, id, TRACE_EVENT_FLAG_NONE)
+#define TRACE_EVENT_NESTABLE_ASYNC_BEGIN1(category_group, name, id, arg1_name, \
+ arg1_val) \
+ INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN, \
+ category_group, name, id, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val)
#define TRACE_EVENT_NESTABLE_ASYNC_BEGIN2(category_group, name, id, arg1_name, \
arg1_val, arg2_name, arg2_val) \
INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN, \
category_group, name, id, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, \
arg2_name, arg2_val)
-// Records a single NESTABLE_ASYNC_END event called "name" immediately, with 2
-// associated arguments. If the category is not enabled, then this does nothing.
+// Records a single NESTABLE_ASYNC_END event called "name" immediately, with 1
+// or 2 associated arguments. If the category is not enabled, then this does
+// nothing.
+#define TRACE_EVENT_NESTABLE_ASYNC_END0(category_group, name, id) \
+ INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_END, \
+ category_group, name, id, TRACE_EVENT_FLAG_NONE)
+#define TRACE_EVENT_NESTABLE_ASYNC_END1(category_group, name, id, arg1_name, \
+ arg1_val) \
+ INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_END, \
+ category_group, name, id, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val)
#define TRACE_EVENT_NESTABLE_ASYNC_END2(category_group, name, id, arg1_name, \
arg1_val, arg2_name, arg2_val) \
INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_END, \