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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 28109C52D7B for ; Tue, 13 Aug 2024 14:46:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=3KqWpoNJ70SnzgynYJwWCiQpBrh2+HZuuBdAfogioYg=; b=u2XdeuyohABU9vRvbdPdpXv2eS pURjOYJE617QGMMTQaaCN7/OpNQjZhGcL/UWl8qQ8QIrbEiMWU2ltIg2tWcdjLq7H5/GAh1kwPBMn unBdj2ioiNGdl3M5sk6eI5WsXOlG/22nKfP63WcMaQdyirCGUPTKe/2rb2rV8ez4NKAxV5finTZ1g N0IzCHpNzjZwp+2yX+WMnjmQ1eGLQ6P3P2/oC2go7PTbNDGYwABSrBE+BfnsO1hb98Kwc/EtO5xFv zAnl5DGAMFDWd2EETNQYwhFd8tEgI5Z4PbuSVTiQf+eOsf4S9NJ9e/17D1SA6izUqHQPQWMZ0sXvq 3Gh/eN3g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sdsnG-000000044SD-1EyE; Tue, 13 Aug 2024 14:46:38 +0000 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sdsmd-000000044KF-2Hj0 for linux-arm-kernel@lists.infradead.org; Tue, 13 Aug 2024 14:46:01 +0000 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-36bd70f6522so3046594f8f.1 for ; Tue, 13 Aug 2024 07:45:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723560357; x=1724165157; darn=lists.infradead.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=3KqWpoNJ70SnzgynYJwWCiQpBrh2+HZuuBdAfogioYg=; b=kwNnSllIIKtWJRSL4sIsWdptotbU7w904zBHpjLiv/J8Yvn4/2c9YuQ+3ls/Mctz6o ZGrN6p0hWlwrPKMStsX9OLZFiCq2Upk7v7YDhgiWKlAQUhJtAgwhYC9YaoKXi0J59Nrk M4/8DeIl9qCNQAAtgkdazJWoUMuOLYR7a7XT8U/LLJmsqaVkrvUPuZ2B2Vc7ts9DdxK+ yi1K8dz86alMPE0T3qh0gLlZ5zObCA+gLUY7DGuUov/K/L8bYi2r365jEdhixWryEtUy 1HFU8xpUp3Y4Ohdq+ca3KRlYKq9PMt56qhi1K8/ZetjBZLg+eEpZgD6l3/HZwdntu60B qPTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723560357; x=1724165157; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=3KqWpoNJ70SnzgynYJwWCiQpBrh2+HZuuBdAfogioYg=; b=pZeMUDRnu2DZJO2svFEc2Y+VFZmB1bMq8uoyzNvtrZR0XgCCWuxWdMhs74qfm7g/do Y7BMgpOLvIHNOS+55LLd+6N9bmyKcSLHJ5foezGq9SdWqfnmvcDjYIo6/uVN2eb/YsYl ZWuLA3XMVCgqjuo3V07ms9QugMPy618TXHu9MXRdW/3jNH0i4YrawTsXrT62Rny6xFZO XINQBxTviLAFNSw2DnFKaAG7XnWBvcJXPVkUPxlQmO7ihLvyclVDVYOAjO2gb9u5R8Yf +mwo089JB3YCgrXtRr+wnLx+IGnFPEe2VIFwf3cG+FLIo/G3g/v+wCYbHN5RFNg7pQyk vfiA== X-Forwarded-Encrypted: i=1; AJvYcCVabq4KCfcsMRKnu5Kx/dz1fxrACPUSLlkBL96a7tmU4scvewHsgxpKUgvNm2fBI+1kTTUxPiERBCBfQqkWEQBh4V8b7QDTohDxNkDUE6Y+GzmtgTs= X-Gm-Message-State: AOJu0YyD086L6/+2u5eBzfULxbGd2Vr3lW9Fgk83y1rTRRN590Eze12Q 5zR70mRUbfBTPazfutIR3rHKZ3la7sfzndXyB41It2tunJ+ZBgaMuKIkGPOOGBk= X-Google-Smtp-Source: AGHT+IFylDyDwvoSu3xlbdPwaHJWXbFjUmQPkuOqB+U7gUxYCuGGWAsP2bM6cTmZQDpJCnRwEnpNWQ== X-Received: by 2002:adf:f902:0:b0:367:91d8:a1d2 with SMTP id ffacd0b85a97d-3716ccfc64dmr3297667f8f.30.1723560357326; Tue, 13 Aug 2024 07:45:57 -0700 (PDT) Received: from [192.168.1.3] ([89.47.253.130]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36e4cfee74csm10506466f8f.48.2024.08.13.07.45.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 13 Aug 2024 07:45:57 -0700 (PDT) Message-ID: <5ac3fc9d-4ed6-46ed-b537-13d27ba46e3b@linaro.org> Date: Tue, 13 Aug 2024 15:45:55 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 0/7] perf stat: Make default perf stat command work on Arm big.LITTLE To: Ian Rogers Cc: linux-perf-users@vger.kernel.org, John Garry , Will Deacon , Mike Leach , Leo Yan , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Adrian Hunter , "Liang, Kan" , Dominique Martinet , Ze Gao , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <20240813132323.98728-1-james.clark@linaro.org> Content-Language: en-US From: James Clark In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240813_074559_619264_681775ED X-CRM114-Status: GOOD ( 30.59 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 13/08/2024 3:35 pm, Ian Rogers wrote: > On Tue, Aug 13, 2024 at 6:24 AM James Clark wrote: >> >> The important patches are 3 and 5, the rest are tidyups and tests. >> >> I don't think there is any interaction with the other open issues >> about the uncore DSU cycles event or JSON/legacy hw event priorities >> because only hw events on core PMUs are used for the default >> stat command. And also just sharing the existing x86 code works so >> no big changes are required. >> >> For patch 3 the weak arch specific symbol has to continue to be used >> rather than picking the implementation based on >> perf_pmus__supports_extended_type() like in patch 5. This is because >> that function ends up calling evsel__hw_name() itself which results >> in recursion. But at least one weak arch_* construct has been removed, >> so it's better than nothing. > > Let's not do things this way. The use of strings is architecture > neutral, means we don't need to create new arch functions on things > like RISC-V, it encapsulates the complexity of things like topdown If the new arch function is an issue that could be worked around by calling perf_pmus__supports_extended_type() on patch 3 as well? It just needs a small change to not recurse. > events, Apple ARM M CPUs not supporting legacy events, etc. If Apple M doesn't support the HW events does _any_ default Perf stat command (hybrid or not) work? I'm not really trying to fix that here, just make whatever already works work on big.LITTLE. > Duplicating the existing x86 logic, when that was something trying to > be removed, is not the way to go. That logic was a holdover from the > hybrid tech debt we've been working to remove with a generic approach. > > Thanks, > Ian > I think all of that may make sense, but in this case I haven't actually duplicated anything, rather shared the existing code to also be used on Arm. This means we can have the default perf stat working on Arm from today, and if any other changes get made it will continue to work as I've also added a test for it. >> James Clark (7): >> perf stat: Initialize instead of overwriting clock event >> perf stat: Remove unused default_null_attrs >> perf evsel: Use the same arch_evsel__hw_name() on arm64 as x86 >> perf evsel: Remove duplicated __evsel__hw_name() code >> perf evlist: Use hybrid default attrs whenever extended type is >> supported >> perf test: Make stat test work on DT devices >> perf test: Add a test for default perf stat command >> >> tools/perf/arch/arm64/util/Build | 1 + >> tools/perf/arch/arm64/util/evsel.c | 7 ++++ >> tools/perf/arch/x86/util/evlist.c | 65 ------------------------------ >> tools/perf/arch/x86/util/evsel.c | 17 +------- >> tools/perf/builtin-stat.c | 12 ++---- >> tools/perf/tests/shell/stat.sh | 33 ++++++++++++--- >> tools/perf/util/evlist.c | 65 ++++++++++++++++++++++++++---- >> tools/perf/util/evlist.h | 6 +-- >> tools/perf/util/evsel.c | 19 +++++++++ >> tools/perf/util/evsel.h | 2 +- >> 10 files changed, 119 insertions(+), 108 deletions(-) >> create mode 100644 tools/perf/arch/arm64/util/evsel.c >> >> -- >> 2.34.1 >>