mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Taeung Song <treeze.taeung@gmail.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
	linux-kernel@vger.kernel.org, jolsa@redhat.com,
	linux-perf-users@vger.kernel.org
Subject: Re: [PATCH] perf top: Add a visual cue for toggle zeroing of samples
Date: Tue, 07 Oct 2014 14:26:19 +0900	[thread overview]
Message-ID: <87a958h2mc.fsf@sejong.aot.lge.com> (raw)
In-Reply-To: <1412491774-2971-1-git-send-email-treeze.taeung@gmail.com> (Taeung Song's message of "Sun, 5 Oct 2014 15:49:34 +0900")

Hi Taeung,

On Sun,  5 Oct 2014 15:49:34 +0900, Taeung Song wrote:
> When 'perf top' is run, one can't easily find a difference
> between -z option and normal output.
> So I added a visual cue to know whether it is the zeroing or not.


[SNIP]
> +static int hists__browser_title(struct hists *hists,
> +				struct hist_browser_timer *hbt,
> +				char *bf,
> +				size_t size)

You don't need to align arguments like this.


>  {
>  	char unit;
>  	int printed;
> @@ -1256,6 +1268,14 @@ static int hists__browser_title(struct hists *hists, char *bf, size_t size)
>  	if (dso)
>  		printed += scnprintf(bf + printed, size - printed,
>  				    ", DSO: %s", dso->short_name);
> +	if (!is_report_browser(hbt)) {
> +		struct perf_top *top = hbt->arg;
> +
> +		if (top->zero)
> +			printed += scnprintf(bf + printed, size - printed,
> +					     ", [z]", "");

It seems the final empty string can go away.  And personally I'd like to
get rid of "," before "[z]" also.

Otherwise looks good to me.  Could you please take a look at the stdio
output too?

Thanks,
Namhyung


> +	}
> +
>  	return printed;
>  }
>  
> @@ -1267,12 +1287,6 @@ static inline void free_popup_options(char **options, int n)
>  		zfree(&options[i]);
>  }
>  
> -/* Check whether the browser is for 'top' or 'report' */
> -static inline bool is_report_browser(void *timer)
> -{
> -	return timer == NULL;
> -}
> -
>  /*
>   * Only runtime switching of perf data file will make "input_name" point
>   * to a malloced buffer. So add "is_input_name_malloced" flag to decide

  reply	other threads:[~2014-10-07  5:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-05  6:49 Taeung Song
2014-10-07  5:26 ` Namhyung Kim [this message]
2014-10-07  7:38   ` taeung
  -- strict thread matches above, loose matches on Subject: below --
2014-10-04 16:35 Taeung Song
2014-10-04 16:13 Taeung Song

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=87a958h2mc.fsf@sejong.aot.lge.com \
    --to=namhyung@kernel.org \
    --cc=acme@kernel.org \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=treeze.taeung@gmail.com \
    /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

Powered by JetHome