From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750766AbcCESRb (ORCPT ); Sat, 5 Mar 2016 13:17:31 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55225 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750732AbcCESR3 (ORCPT ); Sat, 5 Mar 2016 13:17:29 -0500 Date: Sat, 5 Mar 2016 19:17:22 +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 v2 3/8] perf tools: Use own hpp_list for hierarchy mode Message-ID: <20160305181722.GA17746@krava.redhat.com> References: <1457103582-28396-1-git-send-email-namhyung@kernel.org> <1457103582-28396-4-git-send-email-namhyung@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1457103582-28396-4-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 Fri, Mar 04, 2016 at 11:59:37PM +0900, Namhyung Kim wrote: SNIP > @@ -1150,20 +1159,29 @@ static int hists__hierarchy_insert_entry(struct hists *hists, > struct hist_entry *he) > { > struct perf_hpp_fmt *fmt; > + struct perf_hpp_list_node *node; > struct hist_entry *new_he = NULL; > struct hist_entry *parent = NULL; > int depth = 0; > int ret = 0; > > - hists__for_each_sort_list(hists, fmt) { > - if (!perf_hpp__is_sort_entry(fmt) && > - !perf_hpp__is_dynamic_entry(fmt)) > - continue; > - if (perf_hpp__should_skip(fmt, hists)) > + list_for_each_entry(node, &hists->hpp_formats, list) { > + bool skip = false; > + > + perf_hpp_list__for_each_sort_list(&node->hpp, fmt) { > + if (!perf_hpp__is_sort_entry(fmt) && > + !perf_hpp__is_dynamic_entry(fmt)) > + skip = true; > + if (perf_hpp__should_skip(fmt, hists)) > + skip = true; > + if (skip) > + break; could we add skip bool into node and initialize it gradually in add_hierarchy_fmt? jirka