mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Stanislav Fomichev <stfomichev@yandex-team.ru>
Cc: a.p.zijlstra@chello.nl, paulus@samba.org, mingo@redhat.com,
	acme@ghostprotocols.net, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/6] perf timechart: always try to print at least 15 tasks
Date: Tue, 29 Oct 2013 16:50:22 +0900	[thread overview]
Message-ID: <87y55c5xdt.fsf@sejong.aot.lge.com> (raw)
In-Reply-To: <1382439412-23713-2-git-send-email-stfomichev@yandex-team.ru> (Stanislav Fomichev's message of "Tue, 22 Oct 2013 14:56:47 +0400")

Hi Stanislav,

On Tue, 22 Oct 2013 14:56:47 +0400, Stanislav Fomichev wrote:
> Always try to print at least 15 tasks no matter how long they run.
> Add -n option to specify desired number of tasks to print.

Hmm.. I think that this patch tried to do many things at once.

1. introduce while loop: it's a behavioral change so that it can be a
separate patch.  But it seems not checking the process filter - in that
case the loop is almost useless IMHO.

2. new -n option: it should update Documentation/perf-timechart.txt
also.  And the long option name "number" is too general.

3. two if(proc_num): what is this?  Is it for patch 2?

Thanks,
Namhyung

>
> Signed-off-by: Stanislav Fomichev <stfomichev@yandex-team.ru>
> ---
>  tools/perf/builtin-timechart.c | 22 +++++++++++++++-------
>  1 file changed, 15 insertions(+), 7 deletions(-)
>
> diff --git a/tools/perf/builtin-timechart.c b/tools/perf/builtin-timechart.c
> index c2e02319347a..d965f26308ed 100644
> --- a/tools/perf/builtin-timechart.c
> +++ b/tools/perf/builtin-timechart.c
> @@ -40,6 +40,8 @@
>  #define SUPPORT_OLD_POWER_EVENTS 1
>  #define PWR_EVENT_EXIT -1
>  
> +static int proc_num = 15;
> +
>  
>  static unsigned int	numcpus;
>  static u64		min_freq;	/* Lowest CPU frequency seen */
> @@ -944,15 +946,17 @@ static void write_svg_file(const char *filename)
>  {
>  	u64 i;
>  	int count;
> +	int thresh = TIME_THRESH;
>  
>  	numcpus++;
>  
>  
> -	count = determine_display_tasks(TIME_THRESH);
> -
> -	/* We'd like to show at least 15 tasks; be less picky if we have fewer */
> -	if (count < 15)
> -		count = determine_display_tasks(TIME_THRESH / 10);
> +	/* We'd like to show at least proc_num tasks;
> +	 * be less picky if we have fewer */
> +	do {
> +		count = determine_display_tasks(thresh);
> +		thresh /= 10;
> +	} while (thresh && count < proc_num);
>  
>  	open_svg(filename, numcpus, count, first_time, last_time);
>  
> @@ -963,9 +967,11 @@ static void write_svg_file(const char *filename)
>  		svg_cpu_box(i, max_freq, turbo_frequency);
>  
>  	draw_cpu_usage();
> -	draw_process_bars();
> +	if (proc_num)
> +		draw_process_bars();
>  	draw_c_p_states();
> -	draw_wakeups();
> +	if (proc_num)
> +		draw_wakeups();
>  
>  	svg_close();
>  }
> @@ -1094,6 +1100,8 @@ int cmd_timechart(int argc, const char **argv,
>  		       parse_process),
>  	OPT_STRING(0, "symfs", &symbol_conf.symfs, "directory",
>  		    "Look for files with symbols relative to this directory"),
> +	OPT_INTEGER('n', "number", &proc_num,
> +		    "min. number of tasks to print"),
>  	OPT_END()
>  	};
>  	const char * const timechart_usage[] = {

  reply	other threads:[~2013-10-29  7:50 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-22 10:56 [PATCH 0/6] perf timechart improvements Stanislav Fomichev
2013-10-22 10:56 ` [PATCH 1/6] perf timechart: always try to print at least 15 tasks Stanislav Fomichev
2013-10-29  7:50   ` Namhyung Kim [this message]
2013-10-29  9:24     ` Stanislav Fomichev
2013-11-01  6:06       ` Namhyung Kim
2013-10-22 10:56 ` [PATCH 2/6] perf timechart: use proc_num to implement --power-only Stanislav Fomichev
2013-10-29  8:03   ` Namhyung Kim
2013-10-29  9:28     ` Stanislav Fomichev
2013-11-01  6:07       ` Namhyung Kim
2013-10-22 10:56 ` [PATCH 3/6] perf timechart: add support for displaying only tasks related data Stanislav Fomichev
2013-10-29  8:10   ` Namhyung Kim
2013-10-29  9:33     ` Stanislav Fomichev
2013-11-01  6:10       ` Namhyung Kim
2013-10-22 10:56 ` [PATCH 4/6] perf timechart: group figures and add title with details Stanislav Fomichev
2013-10-29  8:15   ` Namhyung Kim
2013-10-29  9:35     ` Stanislav Fomichev
2013-10-22 10:56 ` [PATCH 5/6] perf timechart: add support for -P and -T in timechart recording Stanislav Fomichev
2013-10-29  8:27   ` Namhyung Kim
2013-10-29  9:51     ` Stanislav Fomichev
2013-10-22 10:56 ` [PATCH 6/6] perf timechart: add backtrace support Stanislav Fomichev
2013-10-29  8:41   ` Namhyung Kim

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=87y55c5xdt.fsf@sejong.aot.lge.com \
    --to=namhyung@kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@ghostprotocols.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=paulus@samba.org \
    --cc=stfomichev@yandex-team.ru \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®