From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751418AbdINBEC (ORCPT ); Wed, 13 Sep 2017 21:04:02 -0400 Received: from mga03.intel.com ([134.134.136.65]:32984 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751316AbdINBEA (ORCPT ); Wed, 13 Sep 2017 21:04:00 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,390,1500966000"; d="scan'208";a="1194863434" Subject: Re: [PATCH v1 1/4] perf annotate: create a new hists to manage multiple events samples From: "Jin, Yao" To: Arnaldo Carvalho de Melo Cc: jolsa@kernel.org, peterz@infradead.org, mingo@redhat.com, alexander.shishkin@linux.intel.com, Linux-kernel@vger.kernel.org, ak@linux.intel.com, kan.liang@intel.com, yao.jin@intel.com References: <1502878716-30817-1-git-send-email-yao.jin@linux.intel.com> <1502878716-30817-2-git-send-email-yao.jin@linux.intel.com> <20170908134324.GB11725@kernel.org> Message-ID: <561eb4d7-ce80-a62d-ade3-e9b95028748f@linux.intel.com> Date: Thu, 14 Sep 2017 09:03:55 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/11/2017 9:33 AM, Jin, Yao wrote: > > > On 9/8/2017 9:43 PM, Arnaldo Carvalho de Melo wrote: >> Em Wed, Aug 16, 2017 at 06:18:33PM +0800, Jin Yao escreveu: >>> An issue is found during using perf annotate. >>> >>> perf record -e cycles,branches ... >>> perf annotate main --stdio >>> >>> The result only shows cycles. It should show both cycles and >>> branches on the left side. It works with "--group", but need >>> this to work even without groups. >>> >>> In current design, the hists is per event. So we need a new >>> hists to manage the samples for multiple events and use a new >>> hist_event data structure to save the map/symbol information >>> for per event. >> Humm, why do we need another hists? Don't we have one per evsel, don't >> we have a evlist from where to get all of those evsels, can't we just >> use that to add one column per evsel? >> >> - Arnaldo >>   > > Hi Arnaldo, > > I'm considering a case. > > Suppose we sample 2 events ("branches" and "cache-misses"). The samples of "branches" are hit in function A and the samples of "cache-misses" are hit in function B. > > The branches evsel has one hists and cache-misses evsel has another hists. > > The hists of branches evsel has one hist-entry which stands for the function A symbol. The hists of cache-misses evsel has one hist-entry which stands for the function B symbol. > > If we start to show the instructions in function B from cache-misses evsel, we will lose the function A. > > Because even if we get the branches evsel from the link in cache-misses evsel, but the function A is before function B and function B has been displayed yet, so the function A is lost. > > Considering the number of events can be greater than 2, the code will be much more complicated. So using a global hists should be an easy solution. > > Thanks > Jin Yao > Hi Arnaldo, Could the solution of using a new hists for multiple events be accepted? Or anything I should update in the patches? Thanks Jin Yao