lkml.org 
[lkml]   [2014]   [Aug]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 2/2] perf hists browser: Consolidate callchain print functions in TUI

* Arnaldo Carvalho de Melo <acme@kernel.org> wrote:

> Em Thu, Aug 21, 2014 at 10:15:46AM +0900, Namhyung Kim escreveu:
> > Currently there're two callchain print functions in TUI - one for the
> > hists browser and another for file dump. They do almost same job so
> > it'd be better consolidate the codes.
>
> Some comments below, thanks for doing this work!
>
> > To do that, move row calculation code into a print callback so that
> > the dump code cannot be limited by the current screen size.
>
> > Cc: Frederic Weisbecker <fweisbec@gmail.com>
> > Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> > ---
> > tools/perf/ui/browsers/hists.c | 210 +++++++++++++++--------------------------
> > 1 file changed, 76 insertions(+), 134 deletions(-)
> >
> > diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
> > index 519353d9f5fb..48d8c8eee6c2 100644
> > --- a/tools/perf/ui/browsers/hists.c
> > +++ b/tools/perf/ui/browsers/hists.c
> > @@ -477,20 +477,32 @@ static char *callchain_list__sym_name(struct callchain_list *cl,
> > return bf;
> > }
> >
> > +struct callchain_print_arg {
> > + /* for hists browser */
> > + unsigned short row;
> > + off_t row_offset;
> > + bool is_current_entry;
> > +
> > + /* for file dump */
> > + FILE *fp;
> > + int printed;
> > +};

Just a data type definition nitpicking pet peeve of mine, don't
you guys too find this vertically aligned form infinitely more
readable:

struct callchain_print_arg {
/* for hists browser */
unsigned short row;
off_t row_offset;
bool is_current_entry;

/* for file dump */
FILE *fp;
int printed;
};

especially when looking at it via email, without syntax
highlighting?

Thanks,

Ingo


\
 
 \ /
  Last update: 2014-08-22 10:41    [W:0.083 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site