Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp262721ybg; Thu, 17 Oct 2019 22:39:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqx8pSMg4p1/srmM52SLb64FmWRYLoBhvC7gV+6PNoXjKbfMifwhJsZ2otTg4oeLhyvMAcVG X-Received: by 2002:a50:ec91:: with SMTP id e17mr7560176edr.169.1571377157717; Thu, 17 Oct 2019 22:39:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571377157; cv=none; d=google.com; s=arc-20160816; b=IKRim+XOVFKZ5JoFlUzCyPmO/aw0qPD4DETVkjHpQAddbnpETPr4gEGgZdwAl2xCLq UrIB9tJzy2MEdCLVJjlRkcEcRjyuy1KKtr9g6/7WeiPa5czxDV83Zi+ECIwNvuUbtqeP cMIrleySA0MER6Ku5VZS+eTZC/FR+Tc/EnI27znpaI9Qad3gaAZmo89pjsshCmwdrsX5 UY0udvdoZ8jGLxH9OhpUlkGr0lIGsh/pX3i5+V5v2CGT+s8Jh4iNPCER7c/bZDPATNW5 JN6YsuAVi7CdBbLXgfqNNoER881vIc22zxFoVl69pyRhVZ95rtBUMzaoF8e/PtaqBGR8 eYWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=SOQlfJr2S2m5T9lXzNIh5LuoQp29e1D9+lDnkBxJGyo=; b=D43mlpKfE5SOVyBZ4XgsF7aaxgTxdTeCWQ3He/Mj1KpaHcOCQkzc5W46/kCcPuzuAi Bymjg1kA0TFQDVZIhsuYHKag1DR7PZ4YZeGCT6uxiEBqwN+0kjXvOK/ppXcJwSmXKsdO RSjXbVIcoySUkzzie+q/PwjBAOjBlQxeBAVzMJeXiDvUJjrqBOEzzw7Gjlq9Litg3I2R PAr2OgDfMOwaf08GpwRxjGFLw0pDQ7zUrGGpJcWc585Yujjase7aVECYhtd+I/V4TSGD 9X/EBmMXpAWdedVdv1toSmAzmb5qgNa8Qc5LUqIATfuB0fiOA2U+UKcjsTYpKk6zC5tH V6Eg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n8si2831921ejh.169.2019.10.17.22.38.54; Thu, 17 Oct 2019 22:39:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391922AbfJQBv1 (ORCPT + 99 others); Wed, 16 Oct 2019 21:51:27 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:57152 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2391717AbfJQBv0 (ORCPT ); Wed, 16 Oct 2019 21:51:26 -0400 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 0170162AEC5F4E90B742; Thu, 17 Oct 2019 09:51:25 +0800 (CST) Received: from [127.0.0.1] (10.133.215.182) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.439.0; Thu, 17 Oct 2019 09:51:14 +0800 Subject: Re: [RFC PATCH 2/3] perf tools: Add support for "report" for some spe events To: James Clark , Jeremy Linton , "peterz@infradead.org" , "mingo@redhat.com" , "acme@kernel.org" , "alexander.shishkin@linux.intel.com" , "jolsa@redhat.com" , "namhyung@kernel.org" , "ak@linux.intel.com" , "adrian.hunter@intel.com" , "yao.jin@linux.intel.com" , "tmricht@linux.ibm.com" , "brueckner@linux.ibm.com" , "songliubraving@fb.com" , "gregkh@linuxfoundation.org" , Kim Phillips CC: "gengdongjiu@huawei.com" , "wxf.wang@hisilicon.com" , "liwei391@huawei.com" , "huawei.libin@huawei.com" , "linux-kernel@vger.kernel.org" , "linux-perf-users@vger.kernel.org" , "Al Grant" , nd References: <1564738813-10944-1-git-send-email-tanxiaojun@huawei.com> <1564738813-10944-3-git-send-email-tanxiaojun@huawei.com> <0ac06995-273c-034d-52a3-921ea0337be2@arm.com> <016c1ce8-7220-75a2-43fa-0efe150f897c@huawei.com> <805660ca-1cf3-4c7f-3aa2-61fed59afa8b@arm.com> <637836d6-c884-1a55-7730-eeb45b590d39@huawei.com> <2b1fc8c7-c0b9-f4b9-a24f-444bc22129af@huawei.com> <335fedb8-128c-7d34-c5e8-15cd660fe12e@huawei.com> <58bed363-41ee-e425-a36e-e3c69d1a4e90@arm.com> From: Tan Xiaojun Message-ID: <647c65eb-669c-e118-e2e7-bbc2a3143884@huawei.com> Date: Thu, 17 Oct 2019 09:51:12 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.1 MIME-Version: 1.0 In-Reply-To: <58bed363-41ee-e425-a36e-e3c69d1a4e90@arm.com> Content-Type: text/plain; charset="windows-1252" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.133.215.182] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019/10/16 18:12, James Clark wrote: > Hi Xiaojun, > >>> >>> What do you mean when the user specifies "event:pp", if the SPE is available, configure and record the spe data directly via the perf event open syscall? >>> (perf.data itself is the same as using -e arm_spe_0//xxx?) >> >> I mean, for the perf record, if the user does not add ":pp" to these events, the original process is taken, and if ":pp" is added, the spe process is taken. >> > > Yes we think this is the best way to do it considering that SPE has been implemented as a separate PMU and it will be very difficult to do it in the Kernel when the precise_ip attribute is set. > > I think doing everything in userspace is easiest. This will at least mean that users of Perf don't have to be aware of the details of SPE to get precise sample data. > > So if the user specifies "event:p" when SPE is available, the SPE PMU is automatically configured data is recorded. If the user also specifies -e arm_spe_0//xxx and wants to do some manual configuration, then that could override the automatic configuration. > > > James > > > OK. I got it. I found a bug in the test. If I specify cpu_list(use -a or -C) when logging spe data, some events with "pid:0 tid:0" is logged. This is obviously wrong. I want to solve this problem, but I haven't found out what went wrong. -------------------------------------------------------------- [root@server121 perf]# perf record -e arm_spe_0/branch_filter=1,ts_enable=1,pa_enable=1,load_filter=1,jitter=0,store_filter=1,min_latency=0/ -a [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 7.925 MB perf.data ] [root@server121 perf]# perf report -D > spe_dump.out [root@server121 perf]# vim spe_dump.out -------------------------------------------------------------- ... 0xd0330 [0x30]: event: 12 . . ... raw event: size 48 bytes . 0000: 0c 00 00 00 00 00 30 00 00 00 00 00 00 00 00 00 ......0......... . 0010: 00 00 00 00 00 00 00 00 f8 d9 fe bd f7 08 02 00 ................ . 0020: 00 00 00 00 00 00 00 00 4c bc 14 00 00 00 00 00 ........L....... 0 572810090961400 0xd0330 [0x30]: PERF_RECORD_ITRACE_START pid: 0 tid: 0 0xd0438 [0x30]: event: 12 . . ... raw event: size 48 bytes . 0000: 0c 00 00 00 00 00 30 00 00 00 00 00 00 00 00 00 ......0......... . 0010: 00 00 00 00 00 00 00 00 d8 ef fe bd f7 08 02 00 ................ . 0020: 01 00 00 00 00 00 00 00 4d bc 14 00 00 00 00 00 ........M....... 1 572810090967000 0xd0438 [0x30]: PERF_RECORD_ITRACE_START pid: 0 tid: 0 ... -------------------------------------------------------------- Thanks. Xiaojun.