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

Unified Diff: runtime/szrt_profiler.c

Issue 1147023007: Subzero: Basic Block Profiler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Named constants; fflush; clang-format. Created 5 years, 6 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 | « pydir/szbuild.py ('k') | src/IceCfg.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/szrt_profiler.c
diff --git a/runtime/szrt_profiler.c b/runtime/szrt_profiler.c
new file mode 100644
index 0000000000000000000000000000000000000000..e31692ea6d6ee5c2b80ca910a6a6648c08f23c8c
--- /dev/null
+++ b/runtime/szrt_profiler.c
@@ -0,0 +1,59 @@
+#include <stdint.h>
+#include <stdio.h>
+
+struct BlockProfileInfo {
+ uint64_t Counter;
+ const char *const BlockName;
+} __attribute__((aligned(8)));
+
+extern const struct BlockProfileInfo *__Sz_block_profile_info;
+
+static const char SubzeroLogo[] =
+ "\n"
+ "\n"
+ "__________________________________________________________________________"
+ "____________________________\n"
+ " _____/\\\\\\\\\\\\\\\\\\\\\\__________________/"
+ "\\\\\\_______________________________________________________________\n"
+ " "
+ "___/\\\\\\/////////\\\\\\_______________\\/"
+ "\\\\\\_______________________________________________________________\n"
+ " "
+ "__\\//\\\\\\______\\///________________\\/"
+ "\\\\\\_______________________________________________________________\n"
+ " "
+ "___\\////\\\\\\__________/\\\\\\____/\\\\\\_\\/\\\\\\_________/"
+ "\\\\\\\\\\\\\\\\\\\\\\_____/\\\\\\\\\\\\\\\\___/\\\\/\\\\\\\\\\\\\\____/"
+ "\\\\\\\\\\____\n"
+ " "
+ "______\\////\\\\\\______\\/\\\\\\___\\/\\\\\\_\\/\\\\\\\\\\\\\\\\\\__\\///"
+ "////\\\\\\/____/\\\\\\/////\\\\\\_\\/\\\\\\/////\\\\\\_/\\\\\\///"
+ "\\\\\\__\n"
+ " "
+ "_________\\////\\\\\\___\\/\\\\\\___\\/\\\\\\_\\/\\\\\\////\\\\\\______/"
+ "\\\\\\/_____/\\\\\\\\\\\\\\\\\\\\\\__\\/\\\\\\__\\///__/\\\\\\__\\//"
+ "\\\\\\_\n"
+ " "
+ "__/\\\\\\______\\//\\\\\\__\\/\\\\\\___\\/\\\\\\_\\/\\\\\\__\\/\\\\\\____/"
+ "\\\\\\/______\\//\\\\///////___\\/\\\\\\_______\\//\\\\\\__/\\\\\\__\n"
+ " "
+ "_\\///\\\\\\\\\\\\\\\\\\\\\\/___\\//\\\\\\\\\\\\\\\\\\__\\/"
+ "\\\\\\\\\\\\\\\\\\___/\\\\\\\\\\\\\\\\\\\\\\__\\//\\\\\\\\\\\\\\\\\\\\_\\/"
+ "\\\\\\________\\///\\\\\\\\\\/___\n"
+ " "
+ "___\\///////////______\\/////////___\\/////////___\\///////////____\\/////"
+ "/////__\\///___________\\/////_____\n"
+ " "
+ "__________________________________________________________________________"
+ "____________________________\n"
+ "\n"
+ "\n";
+
+void __Sz_profile_summary() {
+ printf("%s", SubzeroLogo);
+ for (const struct BlockProfileInfo **curr = &__Sz_block_profile_info;
+ *curr != NULL; ++curr) {
+ printf("%lld\t%s\n", (*curr)->Counter, (*curr)->BlockName);
+ }
+ fflush(stdout);
+}
« no previous file with comments | « pydir/szbuild.py ('k') | src/IceCfg.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698