Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp332998pxb; Wed, 22 Sep 2021 03:19:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzeDvdKWdVwBrYULoh+uAm2kHnRsFsdX4jBibt/LCuuM2lcx5ku3f86pjzJ38MqeMYcdONY X-Received: by 2002:a6b:fe05:: with SMTP id x5mr3623479ioh.26.1632305949054; Wed, 22 Sep 2021 03:19:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632305949; cv=none; d=google.com; s=arc-20160816; b=CAM6nrPcpM47m2xEXsrODWz9QbubVftxo9/r2h1JO2qXoAkm5WxZnpDnh5GeLUzcIC 2iRLDnBPsUO8H4jiLQNQUM0r/wUwtXxVND15zHLpReeMN1YkwlNdnA3BFEK49HVINWoT iLF3yn5LM8romdyq10wLL6ed9QJOpJKtDYybIhzNTFj/wffrdaAkflkQWblz3SnfHcKA AHjU/8AEQ4depXEnhHtfrzBsCd595e6pm9xbdMnoKz/1Jw/FzOEjnAuV0R5kUAHdrAn1 iE4Wo24HHmm5P1WYvnbM+qjQ2Uvf7Tmm1eyI9QNO4XIwd4pB7zl0vR+bbpO217/djZjA 8OGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:ironport-sdr; bh=Jm7PrE8W8MAlMSjrrpWBitQp9SVQW+X4Sq3mLqCI4qA=; b=zdnazJW03NAr4E3OHpJtbogIX1Z41R9dwGdG12+fknpTblL0US7IaNeeBpNDDed56T 5dUdKmR3S+5w6v17P6TlAOgRpS9ikn9yjR2U06v6/gpb9LesdrwlW/nxRQ8Cmu07dWUe /oDUzsy2bG5u7R6rXwZVtVGllawyT5d3Tc8kuHpX/YL3mlJCno1KtF0xqFMR2dKsfkAT C9GA+n3708FcrOYxDTZampupDoABlfiV13RNmBOi7rMOCmssudbuvx4nDgBC38HL+nJS CRJA8c/wk0pWsZ6MHYP/u2HKJgS02UBQ9U3Yutum+AbW49GjPDRafRnLtXSrnSaruy1m dvdw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=fujitsu.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z7si2177352ils.59.2021.09.22.03.18.57; Wed, 22 Sep 2021 03:19:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=fujitsu.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234674AbhIVKSR (ORCPT + 99 others); Wed, 22 Sep 2021 06:18:17 -0400 Received: from esa3.hc1455-7.c3s2.iphmx.com ([207.54.90.49]:45530 "EHLO esa3.hc1455-7.c3s2.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234414AbhIVKSK (ORCPT ); Wed, 22 Sep 2021 06:18:10 -0400 IronPort-SDR: koZWrufzIyTEu2N0YKCBbWa0PnzM0xgihR2D9s+x5sC347COGEka9Q/00Gd+XZERvo1JMNqqWn T4nB2uE1HpTo6J4edb1NH3XHb3ExoSYuzbXRnRnHUIly3iJIZcxrUe2sHJdtB20Gspt9cn5C/K 4ZCsA8uZVvsSgdslHWNq8PZvkiY+cIwJqgDYuDHhE1SbSVFZ2eerIRJvhKQv8fIexbt31gMqZu 1K9PY8Ih4yFYl5v3Wxs/Fhh8AkANWAGi0XixUFJUE2C8e36YbX9kIWIO1tODHTsaNF7x7yXXrQ d82+R7YYRf69IhoUcnRWLeWa X-IronPort-AV: E=McAfee;i="6200,9189,10114"; a="46127437" X-IronPort-AV: E=Sophos;i="5.85,313,1624287600"; d="scan'208";a="46127437" Received: from unknown (HELO oym-r3.gw.nic.fujitsu.com) ([210.162.30.91]) by esa3.hc1455-7.c3s2.iphmx.com with ESMTP; 22 Sep 2021 19:16:33 +0900 Received: from oym-m4.gw.nic.fujitsu.com (oym-nat-oym-m4.gw.nic.fujitsu.com [192.168.87.61]) by oym-r3.gw.nic.fujitsu.com (Postfix) with ESMTP id 8EA83EBA43; Wed, 22 Sep 2021 19:16:31 +0900 (JST) Received: from yto-om2.fujitsu.com (yto-om2.o.css.fujitsu.com [10.128.89.163]) by oym-m4.gw.nic.fujitsu.com (Postfix) with ESMTP id B75802161D4; Wed, 22 Sep 2021 19:16:30 +0900 (JST) Received: from pumpkin.openstacklocal (pumpkin.fct.css.fujitsu.com [10.130.70.189]) by yto-om2.fujitsu.com (Postfix) with ESMTP id 92E1E400C0072; Wed, 22 Sep 2021 19:16:30 +0900 (JST) From: Shunsuke Nakamura To: peterz@infradead.org, mingo@redhat.com, acme@kernel.org, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, jolsa@redhat.com, namhyung@kernel.org Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Subject: [PATCH v2 0/2] libperf: Add support for scaling counters obtained from the read() system call during multiplexing Date: Wed, 22 Sep 2021 19:16:25 +0900 Message-Id: <20210922101627.3396398-1-nakamura.shun@fujitsu.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch series supports counter scaling when perf_evsel__read() obtains a counter using the read() system call during multiplexing. The first patch adds scaling of counters obtained from the read() system call during multiplexing. The second patch adds a test for the first patch. This patch is based on Vince's rdpmc_multiplexing.c [1] --- Changes in v2: - Fix not to divide by zero when counter scaling - Add test to verify that no division by zero occurs [1] https://github.com/deater/perf_event_tests/blob/master/tests/rdpmc/rdpmc_multiplexing.c nakamura shunsuke (2): libperf: Add processing to scale the counters obtained during the read() system call when multiplexing libperf tests: Add test_stat_multiplexing test tools/lib/perf/evsel.c | 6 + tools/lib/perf/tests/test-evlist.c | 183 +++++++++++++++++++++++++++++ 2 files changed, 189 insertions(+) -- 2.27.0