Chromium Code Reviews| 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); |
| + } |
| +} |