diff options
author | erg <erg@chromium.org> | 2015-10-23 16:04:47 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-10-23 23:05:27 +0000 |
commit | 127dbee2bb1cda047f9314646e889f6a001fd9b5 (patch) | |
tree | 4ec7d65a65e269fe95c5596131e800694de0bcbf /sql | |
parent | 20443afffd2409eef93ec23e57838d42d0bcd5a1 (diff) | |
download | chromium_src-127dbee2bb1cda047f9314646e889f6a001fd9b5.zip chromium_src-127dbee2bb1cda047f9314646e889f6a001fd9b5.tar.gz chromium_src-127dbee2bb1cda047f9314646e889f6a001fd9b5.tar.bz2 |
mandoline: Start adding trace events for mandoline stuff.
BUG=534895
Review URL: https://codereview.chromium.org/1421483003
Cr-Commit-Position: refs/heads/master@{#355915}
Diffstat (limited to 'sql')
-rw-r--r-- | sql/mojo/mojo_vfs.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sql/mojo/mojo_vfs.cc b/sql/mojo/mojo_vfs.cc index 8fc6da7..943f38b 100644 --- a/sql/mojo/mojo_vfs.cc +++ b/sql/mojo/mojo_vfs.cc @@ -7,6 +7,7 @@ #include "base/logging.h" #include "base/rand_util.h" #include "base/strings/stringprintf.h" +#include "base/trace_event/trace_event.h" #include "components/filesystem/public/interfaces/file.mojom.h" #include "components/filesystem/public/interfaces/file_system.mojom.h" #include "components/filesystem/public/interfaces/types.mojom.h" @@ -60,6 +61,7 @@ filesystem::FilePtr& GetFSFile(sqlite3_file* vfs_file) { int MojoVFSClose(sqlite3_file* file) { DVLOG(1) << "MojoVFSClose(*)"; + TRACE_EVENT0("sql", "MojoVFSClose"); using filesystem::FilePtr; filesystem::FileError error = filesystem::FILE_ERROR_FAILED; // Must call File::Close explicitly instead of just deleting the file, since @@ -75,6 +77,7 @@ int MojoVFSRead(sqlite3_file* sql_file, int size, sqlite3_int64 offset) { DVLOG(1) << "MojoVFSRead (" << size << " @ " << offset << ")"; + TRACE_EVENT0("sql", "MojoVFSRead"); filesystem::FileError error = filesystem::FILE_ERROR_FAILED; mojo::Array<uint8_t> mojo_data; GetFSFile(sql_file)->Read(size, offset, filesystem::WHENCE_FROM_BEGIN, @@ -104,6 +107,7 @@ int MojoVFSWrite(sqlite3_file* sql_file, int size, sqlite_int64 offset) { DVLOG(1) << "MojoVFSWrite(*, " << size << ", " << offset << ")"; + TRACE_EVENT0("sql", "MojoVFSWrite"); mojo::Array<uint8_t> mojo_data(size); memcpy(&mojo_data.front(), buffer, size); @@ -128,6 +132,7 @@ int MojoVFSWrite(sqlite3_file* sql_file, int MojoVFSTruncate(sqlite3_file* sql_file, sqlite_int64 size) { DVLOG(1) << "MojoVFSTruncate(*, " << size << ")"; + TRACE_EVENT0("sql", "MojoVFSTruncate"); filesystem::FileError error = filesystem::FILE_ERROR_FAILED; GetFSFile(sql_file)->Truncate(size, Capture(&error)); GetFSFile(sql_file).WaitForIncomingResponse(); @@ -142,6 +147,7 @@ int MojoVFSTruncate(sqlite3_file* sql_file, sqlite_int64 size) { int MojoVFSSync(sqlite3_file* sql_file, int flags) { DVLOG(1) << "MojoVFSSync(*, " << flags << ")"; + TRACE_EVENT0("sql", "MojoVFSSync"); filesystem::FileError error = filesystem::FILE_ERROR_FAILED; GetFSFile(sql_file)->Flush(Capture(&error)); GetFSFile(sql_file).WaitForIncomingResponse(); @@ -156,6 +162,7 @@ int MojoVFSSync(sqlite3_file* sql_file, int flags) { int MojoVFSFileSize(sqlite3_file* sql_file, sqlite_int64* size) { DVLOG(1) << "MojoVFSFileSize(*)"; + TRACE_EVENT0("sql", "MojoVFSFileSize"); filesystem::FileError err = filesystem::FILE_ERROR_FAILED; filesystem::FileInformationPtr file_info; @@ -236,6 +243,9 @@ int MojoVFSOpen(sqlite3_vfs* mojo_vfs, int flags, int* pOutFlags) { DVLOG(1) << "MojoVFSOpen(*, " << name << ", *, " << flags << ")"; + TRACE_EVENT2("sql", "MojoVFSOpen", + "name", name, + "flags", flags); int open_flags = 0; if (flags & SQLITE_OPEN_EXCLUSIVE) { DCHECK(flags & SQLITE_OPEN_CREATE); @@ -293,6 +303,9 @@ int MojoVFSOpen(sqlite3_vfs* mojo_vfs, int MojoVFSDelete(sqlite3_vfs* mojo_vfs, const char* filename, int sync_dir) { DVLOG(1) << "MojoVFSDelete(*, " << filename << ", " << sync_dir << ")"; + TRACE_EVENT2("sql", "MojoVFSDelete", + "name", filename, + "sync_dir", sync_dir); // TODO(erg): The default windows sqlite VFS has retry code to work around // antivirus software keeping files open. We'll probably have to do something // like that in the far future if we ever support Windows. @@ -313,6 +326,9 @@ int MojoVFSAccess(sqlite3_vfs* mojo_vfs, int flags, int* result) { DVLOG(1) << "MojoVFSAccess(*, " << filename << ", " << flags << ", *)"; + TRACE_EVENT2("sql", "MojoVFSAccess", + "name", filename, + "flags", flags); filesystem::FileError error = filesystem::FILE_ERROR_FAILED; if (flags == SQLITE_ACCESS_READWRITE || flags == SQLITE_ACCESS_READ) { |