зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 8661c6e4fa51 (bug 1072903)
This commit is contained in:
Родитель
791e6c76b8
Коммит
51991c42be
|
@ -130,7 +130,7 @@ TraceLoggerThread::init()
|
||||||
}
|
}
|
||||||
|
|
||||||
enabled = 1;
|
enabled = 1;
|
||||||
logTimestamp(TraceLogger_Enable);
|
graph.enable();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -157,8 +157,12 @@ TraceLoggerThread::enable()
|
||||||
if (failed)
|
if (failed)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
// TODO: Remove this. This is so the refactor works with mimimal changes,
|
||||||
|
// It is the intention to remove this by logging TraceLogger_Enable/TraceLogger_Disable.
|
||||||
|
events.clear();
|
||||||
|
|
||||||
enabled = 1;
|
enabled = 1;
|
||||||
logTimestamp(TraceLogger_Enable);
|
graph.enable();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -229,7 +233,12 @@ TraceLoggerThread::disable()
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
logTimestamp(TraceLogger_Disable);
|
graph.log(events);
|
||||||
|
events.clear();
|
||||||
|
|
||||||
|
uint64_t time = rdtsc() - traceLoggers.startupTime;
|
||||||
|
graph.disable(time);
|
||||||
|
|
||||||
enabled = 0;
|
enabled = 0;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -377,7 +377,7 @@ TraceLoggerGraph::stopEvent(uint64_t timestamp)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Forcefully disable logging. We have no stack information anymore.
|
// Forcefully disable logging. We have no stack information anymore.
|
||||||
logTimestamp(TraceLogger_Disable, timestamp);
|
disable(timestamp);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
stack.pop();
|
stack.pop();
|
||||||
|
@ -386,9 +386,6 @@ TraceLoggerGraph::stopEvent(uint64_t timestamp)
|
||||||
void
|
void
|
||||||
TraceLoggerGraph::logTimestamp(uint32_t id, uint64_t timestamp)
|
TraceLoggerGraph::logTimestamp(uint32_t id, uint64_t timestamp)
|
||||||
{
|
{
|
||||||
if (id == TraceLogger_Enable)
|
|
||||||
enabled = true;
|
|
||||||
|
|
||||||
if (!enabled)
|
if (!enabled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -398,9 +395,6 @@ TraceLoggerGraph::logTimestamp(uint32_t id, uint64_t timestamp)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (id == TraceLogger_Disable)
|
|
||||||
disable(timestamp);
|
|
||||||
|
|
||||||
EventEntry &entry = events.pushUninitialized();
|
EventEntry &entry = events.pushUninitialized();
|
||||||
entry.time = timestamp;
|
entry.time = timestamp;
|
||||||
entry.textId = id;
|
entry.textId = id;
|
||||||
|
@ -494,6 +488,12 @@ TraceLoggerGraph::updateStop(uint32_t treeId, uint64_t timestamp)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
TraceLoggerGraph::enable()
|
||||||
|
{
|
||||||
|
enabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
TraceLoggerGraph::disable(uint64_t timestamp)
|
TraceLoggerGraph::disable(uint64_t timestamp)
|
||||||
{
|
{
|
||||||
|
|
|
@ -199,6 +199,10 @@ class TraceLoggerGraph
|
||||||
// Create a tree out of all the given events.
|
// Create a tree out of all the given events.
|
||||||
void log(ContinuousSpace<EventEntry> &events);
|
void log(ContinuousSpace<EventEntry> &events);
|
||||||
|
|
||||||
|
// Disable/enable the logger.
|
||||||
|
void disable(uint64_t timestamp);
|
||||||
|
void enable();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool failed;
|
bool failed;
|
||||||
bool enabled;
|
bool enabled;
|
||||||
|
@ -246,10 +250,6 @@ class TraceLoggerGraph
|
||||||
|
|
||||||
// Log an (non-tree) event.
|
// Log an (non-tree) event.
|
||||||
void logTimestamp(uint32_t id, uint64_t timestamp);
|
void logTimestamp(uint32_t id, uint64_t timestamp);
|
||||||
|
|
||||||
// Disable logging and forcefully report all not yet stopped tree events
|
|
||||||
// as stopped.
|
|
||||||
void disable(uint64_t timestamp);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* TraceLoggingGraph_h */
|
#endif /* TraceLoggingGraph_h */
|
||||||
|
|
|
@ -57,8 +57,6 @@
|
||||||
|
|
||||||
#define TRACELOGGER_LOG_ITEMS(_) \
|
#define TRACELOGGER_LOG_ITEMS(_) \
|
||||||
_(Bailout) \
|
_(Bailout) \
|
||||||
_(Disable) \
|
|
||||||
_(Enable) \
|
|
||||||
_(Stop)
|
_(Stop)
|
||||||
|
|
||||||
// Predefined IDs for common operations. These IDs can be used
|
// Predefined IDs for common operations. These IDs can be used
|
||||||
|
|
Загрузка…
Ссылка в новой задаче