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 31B40CDD1CD for ; Fri, 27 Sep 2024 17:24:10 +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:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=fFz8+sDf54KSfSkFlRkAL9+O1qaeGw4W0cb2FqU+FkU=; b=LzoDdCYbZmLSCJNco9itQjtYf/ oXcmbjjnmdjsYgzfqtU6OWOaCoDan0fgcw/VJG5f8oqe0UPjVGBpMXXTRD88N58GiQCujX/t4GVnI 9NTvxvKZcsaMZtu9X3mjgAjpYxORSx8ZHRie9PFVFNjjApQOhJQAmN47fZv62N+DdnVS7KYtyJTpp uF2+jiIfKMS1duI38+BA2WCbb9+LfaiPD8M2UUWm+toeE/R+XPhB1q1e3bJHneoRXUETk8TrUIaRQ ChqqIGSqmg/XlapQIqooiaptkn25vKNuL6xWAOiVO23/ix78ssNqztv897n925Z3cstq80T39DTd+ FuhOp1uA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1suEhA-0000000BmPw-168D; Fri, 27 Sep 2024 17:23:56 +0000 Received: from nyc.source.kernel.org ([2604:1380:45d1:ec00::3]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1suEfy-0000000BmK7-2u9H for linux-arm-kernel@lists.infradead.org; Fri, 27 Sep 2024 17:22:44 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 25A91A442BA; Fri, 27 Sep 2024 17:22:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CB238C4CEC4; Fri, 27 Sep 2024 17:22:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1727457760; bh=eMHXdkUTvmKwfPAOVsxS9P3qJhe5YNo1bGQWqw0OTHw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=P8DIHYElpBX4NJ/gNP4RaH7ZaUDyVIekhIAxtanF9XwT5t/OIBKICJK4muP17vWld 5DndedPODgXj0S0LRNWBwUBTEfQSUKaLJk8MDL3GnL1dGUEWuzi7vDLVSC9jm6GHur kMG6LIkOlaqxWGVO6N7Gzit58mXLldVd/7y6rvQmDBsODxRtZeR6G3b+hEDv+tjPOr XuIV16CMAwAEHimGr2YRIz9pnnoejjNM5WS1evR6hxeVqtBfYQPGYlz2Ll9NVkGeWW hqnILsjHGuzwYII6fvvTyAaAn4z7mqSK/V91+tfl1YoZQVRvEhvKW6bQZHHbjSHDIk 7eDywnMn/CL7A== Date: Fri, 27 Sep 2024 10:22:37 -0700 From: Namhyung Kim To: Ian Rogers Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Adrian Hunter , Kan Liang , John Garry , Will Deacon , James Clark , Mike Leach , Leo Yan , Ravi Bangoria , Weilin Wang , Jing Zhang , Xu Yang , Sandipan Das , Benjamin Gray , Athira Jajeev , Howard Chu , Dominique Martinet , Yang Jihong , Colin Ian King , Veronika Molnarova , "Dr. David Alan Gilbert" , Oliver Upton , Changbin Du , Ze Gao , Andi Kleen , =?utf-8?Q?Cl=C3=A9ment?= Le Goffic , Sun Haiyong , Junhao He , Tiezhu Yang , Yicong Yang , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v2 00/13] Tool and hwmon PMUs Message-ID: References: <20240912190341.919229-1-irogers@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240927_102243_144256_F9E2EED2 X-CRM114-Status: GOOD ( 25.34 ) 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 Thu, Sep 26, 2024 at 12:47:26PM -0700, Ian Rogers wrote: > On Fri, Sep 13, 2024 at 7:34 AM Ian Rogers wrote: > > > > On Thu, Sep 12, 2024 at 3:50 PM Namhyung Kim wrote: > > > > > > On Thu, Sep 12, 2024 at 12:03:27PM -0700, Ian Rogers wrote: > > > > Rather than have fake and tool PMUs being special flags in an evsel, > > > > create special PMUs. This allows, for example, duration_time to also > > > > be tool/duration_time/. Once adding events to the tools PMU is just > > > > adding to an array, add events for nearly all the expr literals like > > > > num_cpus_online. Rather than create custom logic for finding and > > > > describing the tool events use json and add a notion of common json > > > > for the tool events. > > > > > > > > Following the convention of the tool PMU, create a hwmon PMU that > > > > exposes hwmon data for reading. For example, the following shows > > > > reading the CPU temperature and 2 fan speeds alongside the uncore > > > > frequency: > > > > ``` > > > > $ perf stat -e temp_cpu,fan1,hwmon_thinkpad/fan2/,tool/num_cpus_online/ -M UNCORE_FREQ -I 1000 > > > > 1.001153138 52.00 'C temp_cpu > > > > 1.001153138 2,588 rpm fan1 > > > > 1.001153138 2,482 rpm hwmon_thinkpad/fan2/ > > > > 1.001153138 8 tool/num_cpus_online/ > > > > 1.001153138 1,077,101,397 UNC_CLOCK.SOCKET # 1.08 UNCORE_FREQ > > > > 1.001153138 1,012,773,595 duration_time > > > > ... > > > > ``` > > > > > > > > Additional data on the hwmon events is in perf list: > > > > ``` > > > > $ perf list > > > > ... > > > > hwmon: > > > > ... > > > > temp_core_0 OR temp2 > > > > [Temperature in unit coretemp named Core 0. crit=100'C,max=100'C crit_alarm=0'C. Unit: > > > > hwmon_coretemp] > > > > ... > > > > ``` > > > > > > > > v2: Address Namhyung's review feedback. Rebase dropping 4 patches > > > > applied by Arnaldo, fix build breakage reported by Arnaldo. > > > > > > > > Ian Rogers (13): > > > > perf pmu: Simplify an asprintf error message > > > > perf pmu: Allow hardcoded terms to be applied to attributes > > > > perf parse-events: Expose/rename config_term_name > > > > perf tool_pmu: Factor tool events into their own PMU > > > > perf tool_pmu: Rename enum perf_tool_event to tool_pmu_event > > > > perf tool_pmu: Rename perf_tool_event__* to tool_pmu__* > > > > perf tool_pmu: Move expr literals to tool_pmu > > > > perf jevents: Add tool event json under a common architecture > > > > perf tool_pmu: Switch to standard pmu functions and json descriptions > > > > perf tests: Add tool PMU test > > > > perf hwmon_pmu: Add a tool PMU exposing events from hwmon in sysfs > > > > perf test: Add hwmon "PMU" test > > > > perf docs: Document tool and hwmon events > > > > > > For patch 1-10, > > > > > > Acked-by: Namhyung Kim > > I thought the plan was for 1 to 10 to be in v6.12 and the remaining 3 > to be in perf-tools-next/v6.13. I'm not seeing any of the series in > perf-tools so should everything be going in perf-tools-next? Ok, I'll pick up the tools_pmu changes first. And I think it'd be much easier for me if you break the hwmon change like with basic PMU enabling and unit/alias support. Thanks, Namhyung