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

Unified Diff: src/IceCfg.cpp

Issue 1867473002: Subzero: Fix -timing-focus . (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « no previous file | src/IceGlobalContext.h » ('j') | src/IceGlobalContext.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceCfg.cpp
diff --git a/src/IceCfg.cpp b/src/IceCfg.cpp
index 4f316c1280e7f1007c6bbaf2520f1df292e37285..4d3fc2ed078296658528a91a1073368612004244 100644
--- a/src/IceCfg.cpp
+++ b/src/IceCfg.cpp
@@ -204,7 +204,6 @@ void Cfg::translate() {
if (TimingFocusOn == "*" || TimingFocusOn == Name) {
setFocusedTiming();
getContext()->resetTimer(GlobalContext::TSK_Default);
- getContext()->setTimerName(GlobalContext::TSK_Default, Name);
}
}
}
@@ -240,8 +239,16 @@ void Cfg::translate() {
dump("Final output");
if (getFocusedTiming()) {
- getContext()->mergeTimersFromTLS();
- getContext()->dumpTimers();
+ // Temporarily override the thread-local timer name to be the name of the
+ // function. Don't do it permanently because the final timer merge at the
+ // end expects the thread-local timer names to be the same as the global
+ // timer name.
+ std::string OrigName =
John 2016/04/06 13:05:32 Auto, maybe?
Jim Stichnoth 2016/04/06 13:23:58 Done.
+ getContext()->getTimerName(GlobalContext::TSK_Default);
+ getContext()->setTimerName(GlobalContext::TSK_Default,
+ getFunctionName().toString());
+ getContext()->dumpLocalTimers();
John 2016/04/06 13:05:32 Maybe have dumpLocalTimers do the renaming?
Jim Stichnoth 2016/04/06 13:23:58 Very nice! Done.
+ getContext()->setTimerName(GlobalContext::TSK_Default, OrigName);
}
}
« no previous file with comments | « no previous file | src/IceGlobalContext.h » ('j') | src/IceGlobalContext.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698