Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3431941pxj; Tue, 15 Jun 2021 00:21:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwtFs2hVME5Y+twERSE0ggl0hhZYEeWlWmibJ0pawBp00KKznFJfYjSU0dl2JAUpbAM0nso X-Received: by 2002:a17:906:2612:: with SMTP id h18mr19455292ejc.417.1623741683086; Tue, 15 Jun 2021 00:21:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623741683; cv=none; d=google.com; s=arc-20160816; b=UkAo8jAtUbAuGp10eP4VNmHDSvLzVt4euiwRTQx2PgAgmsCiVFwq9fhwJaLMSx5PUE KA5mHx5pEQ3MffJLj0wiRPeAJ4VKN3kAjYbcPQ2TBE7IVHwBNXqlGtiknsl5P7UWxgEa AxeiBFANqqsCLD/ShSqhP6IyoQN2/qwatzLfMWAtxx5Yo+9z/WrU2WQ8vzIgI9tHpHH5 02rdW3R7c9WMtA9yQubdpkkO8SUi3eGODLbC6nYWm6Ls3Z2PCB0dSa3Lsq/mux9tRdoE zNvhFTSSATZ1tOR2IH2gbYM+3gEVn3livbqycvbRBX80rV1KDyy8D0dnCFlopT8xNXbP w0wQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=y7FJHoxd52JCzAFjCS3bWriMQ4PvIYTlSNnGyT1/DvI=; b=kmVbXp2HfzqLw3QncMMYaA2+RcnURQWHPt6YsAOJ5mXcGgCHTCPqXjSA+Xlnow1hUa KicohCTwcEewICiwGglcEjSDV8S/eWKmMLHjQV3szJfXcdX6DgPL2ZDlBvVwwzs48439 LUXDdzOBg4+5cT/GBWPfe1BqbLowz7K54yiuaSAk2iEt08TbMcYDo5tonWcRlYOXDLHt 94AU8tKyZjMPdFKgCpaSQTsYRQQuaah0McWfDMQcz3jeBw1tiTAaRUX9YMUEfY46BzLs o016eMMhW13tJa1ebZ6is97ztqkD58Wv80XrjqgyOBZQDVZ/8ys7Byu0iEEvDKlma78S 8PqQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b14si14334319ejq.311.2021.06.15.00.21.00; Tue, 15 Jun 2021 00:21:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229797AbhFOHV4 (ORCPT + 99 others); Tue, 15 Jun 2021 03:21:56 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:10071 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229488AbhFOHVz (ORCPT ); Tue, 15 Jun 2021 03:21:55 -0400 Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4G404Q247MzZcJD; Tue, 15 Jun 2021 15:16:54 +0800 (CST) Received: from dggpemm000003.china.huawei.com (7.185.36.128) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Tue, 15 Jun 2021 15:19:48 +0800 Received: from [10.67.102.248] (10.67.102.248) by dggpemm000003.china.huawei.com (7.185.36.128) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Tue, 15 Jun 2021 15:19:48 +0800 Subject: Re: [PATCH v3] perf annotate: Add itrace options support To: Leo Yan , Adrian Hunter , Arnaldo Carvalho de Melo CC: , , , , , , , , References: <20210615024036.181427-1-yangjihong1@huawei.com> <20210615040447.GB9844@leoy-ThinkPad-X240s> From: Yang Jihong Message-ID: <52532fa6-8883-ee5a-7047-53415f9d34f9@huawei.com> Date: Tue, 15 Jun 2021 15:19:48 +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: <20210615040447.GB9844@leoy-ThinkPad-X240s> 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-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpemm000003.china.huawei.com (7.185.36.128) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, Leo and Arnaldo, On 2021/6/15 12:04, Leo Yan wrote: > Hi Jihong, > > Loop in Adrain to be aware this AUX trace change. > > On Tue, Jun 15, 2021 at 10:40:36AM +0800, Yang Jihong wrote: >> The "auxtrace_info" and "auxtrace" functions are not set in "tool" member of >> "annotate". As a result, perf annotate does not support parsing itrace data. >> >> Before: >> >> # perf record -e arm_spe_0/branch_filter=1/ -a sleep 1 >> [ perf record: Woken up 9 times to write data ] >> [ perf record: Captured and wrote 20.874 MB perf.data ] >> # perf annotate --stdio >> Error: >> The perf.data data has no samples! >> >> Solution: >> 1.Add itrace options in help, >> 2.Set hook functions of "auxtrace_info" and "auxtrace" in perf_tool. >> >> After: >> >> # perf record --all-user -e arm_spe_0/branch_filter=1/ ls >> Couldn't synthesize bpf events. >> perf.data >> [ perf record: Woken up 1 times to write data ] >> [ perf record: Captured and wrote 0.010 MB perf.data ] >> # perf annotate --stdio > >> Percent | Source code & Disassembly of libc-2.28.so for branch-miss (1 samples, percent: local period) >> ------------------------------------------------------------------------------------------------------------ >> : >> : >> : >> : Disassembly of section .text: >> : >> : 0000000000066180 <__getdelim@@GLIBC_2.17>: >> 0.00 : 66180: stp x29, x30, [sp, #-96]! >> 0.00 : 66184: cmp x0, #0x0 >> 0.00 : 66188: ccmp x1, #0x0, #0x4, ne // ne = any >> 0.00 : 6618c: mov x29, sp >> 0.00 : 66190: stp x24, x25, [sp, #56] >> 0.00 : 66194: stp x26, x27, [sp, #72] >> 0.00 : 66198: str x28, [sp, #88] >> 0.00 : 6619c: b.eq 66450 <__getdelim@@GLIBC_2.17+0x2d0> // b.none >> 0.00 : 661a0: stp x22, x23, [x29, #40] > > [...] > > Nitpick: the above example is not typical for annotation, since it > doesn't show any C source code with samples. At my side, I tested this > patch and confirmed the patch works well with below commands: > > # gcc -ggdb -O0 -o task_migration task_migration.c > # perf record -e cs_etm/@tmc_etr0/u --per-thread ./task_migration > # perf annotate --itrace=i1000 --stdio > > The complete annotation result can be reviewed at [1]. > > Thus for this patch: > > Tested-by: Leo Yan > > [1] https://paste.ubuntu.com/p/pHz74MYRPJ/ > > [...] > . > Thank you very much for the detailed testing of this patch :) Yes, this example may not be well written. Arnaldo, please check whether the commit message needs to be modified. If yes, I will resubmit a new v4 patch Thanks, Jihong