From: Boris ARZUR <boris at strl.cat>
To: powertop@lists.01.org
Subject: [Powertop] --auto-tune without debugfs
Date: Wed, 06 Jul 2016 08:09:00 +0000 [thread overview]
Message-ID: <20160706080859.GA32706@odroid> (raw)
[-- 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 --]
reply other threads:[~2016-07-06 8:09 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160706080859.GA32706@odroid \
--to=powertop@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.