Received: by 2002:ab2:69cc:0:b0:1fd:c486:4f03 with SMTP id n12csp486909lqp; Tue, 11 Jun 2024 09:59:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUPp/ueYrJ17pLvT44Ci605rQuW78GzCy3yshkuiedhyTCp5yxBi94IxC7cGWNMG2egwW1lxUBaICwikwxpArzLmO0YALq9bZCa6JurgQ== X-Google-Smtp-Source: AGHT+IEe5tuolCNehLa1otwdHxWmqjYCOgzDuvfQq94NaXjsfP7TNaKUchI09rAEveZaXmr5L/ak X-Received: by 2002:a17:902:cec3:b0:1f3:2d51:17a with SMTP id d9443c01a7336-1f6f2e5b85bmr115586295ad.18.1718125189772; Tue, 11 Jun 2024 09:59:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718125189; cv=pass; d=google.com; s=arc-20160816; b=nSC2pAH5GtNF3oShzQIO0EO8fD84m36z2GrGsLOXLQjmDUCvUmQueggnc8nGGhPoP6 ti2Eu22YXME2QS/Fa9qWdRiyTBtoBU8yjI5UATIF6oWPCp6HT4gkg7kYSJae1BFyV0Wi s2q/rgJsEzv5gENN1oKboAr7HtQSChr0/nDkx1JL80cuhAL0Dy4EqB1W2liUohMHZEW4 jm22WgEJdnfccJF63q7rEnVQxZKb8IJ5ntHJ1OIY4jmxzkCg5rHk4/RMqjOr9eqQyRHN 9PdJY8NSpgrMBlOQLgKiMcO9vmZSL+hQHtdymeuVAg0oVcp5gORbfl5yA0fik4OgwBfS n+hQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence; bh=gmMezwrC5bvtXnkcOWEuYA4Z8ryRN9EHWxOexMV7RXM=; fh=gux3LUh5deVtTXlo9iJO+maudb056leNLBKUZMMQUIE=; b=PJxe/tMOI9wi15RxIoiPb39Vu7zajqgm4OJdKIWdPfx7jcVmyOU92QSlxwN9nn/j2s kRgIgsK4kS0o1WzjwWxsXhnr10+iqDbmzSVH35I6NU7YhHhUWhp3FhMKmLqWtPNiAIvF bL51IjCQFgKbcShVVeIGk+orNM7r18JZ8k3GNXK5GZAE1vez4yRWSlno4+3URD0FOpuR BUotP+0kCI9yFpPgzqiMCppygHbCHnSJcUVULjwxf8+LQx/c+hSb4CXSp3S28s/DeoNt NzmjQRDelcYQkLiE7NyLTNcNHcxsN0DJdsc8DfqwmFw0fs1MFcILpY3DKMSyiXsdsffZ jTbQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-210274-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210274-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d9443c01a7336-1f74296cbcesi3973825ad.252.2024.06.11.09.59.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 09:59:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-210274-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-210274-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210274-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 80EC4B23D3A for ; Tue, 11 Jun 2024 16:52:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9601C46444; Tue, 11 Jun 2024 16:50:12 +0000 (UTC) Received: from mail-vk1-f170.google.com (mail-vk1-f170.google.com [209.85.221.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 80D2D80BEE; Tue, 11 Jun 2024 16:50:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718124612; cv=none; b=iGeOsMEyCVOedcfSQPTg2FdrKG0fbIAJjd4bSuaXLNvziQIw36+TpHbnzSDTVohpnEPzyPeRXCkru1pMAJo0cSIYzh+GQIDedhqkNRMxuePdxB9LHstMsclrhCCTZZIXMU/gkQu9BzxX1nlqfyeiGRh5aHJ2qFugsmIjnoNLoV0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718124612; c=relaxed/simple; bh=nXC05/2DJAwYBoUHyY+xX1rLV/tpXFAkZs1z94miDWM=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=TzTgVNMk+m2WPuD4k6/AOJeITWUwEYgQFa0i+ZfA+hL9ewTpUwadskoCzfLpfmACt+kyvUas9L0A3CMEaBKKt5Bx48+iUGczpIwdmOpLvYYlshRIl11etdB4BxVn20f2PVqx8gT0m7wKgS3sXG7Y9Mfii4i2MuVd5F4Z9Cl9Q1g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.221.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-vk1-f170.google.com with SMTP id 71dfb90a1353d-4ecf11aa0d6so395161e0c.3; Tue, 11 Jun 2024 09:50:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718124609; x=1718729409; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gmMezwrC5bvtXnkcOWEuYA4Z8ryRN9EHWxOexMV7RXM=; b=KYLpHhwu+r3Wvfztqqap3z+000InoHM79ySb1EhgvbxntQVadJ6+BUOy72oUxuCbP4 VtswoDTqKGQasWSHUNJeybEBYqo5HERhu5Z+Kho7cXFPDz7MzeMhP88WKu54T3bsxR9T BGPA69FUbxFmR95D6U3StN/w94Xyo9KIJDZD9vRbhtBONA/85VyQjQcstQVtvrZn0EKN PHo1jNu2vKba9rw4qJRuUOOJPJA2QwmGjh4i76XZ5YIYTpyf3D4QXvLB+Mh7IujmkQYr NhCeGReoQIADm5ZSW6vqVyjiBQ9wFMtSd3KGu5r2InNJZ2W6u6BklLZrUjBGd0hiWGDa a6UQ== X-Forwarded-Encrypted: i=1; AJvYcCXBn1VlA7lbVmTHfgjjtpY+1Oa2fOp/y0GF4A5N4AzLEL7q87/2ozXiaf+RFuWRVoZjfcXdeYZcTBm6eFoFPIVe+6OVxcu7djyyJlOL9/oBAd16kXBW7b+fI2Z3JmlFQVko13xKN+9yIMWmT1B5ww== X-Gm-Message-State: AOJu0YwmEPwYtKn5ZVZG0iUEGHL8xTVSjSS7STKszWhD7zQsrWS/mR0O D13N1CNWOJabZKsaOCkLbHV/NBoERLtmXfEGPm0t5eevcMy51gS6v0aGJjNL50hUDo6ZFB9DD3q CIRT7HPeIZ4625/ycH4Lq3RVwiwA= X-Received: by 2002:ac5:c9a4:0:b0:4d4:2fbc:e61f with SMTP id 71dfb90a1353d-4eb562c2a7fmr10022119e0c.14.1718124609228; Tue, 11 Jun 2024 09:50:09 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240611052331.85715-1-weilin.wang@intel.com> <20240611052331.85715-7-weilin.wang@intel.com> In-Reply-To: <20240611052331.85715-7-weilin.wang@intel.com> From: Namhyung Kim Date: Tue, 11 Jun 2024 09:49:57 -0700 Message-ID: Subject: Re: [RFC PATCH v12 6/8] perf stat: Add command line option for enabling tpebs recording To: weilin.wang@intel.com Cc: Ian Rogers , Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Alexander Shishkin , Jiri Olsa , Adrian Hunter , Kan Liang , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Perry Taylor , Samantha Alt , Caleb Biggers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello, On Mon, Jun 10, 2024 at 10:24=E2=80=AFPM wrote: > > From: Weilin Wang > > With this command line option, tpebs recording is turned off in perf stat= on > default. It will only be turned on when this option is given in perf stat > command. > > Exampe with --enable-tpebs-recording: > > perf stat -M tma_dtlb_store -a --enable-tpebs-recording sleep 1 > > [ perf record: Woken up 1 times to write data ] > [ perf record: Captured and wrote 0.000 MB - ] > > Performance counter stats for 'system wide': > > 181,047,168 cpu_core/TOPDOWN.SLOTS/ # 0.6 % tm= a_dtlb_store > 3,195,608 cpu_core/topdown-retiring/ > 40,156,649 cpu_core/topdown-mem-bound/ > 3,550,925 cpu_core/topdown-bad-spec/ > 117,571,818 cpu_core/topdown-fe-bound/ > 57,118,087 cpu_core/topdown-be-bound/ > 69,179 cpu_core/EXE_ACTIVITY.BOUND_ON_STORES/ > 4,582 cpu_core/MEM_INST_RETIRED.STLB_HIT_STORES/ > 30,183,104 cpu_core/CPU_CLK_UNHALTED.DISTRIBUTED/ > 30,556,790 cpu_core/CPU_CLK_UNHALTED.THREAD/ > 168,486 cpu_core/DTLB_STORE_MISSES.WALK_ACTIVE/ > 0 MEM_INST_RETIRED.STLB_HIT_STORES:R Here I guess we can expect a non-zero value, right? > > 1.003105924 seconds time elapsed > > Exampe without --enable-tpebs-recording: > > perf stat -M tma_dtlb_store -a sleep 1 > > Performance counter stats for 'system wide': > > 181,047,168 cpu_core/TOPDOWN.SLOTS/ # 0.6 % tm= a_dtlb_store > 3,195,608 cpu_core/topdown-retiring/ > 40,156,649 cpu_core/topdown-mem-bound/ > 3,550,925 cpu_core/topdown-bad-spec/ > 117,571,818 cpu_core/topdown-fe-bound/ > 57,118,087 cpu_core/topdown-be-bound/ > 69,179 cpu_core/EXE_ACTIVITY.BOUND_ON_STORES/ > 4,582 cpu_core/MEM_INST_RETIRED.STLB_HIT_STORES/ > 30,183,104 cpu_core/CPU_CLK_UNHALTED.DISTRIBUTED/ > 30,556,790 cpu_core/CPU_CLK_UNHALTED.THREAD/ > 168,486 cpu_core/DTLB_STORE_MISSES.WALK_ACTIVE/ > 0 MEM_INST_RETIRED.STLB_HIT_STORES:R > > 1.003105924 seconds time elapsed > > Signed-off-by: Weilin Wang > --- > tools/perf/builtin-stat.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c > index 14be132f7b6f..055139e44763 100644 > --- a/tools/perf/builtin-stat.c > +++ b/tools/perf/builtin-stat.c > @@ -1235,6 +1235,8 @@ static struct option stat_options[] =3D { What's the base of your patchset? I think we moved this to cmd_stat(). Please make sure to rebase on the perf-tools-next. > "disable adding events for the metric threshold ca= lculation"), > OPT_BOOLEAN(0, "topdown", &topdown_run, > "measure top-down statistics"), > + OPT_BOOLEAN(0, "enable-tpebs-recording", &tpebs_recording, > + "enable recording for tpebs when retire_latency r= equired"), Please update the documentation (man page) for this option. Also I'm afraid it'd fail to build on non-x86 because tpebes_recording is defined in intel-tpebs.c. Thanks, Namhyung > OPT_UINTEGER(0, "td-level", &stat_config.topdown_level, > "Set the metrics level for the top-down statistic= s (0: max level)"), > OPT_BOOLEAN(0, "smi-cost", &smi_cost, > -- > 2.43.0 >