lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20131201195634.GB1215@krava.brq.redhat.com>
Date:	Sun, 1 Dec 2013 20:56:34 +0100
From:	Jiri Olsa <jolsa@...hat.com>
To:	Ramkumar Ramachandra <artagnon@...il.com>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	Arnaldo Carvalho de Melo <acme@...hat.com>
Subject: Re: [PATCH v4 2/3] perf diff: color the Ratio column

On Fri, Nov 29, 2013 at 07:06:31PM +0530, Ramkumar Ramachandra wrote:
> In
> 
>   $ perf diff -c ratio
> 
> color the Ratio column using percent_color_snprintf().
> 
> Cc: Jiri Olsa <jolsa@...hat.com>
> Cc: Arnaldo Carvalho de Melo <acme@...hat.com>
> Signed-off-by: Ramkumar Ramachandra <artagnon@...il.com>
> ---
>  tools/perf/builtin-diff.c | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
> 
> diff --git a/tools/perf/builtin-diff.c b/tools/perf/builtin-diff.c
> index c970aae..25dac6c 100644
> --- a/tools/perf/builtin-diff.c
> +++ b/tools/perf/builtin-diff.c
> @@ -794,6 +794,17 @@ static int __hpp__color_compare(struct perf_hpp_fmt *fmt,
>  		scnprintf(pfmt, 20, "%%%+d.2f%%%%", dfmt->header_width - 1);
>  		return percent_color_snprintf(hpp->buf, hpp->size,
>  					pfmt, fabs(diff));
> +	case COMPUTE_RATIO:
> +		if (he->dummy)
> +			goto dummy_print;
> +		if (pair->diff.computed)
> +			diff = pair->diff.period_ratio;
> +		else
> +			diff = compute_ratio(he, pair);
> +
> +		scnprintf(pfmt, 20, "%%%d.6f", dfmt->header_width);
> +		return percent_color_snprintf(hpp->buf, hpp->size,
> +					pfmt, diff);

ok, lets keep same limits for ratio and wdiff.. unless
we hear otherwise ;-)

Arnaldo,
I think we want to add something like 'value_color_snprintf' ?
to keep percent/values separated..

It'd do the same job, just the name does not fit in here,
because we are printing out ratio values.

thanks,
jirka
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ