aboutsummaryrefslogtreecommitdiff
path: root/src/profiler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/profiler.cpp')
-rw-r--r--src/profiler.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/profiler.cpp b/src/profiler.cpp
index d05b7abfe..d13afc882 100644
--- a/src/profiler.cpp
+++ b/src/profiler.cpp
@@ -137,7 +137,7 @@ int Profiler::print(std::ostream &o, u32 page, u32 pagecount)
{
GraphValues values;
getPage(values, page, pagecount);
- char num_buf[50];
+ char buffer[50];
for (const auto &i : values) {
o << " " << i.first << " ";
@@ -146,16 +146,17 @@ int Profiler::print(std::ostream &o, u32 page, u32 pagecount)
continue;
}
- s32 space = 44 - i.first.size();
- for (s32 j = 0; j < space; j++) {
- if ((j & 1) && j < space - 1)
- o << ".";
- else
- o << " ";
+ {
+ // Padding
+ s32 space = std::max(0, 44 - (s32)i.first.size());
+ memset(buffer, '_', space);
+ buffer[space] = '\0';
+ o << buffer;
}
- porting::mt_snprintf(num_buf, sizeof(num_buf), "% 4ix % 3g",
+
+ porting::mt_snprintf(buffer, sizeof(buffer), "% 5ix % 4.4g",
getAvgCount(i.first), i.second);
- o << num_buf << std::endl;
+ o << buffer << std::endl;
}
return values.size();
}