From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751621AbcBUSJ3 (ORCPT ); Sun, 21 Feb 2016 13:09:29 -0500 Received: from mail-pa0-f41.google.com ([209.85.220.41]:33973 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751310AbcBUSJ1 (ORCPT ); Sun, 21 Feb 2016 13:09:27 -0500 Date: Sun, 21 Feb 2016 17:43:56 +0900 From: Namhyung Kim To: Jiri Olsa Cc: Arnaldo Carvalho de Melo , Ingo Molnar , Peter Zijlstra , Jiri Olsa , LKML , David Ahern , Andi Kleen , Stephane Eranian , Wang Nan Subject: Re: [PATCH v6 16/25] perf ui/stdio: Implement hierarchy output mode Message-ID: <20160221084356.GC32589@danjae.kornet> References: <1455631723-17345-1-git-send-email-namhyung@kernel.org> <1455631723-17345-17-git-send-email-namhyung@kernel.org> <20160220231856.GB17925@krava.homerouter.cpe> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20160220231856.GB17925@krava.homerouter.cpe> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Feb 21, 2016 at 12:18:56AM +0100, Jiri Olsa wrote: > On Tue, Feb 16, 2016 at 11:08:34PM +0900, Namhyung Kim wrote: > > SNIP > > > +static int hist_entry__hierarchy_fprintf(struct hist_entry *he, > > + struct perf_hpp *hpp, > > + int nr_sort_key, struct hists *hists, > > + FILE *fp) > > +{ > > + const char *sep = symbol_conf.field_sep; > > + struct perf_hpp_fmt *fmt; > > + char *buf = hpp->buf; > > + int ret, printed = 0; > > + bool first = true; > > + > > + if (symbol_conf.exclude_other && !he->parent) > > + return 0; > > + > > + ret = scnprintf(hpp->buf, hpp->size, "%*s", he->depth * HIERARCHY_INDENT, ""); > > + advance_hpp(hpp, ret); > > + > > + hists__for_each_format(he->hists, fmt) { > > + if (perf_hpp__is_sort_entry(fmt) || perf_hpp__is_dynamic_entry(fmt)) > > + break; > > + > > + /* > > + * If there's no field_sep, we still need > > + * to display initial ' '. > > + */ > > + if (!sep || !first) { > > + ret = scnprintf(hpp->buf, hpp->size, "%s", sep ?: " "); > > + advance_hpp(hpp, ret); > > + } else > > + first = false; > > + > > + if (perf_hpp__use_color() && fmt->color) > > + ret = fmt->color(fmt, hpp, he); > > + else > > + ret = fmt->entry(fmt, hpp, he); > > + > > + advance_hpp(hpp, ret); > > there's new hist_entry__snprintf_alignment function for > proper alignment now used in hist_entry__hierarchy_fprintf > > you might wat to use it in here as well Ah missed that, will change. Btw it seems it's not strictly needed here since the hierarchy mode makes each column as the last though. But I agree that it's a general change and can be applied here as well. Thanks, Namhyung