From patchwork Fri Feb 9 03:14:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wang, Weilin" X-Patchwork-Id: 20141 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp605882dyd; Thu, 8 Feb 2024 19:27:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IGcYv4bs6e9U84vM6b+Nek0u2G69M87jzbaQvotd5tLPVnCCayK5piH48hkUD17NGUfJqr6 X-Received: by 2002:a17:902:d48e:b0:1d8:ffbe:82d9 with SMTP id c14-20020a170902d48e00b001d8ffbe82d9mr462047plg.14.1707449252123; Thu, 08 Feb 2024 19:27:32 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707449252; cv=pass; d=google.com; s=arc-20160816; b=z7OO/yKMFnB5I2Rn24duLBNFgFzaY0lbBwGTKckxmooRk9UB/dTZhu+60c1gghesGN pOjbZVnUcqj8+nyRiQXr5nPykIAuPqpRUZbHxj4+XRKq4WoZL4NPS0W9gP/8CWxxSApP Iy3T2l2OsJqOnUzkzsDBwPbiUFT3g1XGTRDE/oTZnndeS3r0KwWsd6M8bSlRbc2oPuI/ IscjELoedf7Y2JTgRSOcG1t+imeaOG9qh7jSxAClZjgDFSrfgrKQfG8csSVJcrDy1Vpl rJtTHR0UhSAbnp4vmRbwhH/h6tOu5QVL48ktC38KLk3BkGRNae3j4gFezF10aTYq8OS9 Vp7A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=UNbPxEzA+J38ki7erntLCJtinmSk0owgwrGxK4jpl+E=; fh=ro0cQ02IDla4qCD2rrwDoSStN5ew6BlG4jaFvtP8UXw=; b=rarYMRdcMh7tne9oq+WiisSQ5qKoVP5QhCIJK/3zet1DzW8x0I9oMDRhFTZHVujn7S 5GVqz/4Vd1z+yzZ5sCEeLUIejrBXp7/D7PUUykfXmz5j8XV9RxZ1jTr1V6rFnds/csIG s4iOjC5tKiw9xJ+Q1VHmKlPYAtQ5zMhqEYL49NMWRhZCHiKT4ADSnV7Xu3m54Nu2LEvz z2dDsuBQmWI8BOy64j1x8kQWwR2pBHm3DWu1o3nOeedf+jg6m/0fJIEpRdz7EknZV3AL N0e8TrNTNmzSee8qiUoqs7z1Z4DeLo6go5ZjwIodQo+uyGr9scl6zoU5DdJrzoKZ0cwz h9Ww==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=LAPZcWYe; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-58966-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58966-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=2; AJvYcCWKqMs2e3bEy1DPUToDH1tPxy+P9cGbzg7DXhuZYWMZ7xWRjtljJVQo3DJB2wd3KNl+LjF4F+3PjDlyurLqCYtM8T2M3g== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id s7-20020a17090302c700b001d757e49a79si868061plk.471.2024.02.08.19.27.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 19:27:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-58966-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=LAPZcWYe; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-58966-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58966-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id ACB84B27ABD for ; Fri, 9 Feb 2024 03:15:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EEBD06FC6; Fri, 9 Feb 2024 03:14:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="LAPZcWYe" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 361934A28; Fri, 9 Feb 2024 03:14:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707448490; cv=none; b=QERdp1YwJrF+07zJgsx4ayyw2xUSW7pz3WgRFs3MEezSLXvbsrvaU6Tp+1gfzXA/dQkXxcm+hJ3JkvAVkaJyzfgaE2KnYdraW/pwt4aAgdYnS+OpI5IshVCt89N5cc5NlWxN8o/lbpJ4GECI4WZf7JAMuLRWMrmxI94yOAOKKV0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707448490; c=relaxed/simple; bh=/qrAJe4JPth0HrN2viuXOrLNb41b0iCYzbzAL5ueynA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=KLrWrG2NiVKxl7MXQG4/zApIqoRr3LZ5YMVQApgKgKCaem/JGvXpuQUY3sKdRbmLHmMUXP9xpPmQZ/GPQ6PPdwpsKlY3BUvGW406E9/iK1buGFK+x/KzURrukQ48H92jj4+gu+2OM4u3NyYz+pea5d9KBI9T2my/OAkwa0IBMg8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=LAPZcWYe; arc=none smtp.client-ip=192.198.163.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707448488; x=1738984488; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=/qrAJe4JPth0HrN2viuXOrLNb41b0iCYzbzAL5ueynA=; b=LAPZcWYezbSaKBFwIwgT2s8SdYQv6F2jQMjx0OnxcQgdMqgbyJKV0sS+ UuYb9JQprWFJult9yaP6Cg2jZs8xQcc0G+t+tLWcama+yfgdtGRySnnlf 5H5Zp68X65DXm7Sid7PKXI+SKwM49/5M6HHbxh/MSFkEKBKOCfXIidiFR BJ1M5IEqnyadBryt9UUxzAUqtcgBJPGmhVPH+rHWhAhIEKhFKjSGh5bI6 or2zA0g0zgyZtkJ4/MvdVHXXZCQLp1VYqa4ztXYUhsbvp3vd6Yz6NyfnX VEKD5g2RGH907ihwbtyiOePwAFAE6JoFAvSFo6mM+gfcz7lFq2Q+JZGP7 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10978"; a="1257869" X-IronPort-AV: E=Sophos;i="6.05,255,1701158400"; d="scan'208";a="1257869" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2024 19:14:47 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,255,1701158400"; d="scan'208";a="32631398" Received: from b49691a74b80.jf.intel.com ([10.165.54.183]) by orviesa002.jf.intel.com with ESMTP; 08 Feb 2024 19:14:47 -0800 From: weilin.wang@intel.com To: weilin.wang@intel.com, Ian Rogers , Kan Liang , Namhyung Kim , Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Alexander Shishkin , Jiri Olsa , Adrian Hunter Cc: linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Perry Taylor , Samantha Alt , Caleb Biggers , Mark Rutland Subject: [RFC PATCH v4 00/15] Perf stat metric grouping with hardware information Date: Thu, 8 Feb 2024 19:14:26 -0800 Message-ID: <20240209031441.943012-1-weilin.wang@intel.com> X-Mailer: git-send-email 2.42.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790390306866554364 X-GMAIL-MSGID: 1790390306866554364 From: Weilin Wang Changes in v4: - Update bitmap operation functions [Kan, Ian] - Move data struct definitions to metricgroup.c for smaller scope [Ian] - Update variable names and comments for better readbility [Ian] - Exclude JSON files from this patch. A seperate patch set with complete set of JSON files will be submitted soon. v3: https://lore.kernel.org/all/20231212230224.1473300-1-weilin.wang@intel.com/ Weilin Wang (15): perf stat: Add new field in stat_config to enable hardware aware grouping. perf stat: Add basic functions for the hardware aware grouping perf pmu-events: Add functions in jevent.py to parse counter and event info for hardware aware grouping find_bit: add _find_last_and_bit() to support finding the most significant set bit perf stat: Add functions to set counter bitmaps for hardware-grouping method perf stat: Add functions to get counter info perf stat: Add functions to create new group and assign events into groups perf stat: Add build string function and topdown events handling in hardware-grouping perf stat: Add function to handle special events in hardware-grouping perf stat: Add function to combine metrics for hardware-grouping perf stat: Handle taken alone in hardware-grouping perf stat: Handle NMI in hardware-grouping perf stat: Code refactoring in hardware-grouping perf stat: Add tool events support in hardware-grouping perf stat: Add hardware-grouping cmd option to perf stat tools/include/linux/find.h | 18 + tools/lib/find_bit.c | 33 + tools/perf/builtin-stat.c | 7 + tools/perf/pmu-events/jevents.py | 192 +++- tools/perf/pmu-events/pmu-events.h | 35 +- tools/perf/util/metricgroup.c | 1338 +++++++++++++++++++++++++--- tools/perf/util/metricgroup.h | 1 + tools/perf/util/stat.h | 1 + 8 files changed, 1464 insertions(+), 161 deletions(-) --- 2.42.0