Received: by 2002:ab2:69cc:0:b0:1fd:c486:4f03 with SMTP id n12csp146624lqp; Mon, 10 Jun 2024 23:03:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV2kQcy2eOLKpqm7QFjoTAcYJ3DvzQ7YUZqwOyuRTeQuhly5+OqdjuQt0rHrawkwggT9/3sflMfY+EWzXfxGDH9aJhbKjIjtGKLt0Bj2Q== X-Google-Smtp-Source: AGHT+IGKYQ7J0eXec79J7OqORr620tJEzU/Ef3DymvKXOj+HRDAfah4QJWx3NOF7f0ck5mPfFtCt X-Received: by 2002:a05:6a00:1254:b0:705:ad69:e02f with SMTP id d2e1a72fcca58-705ad69e3d9mr591631b3a.25.1718085837895; Mon, 10 Jun 2024 23:03:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718085837; cv=pass; d=google.com; s=arc-20160816; b=KTm0Op1/Lgav6v66jIL5uxoT27EBXl0znmONuIpR7XgxxFfyf64e6cVRlDiiYnPdxt LrE9DRiT8r3/lmXytT5yKkamXfQivqXYRJ6nW2OwLopENVn1DKnchxmY9Y62SIRzm9kN Ps+ktYt+Lf960Xxl/QP2NRH8F6/d4EyuwB3jIBNRORtDV2Xkmem8t9TL/Cd5MW7H3zC/ v5i+vYKL5bTqNg5soBbUbrFavftrFyocaA6skoOuWKHAeVjB+cME0LAqDZivY4b3qDCI P+jxuTvp/Qt0JdvTgL5jxn3AbMOREdZdxXFoHKfSN4JSJkfJ2EmiopXQgy7hzfjlT169 tHBg== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Zv4nOopBQnj+4dv9arjpB6Uk2pmJnRH6XCt8g8FA3zU=; fh=7D8bWqELNqJM6KF7zbibUOya8038rGAdDMFXsJMRu8c=; b=PF42P3oHBoUOPeNgvUxD1rkciirOUZP9bjU8XfmnIHQMOSZaSExPivmqmPe9kV2Qqp Tw9Ucr/jw8+PQNXGXpIMNvwIe6n+dVbWZ5Npd413yByIGbBzQ9VcwTAU51hEHkfHRcpI Qqu/fRUMGhr7HVykdU/npca9P7WBcFzgrdscJVAsc+3lImXl5MLbSKRtn5U3tqMDepXB veuiVPZZVh2ljOatdiPTP8+2XRYhfUIQKPlGb4B4+8d06jxUaY8Yy1rcadugFc4BIfXt xJ0fAT2m6HCC0uKM2sfryL7i27VO/bM9l/jJ+zh+iuxcnI9pVbknxkmnIHctGQfq6QiE UdsQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="B8mYH/vi"; 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-209276-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209276-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 41be03b00d2f7-6ea6f2c4877si4132737a12.111.2024.06.10.23.03.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 23:03:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-209276-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; dkim=pass header.i=@intel.com header.s=Intel header.b="B8mYH/vi"; 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-209276-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209276-linux.lists.archive=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 0F5FAB238F3 for ; Tue, 11 Jun 2024 05:32:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7B8BF17106C; Tue, 11 Jun 2024 05:24:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="B8mYH/vi" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (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 E8948172BDC; Tue, 11 Jun 2024 05:24:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.17 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718083450; cv=none; b=k9U02idBte1p60XgOjtTEheaQySOEZ3GPgjTHSV+NlmGlnB53vvul6Lc/Yjp1Vs4T58BD+28Ilz7rv/RcSZqREMNPJ/5PVTOyek5SU1+ArKgSyunBb0U564SUvc2z6jcdZEF5z63s+zmvsxRsr1xFVtFKmccpnci9ACpaJQ482c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718083450; c=relaxed/simple; bh=HRn/4DVNp/OjRLwESom8GPhdl0qYzIfarqPR4+g46dg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jabYntTzK9M48cT/Sg1sI7Vus1+S2902QaiXANgcXccf0/CLRn07GC6+DjkBVOh+dBx4pAqWS5fesRJUvLj7Jxu8fl2XmAdHplCHOhbxV0SUzFXBT5Gpd1lklh6lxwxsHbfvwCuGJBHv7PlkLszsJ3aieIFbJIlCw4nsMddLEOg= 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=B8mYH/vi; arc=none smtp.client-ip=192.198.163.17 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=1718083449; x=1749619449; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=HRn/4DVNp/OjRLwESom8GPhdl0qYzIfarqPR4+g46dg=; b=B8mYH/vi9MXdPA/h3/ntN68er/TVZFah+LEG8R7gS6SAYfEJ+lZGtRmc Gi69uveq7QQHBQEk5a6HJD78IJM4o6yYwTAqdLRHFK3xm/Np2tBBB+04V UapJOIaonPnQE9HJKlU6roItTb5H43cPTtAHtULiu9TnaHgnDGjJjzKzT bI2QGvdGDVcD/A8G9Nvk+d7Q969LoEWFVvYLyv50qNkhqQsjzcfX8VofL eYtF0FTA/yK1VvHKR5/XH76mbpLB61KVkZhvFzBG+fZlOFgNBelSkljhb VsqM0AkkTXq9604htBYrR5nzY2EkbkUITUH4JKzfaVhmrFBpirn3dK9el g==; X-CSE-ConnectionGUID: HUwag/72TW6j+fIjM4zzvw== X-CSE-MsgGUID: 11UZbcvvQsqevc/q+bZt4Q== X-IronPort-AV: E=McAfee;i="6600,9927,11099"; a="14651148" X-IronPort-AV: E=Sophos;i="6.08,229,1712646000"; d="scan'208";a="14651148" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2024 22:24:04 -0700 X-CSE-ConnectionGUID: +LINPzHYSfKBKwrt1wZmvw== X-CSE-MsgGUID: RaGIBUlSRf2mlAQI5rquBQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,229,1712646000"; d="scan'208";a="44441207" Received: from fl31ca102ks0602.deacluster.intel.com (HELO gnr-bkc.deacluster.intel.com) ([10.75.133.163]) by orviesa004.jf.intel.com with ESMTP; 10 Jun 2024 22:24:04 -0700 From: weilin.wang@intel.com To: weilin.wang@intel.com, Namhyung Kim , Ian Rogers , Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Alexander Shishkin , Jiri Olsa , Adrian Hunter , Kan Liang Cc: linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Perry Taylor , Samantha Alt , Caleb Biggers Subject: [RFC PATCH v12 6/8] perf stat: Add command line option for enabling tpebs recording Date: Tue, 11 Jun 2024 01:23:25 -0400 Message-ID: <20240611052331.85715-7-weilin.wang@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240611052331.85715-1-weilin.wang@intel.com> References: <20240611052331.85715-1-weilin.wang@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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[] = { "disable adding events for the metric threshold 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_latency required"), OPT_UINTEGER(0, "td-level", &stat_config.topdown_level, "Set the metrics level for the top-down statistics (0: max level)"), OPT_BOOLEAN(0, "smi-cost", &smi_cost, -- 2.43.0