Received: by 2002:ab2:69cc:0:b0:1fd:c486:4f03 with SMTP id n12csp551304lqp; Tue, 11 Jun 2024 12:00:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV5HToCgQvF5YvCeaJ5YAYeCqf5Ka2nzfXnjrGNcIgDk36/kuXwaRFRmCLLKeZvisWXlTT8tEKVnWocz6QB1AIr0eS8pEvCD9FwAzR7pQ== X-Google-Smtp-Source: AGHT+IHVm/xmFcOCi0D+nXvfKXoI87gFL/37XyBwcayVYmQzCpJCTlpT0xAHPbE/KJWhcR4WPPsU X-Received: by 2002:a17:902:e892:b0:1f7:1550:54be with SMTP id d9443c01a7336-1f715505e38mr70748485ad.37.1718132431623; Tue, 11 Jun 2024 12:00:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718132431; cv=pass; d=google.com; s=arc-20160816; b=MI2gjzCcyFGh4udbtOU8jRgSq12lFiFTdXui5ygt8TTNZV96cnBh2EmAmHi8Bc1DD9 EBG7ynoKGsvucVxGlIqGOWgZg6rpy8RsBHXHqmHmcubJa5wcy6i6ubBAQ/yoCPbIZZmg WkbOJ4d9dvyr/lvPhAajwOfu/fHhn/LsSJnVJjDfLJMvzsH1aZlm0t2UtfU2j4XzGdCr zj2q8cyjCh7sFqkYSqVwIIhx1joKUfVQaphHZDCiHj9o/E+fgWXosFrHyh/0iK7CU+a8 Vl0GSY36JyKCqUInPCNDP6qbKi4UPaHs0m/P7FEtvzgxQcthC1+JurK7ADnqUN9FVVlw SJiA== 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=is/wNlrYWOG5ah0bo7/hYWjp3j6+EGYQ6aiKUz1KB8I=; fh=S9J9KwRpApAGoDDqcxWwZR9xNdwvIT4MXMRu1uI9cKU=; b=SyFoDaQ3YJ0DsvaW65//hlwhXWtGwmnBndnAddetd8lW4XFEBvhTMUCATgJmJwnnSO aY716I2k7g4PAxfX8l3LUEcMAhCpyhzsra8UhYcKxtDqRr9GJQhnxqfGaMyfowP07UWi 843R4gSf81YzYzto4fmdPWM7VqFfiozNpKgpo9e/mUaIH6037TV/fifDOovbOZGnvPYX EsEYJMK7RVRipmNx7KUyhmtLWFD8xBin7cwsa3lBd6yV1gytSvZQ9yah3RoQTZFqhEQW keOiZfM2bJmtSDj25YXxPYCOCCF702zfqJjo/NAA/bFBpwIas6eZRhsiHud4gE7Yv8/M MFcw==; 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-210464-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210464-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. [147.75.48.161]) by mx.google.com with ESMTPS id d9443c01a7336-1f6ef8bcaafsi64730395ad.321.2024.06.11.12.00.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 12:00:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-210464-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-210464-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210464-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 01666B21DB2 for ; Tue, 11 Jun 2024 18:49:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5C0B0770E6; Tue, 11 Jun 2024 18:49:33 +0000 (UTC) Received: from mail-pg1-f179.google.com (mail-pg1-f179.google.com [209.85.215.179]) (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 306157D3EC; Tue, 11 Jun 2024 18:49:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718131772; cv=none; b=FjUg8JS8Ox+d5F1U1CZ3pbm9WBB4J2a0mv9/78chXxpRTGWnGQTfpZCEw5vsn86ukVn9Zfa4DFfLaLxWCYG43Wn4wdyjfZy5/41TtmB88IeOQD2Sf/sNh5K/kQcQjN9Vn8rFAg8RU5QiY5DDcyEXeSUlpp38Z4/1iORbj7r3c3M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718131772; c=relaxed/simple; bh=9AfnrOzuFVouB318icoJVfUNjCv/vLkWwc2/t4eGvuU=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=RhnMVDsrYFTSq/AsA4ANOxIy+6giVzyat0YTvSYgx89YrV50WyfAv7+CFt9p+yD77r+i7VJSTttXRb3nrGQjJg8FAv8ZTYVUCbLkYYvAVhaP7RAFzfaIWbAa0SM6S+QbIQKqLBlbgnzjkaQP2ZdUeAjNOqB+TweBlD+ziSIL68M= 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.215.179 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-pg1-f179.google.com with SMTP id 41be03b00d2f7-6c4926bf9baso4470425a12.2; Tue, 11 Jun 2024 11:49:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718131770; x=1718736570; 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=is/wNlrYWOG5ah0bo7/hYWjp3j6+EGYQ6aiKUz1KB8I=; b=vIZPCa+khtV+WjUjJ9Cga4qyXZAshLPhyr3Z88MtHEB0FGmdQ9Ygk2UiYZCAi4sUCI PwO5LmMR3Mq2AszKT3isWROZqzl+uujkqlgxBN9RMWz4RRWis/v4PQhou8a8X9t9DSS+ kQGn/KBMnZFruDB3snlOa+MjI6rgVW8KwdUqtCbBmzNewznEOqokt3GGR4OkHQ+0oJdn F2hkV0S80hZd/X5NY8QKG90Aa9eacleo/+HE2VxliNiGGFUIOIw8EfrpdR/iCBvDlEnp hCclDVBRBj8yLHS0AALUumi9bkAuCUIkh4RVB7ptoGFD9SVmzm3p39vHawfCSC00SPDp xgZw== X-Forwarded-Encrypted: i=1; AJvYcCXb1Qlq438PVv9nAeNQmTfN/AXLInR/iNPX6zAxuVgRK7GLks0Nma+TAaOTTA5slpiq5mXzdIy6HBAleXdJ+kAeHk0ojFiaOSIQ51fyxPZBrR/xO1y6XIdWqiGbBss8NCpUuikdpIWDiEAFl6nWOw== X-Gm-Message-State: AOJu0YypGahzgokdux2bAZM/wtAD0vDDkvYkZ8GcmuFr1ShJwvkpYZcc GIsrVX7AN9oczZ3xN83WnjELMAiBsBQEe4gMLtsKoWBIxf3sUoqQp14td3tZSzzUEfHnVJCC5rK FUc8XCeYpuVF4gsMOH4HsXBB8/tQ= X-Received: by 2002:a05:6a20:1589:b0:1b8:498e:4e34 with SMTP id adf61e73a8af0-1b8498e4ff1mr4858776637.34.1718131770346; Tue, 11 Jun 2024 11:49:30 -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: From: Namhyung Kim Date: Tue, 11 Jun 2024 11:49:18 -0700 Message-ID: Subject: Re: [RFC PATCH v12 6/8] perf stat: Add command line option for enabling tpebs recording To: "Wang, Weilin" Cc: Ian Rogers , Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Alexander Shishkin , Jiri Olsa , "Hunter, Adrian" , Kan Liang , "linux-perf-users@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Taylor, Perry" , "Alt, Samantha" , "Biggers, Caleb" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Jun 11, 2024 at 10:49=E2=80=AFAM Wang, Weilin wrote: > > > > > -----Original Message----- > > From: Namhyung Kim > > Sent: Tuesday, June 11, 2024 9:50 AM > > To: Wang, Weilin > > Cc: Ian Rogers ; Arnaldo Carvalho de Melo > > ; Peter Zijlstra ; Ingo Molnar > > ; Alexander Shishkin > > ; Jiri Olsa ; Hun= ter, > > Adrian ; Kan Liang = ; > > linux-perf-users@vger.kernel.org; linux-kernel@vger.kernel.org; Taylor,= Perry > > ; Alt, Samantha ; Bigge= rs, > > Caleb > > Subject: Re: [RFC PATCH v12 6/8] perf stat: Add command line option for > > enabling tpebs recording > > > > 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 % > > tma_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? > > Hi Namhyung, > > Do you mean when we have the option, we should expect non-zero value? > During the execution, it's possible that we don't capture any sample on t= his > event. In this case, we would have a zero value. In the future, I think w= e will > give it the default value instead of zero. I mean there's a chance you get non-zero, but it can be zero sometimes, rig= ht? Then I think it's better to choose non-zero in this example otherwise it's = not clear what's the difference of using this option or not when you look at th= e output in this commit message (they are both 0). Thanks, Namhyung > > > > > > > > > 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 % > > tma_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. > > This was rebased on top of Ian's change for the tool event and retire_lat= ency parser > patches. I think that was on tmp.perf-tools.next. I will rebase on perf-t= ools-next. > > > > > > > > "disable adding events for the metric threshol= d calculation"), > > > OPT_BOOLEAN(0, "topdown", &topdown_run, > > > "measure top-down statistics"), > > > + OPT_BOOLEAN(0, "enable-tpebs-recording", &tpebs_recording, > > > + "enable recording for tpebs when retire_laten= cy required"), > > > > 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. > > > > Yes, you are right. I forgot about non-x86. I will update this and also t= he > Documentation. > > Thanks, > Weilin > > > Thanks, > > Namhyung > > > > > > > OPT_UINTEGER(0, "td-level", &stat_config.topdown_level, > > > "Set the metrics level for the top-down stati= stics (0: max level)"), > > > OPT_BOOLEAN(0, "smi-cost", &smi_cost, > > > -- > > > 2.43.0 > > >