* Re: [Powertop] Command line set tunables option
@ 2013-07-08 16:06 Arjan van de Ven
0 siblings, 0 replies; 9+ messages in thread
From: Arjan van de Ven @ 2013-07-08 16:06 UTC (permalink / raw)
To: powertop
[-- Attachment #1: Type: text/plain, Size: 454 bytes --]
On 7/4/2013 6:13 PM, Chris Samuel wrote:
> It used to be that powertop would give you instructions on how to do that many
> moons ago, but that functionality has been removed. I believe the reasoning
> is on the website, but that's down via IPv6 currently so I can't check.
the 2.3 release at least does this in the HTML report, but not on the screen
(on the screen there's just very limited space, while in the HTML report
there is space...)
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Powertop] Command line set tunables option
@ 2013-07-08 22:47 Chris Samuel
0 siblings, 0 replies; 9+ messages in thread
From: Chris Samuel @ 2013-07-08 22:47 UTC (permalink / raw)
To: powertop
[-- Attachment #1: Type: text/plain, Size: 520 bytes --]
On 09/07/13 02:06, Arjan van de Ven wrote:
> the 2.3 release at least does this in the HTML report, but not on the
> screen
Wonderful, thanks! I'd not realised that, mea culpa.
> (on the screen there's just very limited space, while in the
> HTML report there is space...)
Understood, though as Magnus has mentioned perhaps that could be
revisited now the main window is scrollable?
Thanks for a great tool.
All the best,
Chris
--
Chris Samuel : http://www.csamuel.org/ : Melbourne, VIC
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Powertop] Command line set tunables option
@ 2013-07-08 21:42 Magnus Fromreide
0 siblings, 0 replies; 9+ messages in thread
From: Magnus Fromreide @ 2013-07-08 21:42 UTC (permalink / raw)
To: powertop
[-- Attachment #1: Type: text/plain, Size: 685 bytes --]
On Mon, 2013-07-08 at 09:06 -0700, Arjan van de Ven wrote:
> On 7/4/2013 6:13 PM, Chris Samuel wrote:
> > It used to be that powertop would give you instructions on how to do that many
> > moons ago, but that functionality has been removed. I believe the reasoning
> > is on the website, but that's down via IPv6 currently so I can't check.
>
> the 2.3 release at least does this in the HTML report, but not on the screen
> (on the screen there's just very limited space, while in the HTML report
> there is space...)
But in 2.3 the screen is scrollable. There is lots of virtual space to
the right of the tunable description where the toggle_script could go.
/MF
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Powertop] Command line set tunables option
@ 2013-07-05 1:13 Chris Samuel
0 siblings, 0 replies; 9+ messages in thread
From: Chris Samuel @ 2013-07-05 1:13 UTC (permalink / raw)
To: powertop
[-- Attachment #1: Type: text/plain, Size: 931 bytes --]
On Thu, 4 Jul 2013 01:13:35 PM Mark Boorer wrote:
> I often find myself opening powertop, switching to the tunables tab and
> clicking enter on each of the settings when I run my laptop.
This is something that I do always too; I can get my ZaReason IvyBridge
Ultrabook down to about 7W with all the settings on so I'd be very happy to
see this sort of functionality in Powertop!
> I do this because I'm too lazy to go through and set everything up
> manually ;)
It used to be that powertop would give you instructions on how to do that many
moons ago, but that functionality has been removed. I believe the reasoning
is on the website, but that's down via IPv6 currently so I can't check.
All the best,
Chris
--
Chris Samuel : http://www.csamuel.org/ : Melbourne, VIC
This email may come with a PGP signature as a file. Do not panic.
For more info see: http://en.wikipedia.org/wiki/OpenPGP
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 482 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Powertop] Command line set tunables option
@ 2013-07-04 13:21 Mark Boorer
0 siblings, 0 replies; 9+ messages in thread
From: Mark Boorer @ 2013-07-04 13:21 UTC (permalink / raw)
To: powertop
[-- Attachment #1: Type: text/plain, Size: 751 bytes --]
Hello,
Paul Menzel wrote:
> Using pastebin services to post patches is not the way to go as they are
> hard to review and they are lost once the service shuts down.
Apologies Paul, I thought I was following the rule from
https://01.org/community/participation-guidelines#list , and I can
totally see the problems that having patches on external sites would
bring.
Sergey Senozhatsky wrote:
> I took your patch and did some adjustments. I also changes option name
> to --auto-tune.
Sergey, No worries. I didn't think that main was the best place for it
either, but I also wasn't sure what kind of reception my hack might
receive. Thanks for taking the time to better integrate it with the
rest of the project!
Cheers,
Mark
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Powertop] Command line set tunables option
@ 2013-07-04 9:29 Sergey Senozhatsky
0 siblings, 0 replies; 9+ messages in thread
From: Sergey Senozhatsky @ 2013-07-04 9:29 UTC (permalink / raw)
To: powertop
[-- Attachment #1: Type: text/plain, Size: 381 bytes --]
On (07/04/13 12:23), Sergey Senozhatsky wrote:
>
> I took your patch and did some adjustments. I also changes option name
> to --auto-tune.
>
s/changes/changed/
>
> However, I'm not user if we can merge it into 2.4.
> Arjan, could you please share release schedule plans?
>
" I'm not *sure* "
Sorry for the typo. I was thinking about something else.
-ss
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Powertop] Command line set tunables option
@ 2013-07-04 9:23 Sergey Senozhatsky
0 siblings, 0 replies; 9+ messages in thread
From: Sergey Senozhatsky @ 2013-07-04 9:23 UTC (permalink / raw)
To: powertop
[-- Attachment #1: Type: text/plain, Size: 4540 bytes --]
On (07/04/13 13:13), Mark Boorer wrote:
> I've written a small patch for powertop to add a command line option that
> will set all of the tunables to GOOD, then exit.
>
> I often find myself opening powertop, switching to the tunables tab and
> clicking enter on each of the settings when I run my laptop. I do this
> because I'm too lazy to go through and set everything up manually ;)
> Not sure if this is the desired workflow for people to use this
> application, but if you are interested is it possible for the patch to be
> merged in?
Cc Arjan.
Hello,
I like the idea. Thank you.
A couple of things in your patch:
1. I don't want tunable to be exposed to main.
2. set_tunables() could be done a bit easier.
3. I don't wan't yet another exit point from main. we already have
exit point, which is 'leave_powertop == 1'.
4. alternative exit point, by the way, requires yet another init point.
we already have one, let's keep using it.
I took your patch and did some adjustments. I also changes option name
to --auto-tune.
However, I'm not user if we can merge it into 2.4.
Arjan, could you please share release schedule plans?
Thanks.
-ss
--------8<-----------8<---------
Original idea by Mark Boorer <markboo99 at gmail.com>
Introduce --auto-tune mode.
Auto tune toggles all existing tunables to GOOD state and finishes
powertop execution.
Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky(a)gmail.com>
---
src/main.cpp | 23 ++++++++++++++++-------
src/tuning/tuning.cpp | 8 ++++++++
src/tuning/tuning.h | 4 +---
3 files changed, 25 insertions(+), 10 deletions(-)
diff --git a/src/main.cpp b/src/main.cpp
index 0883424..1810c78 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -71,6 +71,7 @@ static const struct option long_options[] =
{"version", no_argument, NULL, 'V'},
{"help",no_argument, NULL, 'u'}, /* u for usage */
{"calibrate",no_argument, NULL, 'c'},
+ {"auto-tune",no_argument, NULL, 'a'},
{"html", optional_argument, NULL, 'h'},
{"csv", optional_argument, NULL, 'C'},
{"extech", optional_argument, NULL, 'e'},
@@ -106,6 +107,7 @@ static void print_usage()
printf("--debug \t\t %s\n",_("run in \"debug\" mode"));
printf("--version \t\t %s\n",_("print version information"));
printf("--calibrate \t\t %s\n",_("runs powertop in calibration mode"));
+ printf("--auto-tune \t\t %s\n",_("Sets all tunable options to their GOOD setting"));
printf("--extech%s \t %s\n",_("[=devnode]"),_("uses an Extech Power Analyzer for measurements"));
printf("--html%s \t %s\n",_("[=FILENAME]"),_("generate a html report"));
printf("--csv%s \t %s\n",_("[=FILENAME]"),_("generate a csv report"));
@@ -339,7 +341,7 @@ int main(int argc, char **argv)
int c;
char filename[4096];
char workload[4096] = {0,};
- int iterations = 1;
+ int iterations = 1, auto_tune = 0;
set_new_handler(out_of_memory);
@@ -367,7 +369,10 @@ int main(int argc, char **argv)
print_usage();
exit(0);
break;
-
+ case 'a':
+ auto_tune = 1;
+ leave_powertop = 1;
+ break;
case 'c':
powertop_init();
calibrate();
@@ -423,13 +428,17 @@ int main(int argc, char **argv)
end_pci_access();
exit(0);
}
-
- /* first one is short to not let the user wait too long */
init_display();
- one_measurement(1, NULL);
initialize_tuning();
- tuning_update_display();
- show_tab(0);
+ /* first one is short to not let the user wait too long */
+ one_measurement(1, NULL);
+
+ if (!auto_tune) {
+ tuning_update_display();
+ show_tab(0);
+ } else {
+ auto_toggle_tuning();
+ }
while (!leave_powertop) {
show_cur_tab();
diff --git a/src/tuning/tuning.cpp b/src/tuning/tuning.cpp
index 08d8251..ff3d715 100644
--- a/src/tuning/tuning.cpp
+++ b/src/tuning/tuning.cpp
@@ -273,3 +273,11 @@ void clear_tuning()
}
all_untunables.clear();
}
+
+void auto_toggle_tuning()
+{
+ for (unsigned int i = 0; i < all_tunables.size(); i++) {
+ if (all_tunables[i]->good_bad() == TUNE_BAD)
+ all_tunables[i]->toggle();
+ }
+}
diff --git a/src/tuning/tuning.h b/src/tuning/tuning.h
index 7c4921f..f70001b 100644
--- a/src/tuning/tuning.h
+++ b/src/tuning/tuning.h
@@ -29,7 +29,5 @@ extern void initialize_tuning(void);
extern void tuning_update_display(void);
extern void report_show_tunables(void);
extern void clear_tuning(void);
-
-
-
+extern void auto_toggle_tuning(void);
#endif
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [Powertop] Command line set tunables option
@ 2013-07-04 8:40 Paul Menzel
0 siblings, 0 replies; 9+ messages in thread
From: Paul Menzel @ 2013-07-04 8:40 UTC (permalink / raw)
To: powertop
[-- Attachment #1: Type: text/plain, Size: 1249 bytes --]
Dear Mark,
thank you for your patch!
Am Donnerstag, den 04.07.2013, 13:13 +1000 schrieb Mark Boorer:
> I've written a small patch for powertop to add a command line option that
> will set all of the tunables to GOOD, then exit.
>
> I often find myself opening powertop, switching to the tunables tab and
> clicking enter on each of the settings when I run my laptop. I do this
> because I'm too lazy to go through and set everything up manually ;)
> Not sure if this is the desired workflow for people to use this
> application, but if you are interested is it possible for the patch to be
> merged in?
>
> Patch is located here.
> http://pastebin.com/6ahAaBvk
please send that patch formatted with `git format-patch -1` to the
mailing list. Either by using `git send-email` or copy-pasting the file
content in a mailer which does not automatically break lines.
Using pastebin services to post patches is not the way to go as they are
hard to review and they are lost once the service shuts down.
Thanks,
Paul
PS: Could you please configure your Google Mail account to just send
plain text message and to not include a HTML part [1]?
[1] http://en.opensuse.org/openSUSE:Mailing_list_netiquette
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Powertop] Command line set tunables option
@ 2013-07-04 3:13 Mark Boorer
0 siblings, 0 replies; 9+ messages in thread
From: Mark Boorer @ 2013-07-04 3:13 UTC (permalink / raw)
To: powertop
[-- Attachment #1: Type: text/plain, Size: 576 bytes --]
Hi,
I've written a small patch for powertop to add a command line option that
will set all of the tunables to GOOD, then exit.
I often find myself opening powertop, switching to the tunables tab and
clicking enter on each of the settings when I run my laptop. I do this
because I'm too lazy to go through and set everything up manually ;)
Not sure if this is the desired workflow for people to use this
application, but if you are interested is it possible for the patch to be
merged in?
Patch is located here.
http://pastebin.com/6ahAaBvk
Cheers,
Mark
[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 707 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2013-07-08 22:47 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-08 16:06 [Powertop] Command line set tunables option Arjan van de Ven
-- strict thread matches above, loose matches on Subject: below --
2013-07-08 22:47 Chris Samuel
2013-07-08 21:42 Magnus Fromreide
2013-07-05 1:13 Chris Samuel
2013-07-04 13:21 Mark Boorer
2013-07-04 9:29 Sergey Senozhatsky
2013-07-04 9:23 Sergey Senozhatsky
2013-07-04 8:40 Paul Menzel
2013-07-04 3:13 Mark Boorer
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.