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

Unified Diff: base/trace_event.h

Issue 3086: * Change output of trace_event log to JSON to enable easier integration with ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 3 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
Index: base/trace_event.h
===================================================================
--- base/trace_event.h (revision 2262)
+++ base/trace_event.h (working copy)
@@ -24,8 +24,10 @@
#include <string>
#include "base/lock.h"
+#include "base/scoped_ptr.h"
#include "base/singleton.h"
#include "base/time.h"
+#include "base/timer.h"
// Use the following macros rather than using the TraceLog class directly as the
// underlying implementation may change in the future. Here's a sample usage:
@@ -40,7 +42,7 @@
#define TRACE_EVENT_BEGIN(name, id, extra) \
Singleton<base::TraceLog>::get()->Trace(name, \
base::TraceLog::EVENT_BEGIN, \
- reinterpret_cast<void*>(id), \
+ reinterpret_cast<const void*>(id), \
extra, \
__FILE__, \
__LINE__)
@@ -50,7 +52,7 @@
#define TRACE_EVENT_END(name, id, extra) \
Singleton<base::TraceLog>::get()->Trace(name, \
base::TraceLog::EVENT_END, \
- reinterpret_cast<void*>(id), \
+ reinterpret_cast<const void*>(id), \
extra, \
__FILE__, \
__LINE__)
@@ -59,7 +61,7 @@
#define TRACE_EVENT_INSTANT(name, id, extra) \
Singleton<base::TraceLog>::get()->Trace(name, \
base::TraceLog::EVENT_INSTANT, \
- reinterpret_cast<void*>(id), \
+ reinterpret_cast<const void*>(id), \
extra, \
__FILE__, \
__LINE__)
@@ -77,6 +79,10 @@
typedef FILE* FileHandle;
#endif
+namespace process_util {
+class ProcessMetrics;
+}
+
namespace base {
class TraceLog {
@@ -97,13 +103,13 @@
// Log a trace event of (name, type, id) with the optional extra string.
void Trace(const std::string& name,
EventType type,
- void* id,
+ const void* id,
const std::wstring& extra,
const char* file,
int line);
void Trace(const std::string& name,
EventType type,
- void* id,
+ const void* id,
const std::string& extra,
const char* file,
int line);
@@ -119,12 +125,15 @@
void CloseLogFile();
bool Start();
void Stop();
+ void Heartbeat();
void Log(const std::string& msg);
bool enabled_;
FileHandle log_file_;
Lock file_lock_;
TimeTicks trace_start_time_;
+ scoped_ptr<process_util::ProcessMetrics> process_metrics_;
+ RepeatingTimer<TraceLog> timer_;
};
} // namespace base
« no previous file with comments | « base/process_util_win.cc ('k') | base/trace_event.cc » ('j') | tools/trace/trace_data.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698