All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <sergey.senozhatsky at gmail.com>
To: powertop@lists.01.org
Subject: Re: [Powertop] [PATCH 09/14] do not use ncurses when --auto-tune is specified
Date: Thu, 21 Aug 2014 20:54:47 +0900	[thread overview]
Message-ID: <20140821115447.GA946@swordfish> (raw)
In-Reply-To: 1408568193-31880-1-git-send-email-kerolasa@iki.fi

[-- Attachment #1: Type: text/plain, Size: 2333 bytes --]

On (08/20/14 23:56), Sami Kerola wrote:
> Hello Sergey and others,
> 
> I had a bit of spare time so I started to look what exactly is calling
> mvprintw() via ui_notify_user().  My initial reaction was that I must
> have made some error in search, because I could not find such call.  So I
> added abort() to the code...
> 
> index b482296..55c9603 100644
> --- a/src/lib.cpp
> +++ b/src/lib.cpp
> @@ -546,5 +546,6 @@ void ui_notify_user(const char *frmt, ...)
>         vsnprintf(notify, UI_NOTIFY_BUFF_SZ - 1, frmt, list);
>         va_end(list);
>         mvprintw(1, 0, notify);
> +       abort();
>         attroff(COLOR_PAIR(1));
>  }
> 
> ...and found the --auto-tune does not entering to that function.  When
> running in normal mode the call path is from main() -> one_measurement()
> -> do_sleep() -> cursor_enter() -> tuning_window::cursor_enter ->
> ui_notify_user() -> mvprintw().
> 

oh, yes. my bad, I didn't double check.
auto-tune calls all_tunables[i]->toggle() directly.

ok. then everything should be fine.

	-ss

> I also realized the --auto-tune is setting leave_powertop = 1, which
> means the patch 0009 can be simplified.  Here is better version of the
> change that avoids running unnecessary if().
> 
> --->8----
> From: Sami Kerola <kerolasa(a)iki.fi>
> Date: Wed, 20 Aug 2014 23:31:52 +0300
> Subject: [PATCH 09/14] do not use ncurses when --auto-tune is specified
> 
> Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky(a)gmail.com>
> Signed-off-by: Sami Kerola <kerolasa(a)iki.fi>
> ---
>  src/main.cpp | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/src/main.cpp b/src/main.cpp
> index 3b67ef0..bd0fc88 100644
> --- a/src/main.cpp
> +++ b/src/main.cpp
> @@ -460,7 +460,8 @@ int main(int argc, char **argv)
>  		end_pci_access();
>  		exit(0);
>  	}
> -	init_display();
> +	if (!auto_tune)
> +		init_display();
>  	initialize_tuning();
>  	/* first one is short to not let the user wait too long */
>  	one_measurement(1, NULL);
> @@ -477,7 +478,8 @@ int main(int argc, char **argv)
>  		one_measurement(time_out, NULL);
>  		learn_parameters(15, 0);
>  	}
> -	endwin();
> +	if (!auto_tune)
> +		endwin();
>  	printf("%s\n", _("Leaving PowerTOP"));
>  
>  	end_process_data();
> -- 
> 2.1.0
> 

             reply	other threads:[~2014-08-21 11:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-21 11:54 Sergey Senozhatsky [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-08-20 20:56 [Powertop] [PATCH 09/14] do not use ncurses when --auto-tune is specified Sami Kerola
2014-08-20 12:57 Sami Kerola
2014-08-20 12:28 Sergey Senozhatsky
2014-08-19 11:41 Sergey Senozhatsky
2014-08-05 21:31 Sami Kerola

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=20140821115447.GA946@swordfish \
    --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.