From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755038Ab2I1GEV (ORCPT ); Fri, 28 Sep 2012 02:04:21 -0400 Received: from LGEMRELSE1Q.lge.com ([156.147.1.111]:64686 "EHLO LGEMRELSE1Q.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754407Ab2I1GEM (ORCPT ); Fri, 28 Sep 2012 02:04:12 -0400 X-AuditID: 9c93016f-b7b1eae000000815-61-50653ddbd43f From: Namhyung Kim To: Jiri Olsa Cc: linux-kernel@vger.kernel.org, Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Paul Mackerras , Corey Ashford , Frederic Weisbecker Subject: Re: [PATCH 03/14] perf hists: Separate overhead and baseline columns References: <1348744175-11115-1-git-send-email-jolsa@redhat.com> <1348744175-11115-4-git-send-email-jolsa@redhat.com> Date: Fri, 28 Sep 2012 14:56:01 +0900 In-Reply-To: <1348744175-11115-4-git-send-email-jolsa@redhat.com> (Jiri Olsa's message of "Thu, 27 Sep 2012 13:09:24 +0200") Message-ID: <87zk4au1vy.fsf@sejong.aot.lge.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Brightmail-Tracker: AAAAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 27 Sep 2012 13:09:24 +0200, Jiri Olsa wrote: > Currently the overhead and baseline columns are handled within > single function and the distinction is made by 'baseline hists' > pointer passed by 'struct perf_hpp::ptr'. > > Since hists pointer is now part of each hist_entry, it's possible > to locate paired hists pointer directly from the passed struct > hist_entry pointer. > > Also separating those 2 columns makes the code more obvious. Yes, it was thinking about something like this. > > Cc: Arnaldo Carvalho de Melo > Cc: Peter Zijlstra > Cc: Ingo Molnar > Cc: Paul Mackerras > Cc: Corey Ashford > Cc: Frederic Weisbecker > Cc: Namhyung Kim > Signed-off-by: Jiri Olsa > --- [snip] > +static int hpp__color_baseline(struct perf_hpp *hpp, struct hist_entry *he) > +{ > + double percent = baseline_percent(he); > + > + return percent_color_snprintf(hpp->buf, hpp->size, " %5.2f%%", percent); Is it possible to have a baseline value over 100%? I changed 'overhead' colum format from '2 spaces + %5.2f + %' to '1 space + %6.2f + %' for the case. Probably it'd better using it here too for consistency. > +} > + > +static int hpp__entry_baseline(struct perf_hpp *hpp, struct hist_entry *he) > +{ > + double percent = baseline_percent(he); > + const char *fmt = symbol_conf.field_sep ? "%.2f" : " %5.2f%%"; Ditto. Thanks, Namhyung > + > + return scnprintf(hpp->buf, hpp->size, fmt, percent); > +} > +