static int bootchart_init_action(int nargs, char **args) { bootchart_count = bootchart_init(); if (bootchart_count < 0) { ERROR("bootcharting init failure\n"); } else if (bootchart_count > 0) { NOTICE("bootcharting started (period=%d ms)\n", bootchart_count*BOOTCHART_POLLING_MS); } else { NOTICE("bootcharting ignored\n"); } }
int do_bootchart_init(const std::vector<std::string>& args) { g_remaining_samples = bootchart_init(); if (g_remaining_samples < 0) { ERROR("Bootcharting init failure: %s\n", strerror(errno)); } else if (g_remaining_samples > 0) { NOTICE("Bootcharting started (will run for %d s).\n", (g_remaining_samples * BOOTCHART_POLLING_MS) / 1000); } else { NOTICE("Not bootcharting.\n"); } return 0; }