From patchwork Thu Jun 8 23:23:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Namhyung Kim X-Patchwork-Id: 10504 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp603472vqr; Thu, 8 Jun 2023 16:29:47 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ50xV0kVUERWea+GfKtI2MMUaN/0liIC2j1+8b2P398d1OTEFdtwG7PGlL0mWWL1mzE9SX1 X-Received: by 2002:a17:90a:ba01:b0:256:b190:2733 with SMTP id s1-20020a17090aba0100b00256b1902733mr5339211pjr.33.1686266987755; Thu, 08 Jun 2023 16:29:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686266987; cv=none; d=google.com; s=arc-20160816; b=rlkH9X6jnm5fluUzta2CgyR2jipdvqUuJcnbJC6nROea2xCTts+Bi/9rpuqLvomvLr 0taF9a2uyusmKJwm1NJCev6fVA4eICeTHuJgUHikPMAXVONQ8yuFsBunHusZamV7Cnc0 iKrxasRBj8djj3ncFjvRslEZwB+mTyn3OInh2aA7ViqV++CuRuEW9+6dPdPuR7lSuLcp fifzBElE3/wsPhNjhZfBw+nXm+WtWj6DrrnOkM52RhqrK1TQ8YzzK59WGh53Ut+AExqG JIcXoRcmUjZKHOwbmExuncG/yFN+K2aEi7uCup9FhnB3ytYJYULl9HY8M5gXEIVjkveb hVSQ== 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:sender:dkim-signature; bh=42lC7HZoHlaRfJs1qoI4qNHKms+PSYJbqmg+6blMOYY=; b=K31bw1FTp+RapQ/dY+vRxu6KzDXTKi+LlOnCrL1QU5H5U0HQJttzZ3jE+I+cHCj6zw K6IjXIV6YK+XjmcT2ZC9e5SJ/Lqw/KKiormGNO084p7leIEWn+6GNUeTx4tU/rMDYcz+ cwZVCs1TgbZCaLNPofO0DSlgua3G/AJPZm0jkU4UTI10/fb5OEw88lTBLyi7L+6qEo/Q RlEZUSsY+8pMhWf10SgHPa9bVEYvk4wlASaiYYDzoe5T5Zm+6gNexn4sfYzbPmjkdHxO ohD9zl9VxP73MhlCs9yDS5s241H51Jvunc/NC32OQYPufdJ288LEfBC9qMuDizuduQQ0 2bYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=DNo8whDs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c25-20020a637259000000b0054294720d56si1752665pgn.387.2023.06.08.16.29.33; Thu, 08 Jun 2023 16:29:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=DNo8whDs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236744AbjFHXYG (ORCPT + 99 others); Thu, 8 Jun 2023 19:24:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229888AbjFHXYE (ORCPT ); Thu, 8 Jun 2023 19:24:04 -0400 Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91D5330D4; Thu, 8 Jun 2023 16:24:03 -0700 (PDT) Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-65055aa4ed7so958577b3a.3; Thu, 08 Jun 2023 16:24:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686266643; x=1688858643; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:from:to:cc:subject:date:message-id:reply-to; bh=42lC7HZoHlaRfJs1qoI4qNHKms+PSYJbqmg+6blMOYY=; b=DNo8whDsFUiMToVM3Bwqf+kXF3x7FsXdfRsNq/8q4gBi7A7GeWFgkzedfEU9asiDs9 9EeIc84YvhYQKytu3/mNmFK8fxd/aCO8UWAlQdN1FI7SJl3rNwB1a5uzMLKrDHg1gNNy zhPRLRHI7+I8W15YLqNArfi87mAUlari46ZX+SAlgCYtLZ09EVkMgtVE3X3BtpAr41At /QBOCyYuTOewz76ZD7R9ygAmgf75Edq3yKEDMenKPFkhThjoOQ/VUJ3nbkJurjGPJmSH 2oW3rMbuySaa4yaCfwPvq0fFEE68ycE/Zwcs7mO5v4I5klx10tbFBIGdQvcc/LHqKeR6 FYvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686266643; x=1688858643; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=42lC7HZoHlaRfJs1qoI4qNHKms+PSYJbqmg+6blMOYY=; b=VnHVMDgm5HwS1FV4KE9bOiVW0F1JrNNSk0QcCytmifJN9Ufd1EHK5YSC9MyK1CCyn+ tC9uHSN16zqU1RFEy4spmZU9ymiSfLmvUPtPe3EP/5RlW38G9HVxwIZ5tTnBl2/Bd4i0 0LTby/+vQL7Or17dBacRf001oPd+bDkg4RGQeVPUYPKNhbrbOeArRfSQOtcVhz3yqMB/ s+wQi8swK6ez3v00pYZ0b9gErWBxv+wabPT/zk8Enmkgs+WWya8rDHbbhiuuk/2DVl+e ia2RgNWN2us/Bl7uceDe+mRTZiG2ky0iOx6diDK+h1zm9C5D1N+A117gPZ45BZlCzqUE 7jLQ== X-Gm-Message-State: AC+VfDw/1lAIwlMWtudfZEJ3MXsna/TcUdtV+9zRNaRWBhoF7JY4gvGx nEUVlATvH5ZnXwraxzvUD3M= X-Received: by 2002:a17:902:efcc:b0:1b3:7de7:f852 with SMTP id ja12-20020a170902efcc00b001b37de7f852mr977043plb.55.1686266642605; Thu, 08 Jun 2023 16:24:02 -0700 (PDT) Received: from bangji.hsd1.ca.comcast.net ([2601:647:6700:7f00:c14c:6e39:cb7d:ad66]) by smtp.gmail.com with ESMTPSA id e18-20020a656792000000b0053f1d55676fsm1618203pgr.2.2023.06.08.16.24.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jun 2023 16:24:02 -0700 (PDT) Sender: Namhyung Kim From: Namhyung Kim To: Arnaldo Carvalho de Melo , Jiri Olsa Cc: Ian Rogers , Adrian Hunter , Peter Zijlstra , Ingo Molnar , LKML , linux-perf-users@vger.kernel.org, Stephane Eranian Subject: [PATCH 0/3] perf list: Improve libpfm4 event support Date: Thu, 8 Jun 2023 16:23:57 -0700 Message-ID: <20230608232400.3056312-1-namhyung@kernel.org> X-Mailer: git-send-email 2.41.0.162.gfafddb0af9-goog MIME-Version: 1.0 X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768179093130212776?= X-GMAIL-MSGID: =?utf-8?q?1768179093130212776?= Hello, Ian and I found that some of libpfm4 events don't work well and it makes confusing that perf list shows those unsupported events too. Let's check if the event is supported like other events and skip if it's not. Also add a new test for it. On my laptop, it runs ok like below: $ ./perf test -v 102 102: perf all libpfm4 events test : --- start --- test child forked, pid 3039688 Testing ix86arch::UNHALTED_CORE_CYCLES Testing ix86arch::INSTRUCTION_RETIRED Testing ix86arch::UNHALTED_REFERENCE_CYCLES Testing ix86arch::LLC_REFERENCES Testing ix86arch::LLC_MISSES Testing ix86arch::BRANCH_INSTRUCTIONS_RETIRED Testing ix86arch::MISPREDICTED_BRANCH_RETIRED Testing perf_raw::r0000 Testing icl::UNHALTED_CORE_CYCLES Testing icl::UNHALTED_REFERENCE_CYCLES Testing icl::INSTRUCTION_RETIRED Testing INSTRUCTION_RETIRED Testing icl::SQ_MISC Testing icl::SQ_MISC:SQ_FULL ... Testing icl::OCR:DEMAND_DATA_RD_L3_HIT_ANY Testing icl::OCR:DEMAND_DATA_RD_L3_HIT_SNOOP_HITM Testing icl::OCR:DEMAND_DATA_RD_L3_HIT_SNOOP_HIT_NO_FWD Testing icl::OCR:DEMAND_DATA_RD_L3_HIT_SNOOP_MISS Testing icl::OCR:DEMAND_DATA_RD_L3_HIT_SNOOP_NOT_NEEDED test child finished with 0 ---- end ---- perf all libpfm4 events test: Ok Thanks, Namhyung Ian Rogers (2): perf list: Check arguments to show libpfm4 events perf test: Add test of libpfm4 events Namhyung Kim (1): perf list: Check if libpfm4 event is supported tools/perf/builtin-list.c | 12 +++++- tools/perf/tests/shell/stat_all_pfm.sh | 51 ++++++++++++++++++++++ tools/perf/util/pfm.c | 58 ++++++++++++++++++++++---- 3 files changed, 112 insertions(+), 9 deletions(-) create mode 100755 tools/perf/tests/shell/stat_all_pfm.sh base-commit: 634c694de4cb2d050dc312ea43e0371d84c585a5