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

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: Adds Basic Block Profiling. 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
Index: runtime/szrt_profiler.c
diff --git a/runtime/szrt_profiler.c b/runtime/szrt_profiler.c
new file mode 100644
index 0000000000000000000000000000000000000000..c377f288531ee1b3ede0f2d8414b7aefc47f10b2
--- /dev/null
+++ b/runtime/szrt_profiler.c
@@ -0,0 +1,58 @@
+#include <stdint.h>
+#include <stdio.h>
+
+struct BlockProfileInfo {
+ uint64_t Counter;
+ const char *const BlockName;
+} __attribute__((aligned(8)));
+
+extern const struct BlockProfileInfo *block_profile_info;
Jim Stichnoth 2015/06/08 23:45:31 For this and profile_summary, you may want to try
John 2015/06/09 15:36:17 Done.
+
+const char SubzeroLogo[] =
Jim Stichnoth 2015/06/08 23:45:31 static?
John 2015/06/09 15:36:18 Done.
+ "\n"
+ "\n"
+ "__________________________________________________________________________"
+ "____________________________\n"
+ " _____/\\\\\\\\\\\\\\\\\\\\\\__________________/"
+ "\\\\\\_______________________________________________________________\n"
+ " "
+ "___/\\\\\\/////////\\\\\\_______________\\/"
+ "\\\\\\_______________________________________________________________\n"
+ " "
+ "__\\//\\\\\\______\\///________________\\/"
+ "\\\\\\_______________________________________________________________\n"
+ " "
+ "___\\////\\\\\\__________/\\\\\\____/\\\\\\_\\/\\\\\\_________/"
+ "\\\\\\\\\\\\\\\\\\\\\\_____/\\\\\\\\\\\\\\\\___/\\\\/\\\\\\\\\\\\\\____/"
+ "\\\\\\\\\\____\n"
+ " "
+ "______\\////\\\\\\______\\/\\\\\\___\\/\\\\\\_\\/\\\\\\\\\\\\\\\\\\__\\///"
+ "////\\\\\\/____/\\\\\\/////\\\\\\_\\/\\\\\\/////\\\\\\_/\\\\\\///"
+ "\\\\\\__\n"
+ " "
+ "_________\\////\\\\\\___\\/\\\\\\___\\/\\\\\\_\\/\\\\\\////\\\\\\______/"
+ "\\\\\\/_____/\\\\\\\\\\\\\\\\\\\\\\__\\/\\\\\\__\\///__/\\\\\\__\\//"
+ "\\\\\\_\n"
+ " "
+ "__/\\\\\\______\\//\\\\\\__\\/\\\\\\___\\/\\\\\\_\\/\\\\\\__\\/\\\\\\____/"
+ "\\\\\\/______\\//\\\\///////___\\/\\\\\\_______\\//\\\\\\__/\\\\\\__\n"
+ " "
+ "_\\///\\\\\\\\\\\\\\\\\\\\\\/___\\//\\\\\\\\\\\\\\\\\\__\\/"
+ "\\\\\\\\\\\\\\\\\\___/\\\\\\\\\\\\\\\\\\\\\\__\\//\\\\\\\\\\\\\\\\\\\\_\\/"
+ "\\\\\\________\\///\\\\\\\\\\/___\n"
+ " "
+ "___\\///////////______\\/////////___\\/////////___\\///////////____\\/////"
+ "/////__\\///___________\\/////_____\n"
+ " "
+ "__________________________________________________________________________"
+ "____________________________\n"
+ "\n"
+ "\n";
+
+void profile_summary() {
+ printf("%s", SubzeroLogo);
+ for (const struct BlockProfileInfo **curr = &block_profile_info;
+ *curr != NULL; ++curr) {
+ printf("%lld\t%s\n", (*curr)->Counter, (*curr)->BlockName);
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698