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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F087CC433FE for ; Tue, 8 Mar 2022 03:21:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242155AbiCHDVy (ORCPT ); Mon, 7 Mar 2022 22:21:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233800AbiCHDVw (ORCPT ); Mon, 7 Mar 2022 22:21:52 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CB277F4B; Mon, 7 Mar 2022 19:20:56 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4AD98D6E; Mon, 7 Mar 2022 19:20:56 -0800 (PST) Received: from [10.162.17.54] (a077893.blr.arm.com [10.162.17.54]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BC1BA3FA50; Mon, 7 Mar 2022 19:20:52 -0800 (PST) Message-ID: Date: Tue, 8 Mar 2022 08:50:50 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH] perf: Add irq and exception return branch types Content-Language: en-US To: Arnaldo Carvalho de Melo , James Clark Cc: linux-kernel@vger.kernel.org, Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Thomas Gleixner , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org References: <1645681014-3346-1-git-send-email-anshuman.khandual@arm.com> <10aac3a9-6912-6e47-400e-5c7d8ca9dbcd@arm.com> From: Anshuman Khandual In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/6/22 00:34, Arnaldo Carvalho de Melo wrote: > Em Mon, Feb 28, 2022 at 03:45:25PM +0000, James Clark escreveu: >> >> On 24/02/2022 05:36, Anshuman Khandual wrote: >>> This expands generic branch type classification by adding two more entries >>> there in i.e irq and exception return. Also updates the x86 implementation >>> to process X86_BR_IRET and X86_BR_IRQ records as appropriate. This changes >>> branch types reported to user space on x86 platform but it should not be a >>> problem. The possible scenarios and impacts are enumerated here. >>> >>> -------------------------------------------------------------------------- >>> | kernel | perf tool | Impact | >>> -------------------------------------------------------------------------- >>> | old | old | Works as before | >>> -------------------------------------------------------------------------- >>> | old | new | PERF_BR_UNKNOWN is processed | >>> -------------------------------------------------------------------------- >>> | new | old | PERF_BR_ERET/IRQ are blocked via old PERF_BR_MAX | >>> -------------------------------------------------------------------------- >>> | new | new | PERF_BR_ERET/IRQ are recognized | >>> -------------------------------------------------------------------------- >>> >>> When PERF_BR_ERET/IRQ are blocked via old PERF_BR_MAX (new kernel with old >>> perf tool) the user space might throw up an warning complaining about some >>> unrecognized branch types being reported, but it is expected. PERF_BR_ERET >>> and PERF_BR_IRQ branch types will be used for BRBE implementation on arm64 >>> platform. >>> >>> Cc: Peter Zijlstra >>> Cc: Ingo Molnar >>> Cc: Arnaldo Carvalho de Melo >>> Cc: Mark Rutland >>> Cc: Alexander Shishkin >>> Cc: Jiri Olsa >>> Cc: Namhyung Kim >>> Cc: Thomas Gleixner >>> Cc: Will Deacon >>> Cc: linux-arm-kernel@lists.infradead.org >>> Cc: linux-perf-users@vger.kernel.org >>> Cc: linux-kernel@vger.kernel.org >>> Signed-off-by: Anshuman Khandual >>> --- >>> This applies on v5.17-rc5 >>> >>> These two new branch types expands generic branch type classification but >>> still leaves another three entries in 'type' field for later. Please refer >>> a previous discussion [1] for some further context. >>> >>> [1] https://lore.kernel.org/all/1643348653-24367-1-git-send-email-anshuman.khandual@arm.com/ >>> >>> arch/x86/events/intel/lbr.c | 4 ++-- >>> include/uapi/linux/perf_event.h | 2 ++ > Please try to avoid lockstep development of kernel and tools/, submit > patches to the kernel maintainers for the kernel parts, and to the perf > tools maintainer in separate patches. Sure, will split this patch into two i.e kernel and user space changes. I have an updated series which has some more kernel and user space API changes. But I am wondering if there should be just a single patch updating user space API for all the preceding kernel changes, or there should be one user space API patch for each corresponding kernel change ? > > It is important that changes to the API are flagged, for instance via > tools/perf/check-headers.sh so that opportunity is given for the various > people involved in perf (u/k) development to see what is going on. Will run the diff after the series has been applied to demonstrate all the API changes and update that in the cover letter.