Subzero: Fix -timing-funcs and -timing-focus flags.
1. Generate dummy FunctionXXX function names when either of those flags is given.
2. Remove the browser code that automatically sets F/G prefixes instead of Function/Global, since that performance tweak is no longer relevant.
3. Fix a presumably long-standing bug where -timing-focus would accumulate timings into the TLS copy of the timers, but would then try to print timing info based on the currently-empty GlobalContext copy of the timers.
BUG= none
R=kschimpf@google.com
Review URL: https://codereview.chromium.org/1855683002 .
diff --git a/src/IceGlobalContext.cpp b/src/IceGlobalContext.cpp
index 5689a3e..e7faa50 100644
--- a/src/IceGlobalContext.cpp
+++ b/src/IceGlobalContext.cpp
@@ -966,6 +966,10 @@
}
}
+void GlobalContext::mergeTimersFromTLS() {
+ getTimers()->mergeFrom(ICE_TLS_GET_FIELD(TLS)->Timers);
+}
+
void GlobalContext::dumpTimers(TimerStackIdT StackID, bool DumpCumulative) {
if (!BuildDefs::timers())
return;
@@ -992,7 +996,8 @@
void TimerMarker::push() {
switch (StackID) {
case GlobalContext::TSK_Default:
- Active = getFlags().getSubzeroTimingEnabled();
+ Active = getFlags().getSubzeroTimingEnabled() ||
+ !getFlags().getTimingFocusOn().empty();
break;
case GlobalContext::TSK_Funcs:
Active = getFlags().getTimeEachFunction();