From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759703AbcBTXTO (ORCPT ); Sat, 20 Feb 2016 18:19:14 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59744 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759647AbcBTXTC (ORCPT ); Sat, 20 Feb 2016 18:19:02 -0500 Date: Sun, 21 Feb 2016 00:18:56 +0100 From: Jiri Olsa To: Namhyung Kim 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: <20160220231856.GB17925@krava.homerouter.cpe> References: <1455631723-17345-1-git-send-email-namhyung@kernel.org> <1455631723-17345-17-git-send-email-namhyung@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1455631723-17345-17-git-send-email-namhyung@kernel.org> 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 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 jirka