From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751352AbdJRWlH (ORCPT ); Wed, 18 Oct 2017 18:41:07 -0400 Received: from mga04.intel.com ([192.55.52.120]:32232 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750932AbdJRWlG (ORCPT ); Wed, 18 Oct 2017 18:41:06 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,398,1503385200"; d="scan'208";a="164742176" From: Andi Kleen To: Milian Wolff Cc: acme@kernel.org, jolsa@kernel.org, namhyung@kernel.org, Linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Arnaldo Carvalho de Melo , David Ahern , Peter Zijlstra , Yao Jin , Ravi Bangoria Subject: Re: [PATCH v6 1/6] perf report: properly handle branch count in match_chain References: <20171018185350.14893-1-milian.wolff@kdab.com> <20171018185350.14893-2-milian.wolff@kdab.com> Date: Wed, 18 Oct 2017 15:41:04 -0700 In-Reply-To: <20171018185350.14893-2-milian.wolff@kdab.com> (Milian Wolff's message of "Wed, 18 Oct 2017 20:53:45 +0200") Message-ID: <871sm0hyf3.fsf@linux.intel.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Milian Wolff writes: > > +static enum match_result match_address_dso(struct dso *left_dso, u64 left_ip, > + struct dso *right_dso, u64 right_ip) > +{ > + if (left_dso == right_dso && left_ip == right_ip) > + return MATCH_EQ; > + else if (left_ip < right_ip) > + return MATCH_LT; > + else > + return MATCH_GT; > +} So why does only the first case check the dso? Does it not matter for the others? Either should be checked by none or by all. > + case CCKEY_FUNCTION: > + if (node->sym && cnode->ms.sym) { > + /* > + * Compare inlined frames based on their symbol name > + * because different inlined frames will have the same > + * symbol start. Otherwise do a faster comparison based > + * on the symbol start address. > + */ > + if (cnode->ms.sym->inlined || node->sym->inlined) > + match = match_chain_strings(cnode->ms.sym->name, node->sym->name); So what happens when there are multiple symbols with the same name? (e.g. local for a DSO or local in a file) > + node->ip); > + } else { > + /* > + * It's "from" of a branch > + */ > + cnode->brtype_stat.branch_to = false; > + cnode->cycles_count += node->branch_flags.cycles; > + cnode->iter_count += node->nr_loop_iter; > + cnode->iter_cycles += node->iter_cycles; I assume you tested the cycle accounting still works? -Andi