From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 64286C433C1 for ; Wed, 31 Mar 2021 02:19:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 37BEA619BB for ; Wed, 31 Mar 2021 02:19:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232952AbhCaCSz (ORCPT ); Tue, 30 Mar 2021 22:18:55 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:14648 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233072AbhCaCSu (ORCPT ); Tue, 30 Mar 2021 22:18:50 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4F990V2g8kznV2x; Wed, 31 Mar 2021 10:16:10 +0800 (CST) Received: from [10.67.102.248] (10.67.102.248) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.498.0; Wed, 31 Mar 2021 10:18:34 +0800 Subject: Re: [PATCH v7] perf annotate: Fix sample events lost in stdio mode To: Namhyung Kim CC: Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Yao Jin , , , linux-kernel , References: <20210319123527.173883-1-yangjihong1@huawei.com> <33ba152e-b8ef-3057-744a-51cb8c478ff2@huawei.com> <27703989-e510-c964-2af7-ef0a5611f8cf@huawei.com> From: Yang Jihong Message-ID: <555b7a2d-13c8-e840-e62b-cf0ad7d084a9@huawei.com> Date: Wed, 31 Mar 2021 10:18:34 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.102.248] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, Namhyung and Arnaldo, On 2021/3/30 15:26, Namhyung Kim wrote: > Hi Yang and Arnaldo, > > On Sat, Mar 27, 2021 at 11:16 AM Yang Jihong wrote: >> On 2021/3/26 20:06, Arnaldo Carvalho de Melo wrote: >>> So it seems to be working, what am I missing? Is this strictly non >>> group related? >>> >> Yes, it is non group related. >> This problem occurs only when different events need to be recorded at >> the same time, i.e.: >> perf record -e branch-misses -e branch-instructions -a sleep 1 >> >> The output results of perf script and perf annotate do not match. >> Some events are not output in perf annotate. > > Yeah I think it's related to sort keys. The code works with a single > hist_entry for each event and symbol. But the default sort key > creates multiple entries for different threads and it causes the > confusion. > Yes, After revome zfree from hists__find_annotations, the output of perf annotate is repeated, which is related to sort keys. The original problem is that notes->src may correspond to multiple sample events. Therefore, we cannot simply zfree notes->src to avoid repeated output. Arnaldo, is there any problem with this patch? :) Thanks, Yang > Thanks, > Namhyung > . >