* [Powertop] --auto-tune without debugfs
@ 2016-07-06 8:09 Boris ARZUR
0 siblings, 0 replies; only message in thread
From: Boris ARZUR @ 2016-07-06 8:09 UTC (permalink / raw)
To: powertop
[-- Attachment #1: Type: text/plain, Size: 323 bytes --]
Dear Powertop Team,
I use your utility at boot time to auto-tune my laptop.
When using a grsec kernel, debugfs may not be available. This causes your
utility to complain & exit.
I use this very simple patch to force your wonderful tool to ignore that
problem when auto-tuning.
Thank you and best regard,
Boris.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: autotune_nodebugfs.patch --]
[-- Type: text/x-diff, Size: 1326 bytes --]
--- powertop-orig/src/main.cpp 2016-07-06 07:57:20.351478410 +0000
+++ powertop+autotune_without_debugfs/src/main.cpp 2016-07-06 08:02:23.335448966 +0000
@@ -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);
[-- Attachment #3: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-07-06 8:09 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-06 8:09 [Powertop] --auto-tune without debugfs Boris ARZUR
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.