From: Waldemar Kozaczuk <[email protected]>
Committer: Waldemar Kozaczuk <[email protected]>
Branch: master
Changed loader to print total boot time by default
Signed-off-by: Waldemar Kozaczuk <[email protected]>
---
diff --git a/core/chart.cc b/core/chart.cc
--- a/core/chart.cc
+++ b/core/chart.cc
@@ -45,3 +45,10 @@ void boot_time_chart::print_chart()
print_one_time(i);
}
}
+
+void boot_time_chart::print_total_time()
+{
+ auto last = arrays[_event - 1].stamp;
+ auto initial = arrays[0].stamp;
+ printf("Booted up in %.2f ms\n", to_msec(last - initial));
+}
diff --git a/include/osv/boot.hh b/include/osv/boot.hh
--- a/include/osv/boot.hh
+++ b/include/osv/boot.hh
@@ -15,6 +15,7 @@ public:
void event(int event_idx, const char *str);
void event(int event_idx, const char *str, u64 stamp);
void print_chart();
+ void print_total_time();
private:
// Can we keep it at 0 and let the initial two users increment it?
No, we
// cannot. The reason is that the code that *parses* those fields run
diff --git a/loader.cc b/loader.cc
--- a/loader.cc
+++ b/loader.cc
@@ -443,6 +443,9 @@ void* do_main_thread(void *_main_args)
if (opt_bootchart) {
boot_time.print_chart();
}
+ else {
+ boot_time.print_total_time();
+ }
if (!opt_redirect.empty()) {
// redirect stdout and stdin to the given file, instead of the
console
--
You received this message because you are subscribed to the Google Groups "OSv
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.