lkml.org 
[lkml]   [2012]   [Sep]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [PATCH 03/14] perf hists: Separate overhead and baseline columns
    Date
    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 <acme@ghostprotocols.net>
    > Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
    > Cc: Ingo Molnar <mingo@elte.hu>
    > Cc: Paul Mackerras <paulus@samba.org>
    > Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
    > Cc: Frederic Weisbecker <fweisbec@gmail.com>
    > Cc: Namhyung Kim <namhyung@kernel.org>
    > Signed-off-by: Jiri Olsa <jolsa@redhat.com>
    > ---
    [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);
    > +}
    > +


    \
     
     \ /
      Last update: 2012-09-28 09:01    [W:3.944 / U:1.388 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site