aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBoris ARZUR <boris@strl.cat>2016-07-21 15:06:40 -0700
committerNivedita Swaminathan <nivedita.swaminathan@intel.com>2016-07-21 15:12:34 -0700
commit06696d4e5f2ef7ba36fa0c8c6b34f72eefcb4c05 (patch)
tree5410c70c2f8cfac7ff66e96e25797d289cb6d227 /src
parent962dda61a55ad2250f58b587e25687cf91fb1884 (diff)
downloadpowertop-2.0-06696d4e5f2ef7ba36fa0c8c6b34f72eefcb4c05.tar.gz
enable --auto-tune without debugfs
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/main.cpp b/src/main.cpp
index b60d7b5..c51a9f7 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -311,7 +311,7 @@ static int get_nr_open(void) {
return nr_open;
}
-static void powertop_init(void)
+static void powertop_init(int auto_tune)
{
static char initialized = 0;
int ret;
@@ -339,9 +339,14 @@ static void powertop_init(void)
ret = system("mount -t debugfs debugfs /sys/kernel/debug > /dev/null 2>&1");
}
if (ret != 0) {
- printf(_("Failed to mount debugfs!\n"));
- printf(_("exiting...\n"));
- exit(EXIT_FAILURE);
+ if (!auto_tune) {
+ fprintf(stderr, _("Failed to mount debugfs!\n"));
+ fprintf(stderr, _("exiting...\n"));
+ exit(EXIT_FAILURE);
+ } else {
+ fprintf(stderr, _("Failed to mount debugfs!\n"));
+ fprintf(stderr, _("Should still be able to auto tune...\n"));
+ }
}
}
@@ -414,7 +419,7 @@ int main(int argc, char **argv)
ui_notify_user = ui_notify_user_console;
break;
case 'c':
- powertop_init();
+ powertop_init(0);
calibrate();
break;
case 'C': /* csv report */
@@ -470,7 +475,7 @@ int main(int argc, char **argv)
}
}
- powertop_init();
+ powertop_init(auto_tune);
if (reporttype != REPORT_OFF)
make_report(time_out, workload, iterations, filename);