Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp467125rdg; Thu, 12 Oct 2023 10:37:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEgLwqqV5/NRH52a/OCxXw+a9hj5gsE6qNZlvc86Gz+Ca+7qcLbW1XbzroBWCdG8CwIoJF5 X-Received: by 2002:a05:6358:7f15:b0:143:786b:3de5 with SMTP id p21-20020a0563587f1500b00143786b3de5mr26722066rwn.9.1697132211374; Thu, 12 Oct 2023 10:36:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697132211; cv=none; d=google.com; s=arc-20160816; b=KS2b6FAcqRLoLiC6/uC9Hcbw9wOkXIyzOLTyW1p2c0UcvorHG8ctgrzrex3fD3kXaL 5VT+/PFdfMBLEPkqK4vqEh+34MNIV3pvJzjj3v8/H4UaxcQoDcAZ+uutCSuNtFy4e4pB Ze7/42xBR3eRxqwbN6cLq13ihPyrq1nQiYt8dIGXxz1xsADUosbJEUGUrGd6+X1uwlD2 b3vY/JzffvWWZ2G7OrdRljoTdItelssvfYsYKLyM6ytQRpcAQgi+9QD//xDHv/U5sMhc 2oR6g2+A/JbVUdGUv/j6mbQ4IKQjLFxqR+AMIU3Z2Hkk6hcqvIlRY9xyQCZXV4zMAwAw Z9gA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=tjj7HqEdfIQsSuFWoJ16OflFkkCnW9hWO7F33PRc4Q0=; fh=vPqM1YOuaBWk9hhozRknKsfvWI8LPdLd5TXAOoWcJ5o=; b=oPZdYYzK0m5tm9SS+XTeAx/BVJzJ/Y5lHQ4uqDya2pf7OGHESI1vmA4pS3eV+u+ILB WQ79uHPNkgw4d8cC8vk/QBpnED0/57dCJJYyApdOor5hwn1KbmqtCuSTovErIBcn8LRI 3A04ZIJfS1c68hBtptCFDUMCcLDL8KGa3fg2aCdgpgMFOo4+PjaqDFVaq/TEuI/cBjBK +xjYkbeFX4fN/TjSVPqt7BVcRJUqMZMAQ9vgqt/KOmQwZXiWvN2X9EpJ7V4tqBcdFmdN EPg+OWkVmdWdFkOf67oErMpXFR9m1TpbDMPdFA1JEinfDJYjrKZFul0zj85gS6ttXSXV bJmA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id t64-20020a638143000000b00564514df64bsi2686292pgd.897.2023.10.12.10.36.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 10:36:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id E60D3822C163; Thu, 12 Oct 2023 10:36:48 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347367AbjJLRga convert rfc822-to-8bit (ORCPT + 99 others); Thu, 12 Oct 2023 13:36:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347407AbjJLRgQ (ORCPT ); Thu, 12 Oct 2023 13:36:16 -0400 Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB81519B; Thu, 12 Oct 2023 10:23:12 -0700 (PDT) Received: by mail-pf1-f176.google.com with SMTP id d2e1a72fcca58-690bc3f82a7so1060861b3a.0; Thu, 12 Oct 2023 10:23:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697131392; x=1697736192; 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=2huTdw8gv98PUVaCLOU6DBAj+aarMGXn0Df0CI62RjM=; b=Ta+HKXRcSd74lXModIUNcmzoJ2sIxzZcHFQ5mlOlZwy9M2K/1gyvRDMIGoleJW65zj 5Jftra1mmlQwfWvuyqUruJMPdhqnAjnbg+dcADmygl9MUPX5Ho/pBT/GYuEewcGbC5qI cE7DrmnwuL7pEG5Z3+GHSvPUWwmKLx7O7iHelNg/FxJnbBuoqvtWyLgtd7WUc6ryS3HK 1X/1ryJ0DwXCLBV+/KIvv5pFpXUeCj5B2uprAFR4IgEQAfF2NtmqsDBb45uXRNzsltvc pbha4o7+8U3ZQSfgkeUpxxlxjb7ohTjg2btD0XtFrWyCsU9WJfD5JKTwiPupXIZyTkqY ixmw== X-Gm-Message-State: AOJu0YxsdQjJSQekg3G4FDZHkumLsLILIdXVuDfn5dS14H1jqvU2p9Wg WKUFJBt1rWMG0sRxwPmfXNdCmsmdgD5fON7+oNs= X-Received: by 2002:a05:6a20:7f83:b0:15e:b8a1:57b9 with SMTP id d3-20020a056a207f8300b0015eb8a157b9mr30329596pzj.24.1697131391926; Thu, 12 Oct 2023 10:23:11 -0700 (PDT) MIME-Version: 1.0 References: <20230928004431.1926969-1-irogers@google.com> In-Reply-To: From: Namhyung Kim Date: Thu, 12 Oct 2023 10:23:00 -0700 Message-ID: Subject: Re: [PATCH v1] perf parse-events: Fix for term values that are raw events To: Ian Rogers Cc: Arnaldo Carvalho de Melo , Kan Liang , James Clark , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Adrian Hunter , Alexander Shishkin , Jiri Olsa , Ingo Molnar , Mark Rutland , Peter Zijlstra Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Thu, 12 Oct 2023 10:36:49 -0700 (PDT) On Thu, Oct 5, 2023 at 3:13 PM Ian Rogers wrote: > > On Wed, Sep 27, 2023 at 5:44 PM Ian Rogers wrote: > > > > Raw events can be strings like 'r0xead' but the 0x is optional so they > > can also be 'read'. On IcelakeX uncore_imc_free_running has an event > > called 'read' which may be programmed as: > > ``` > > $ perf stat -e 'uncore_imc_free_running/event=read/' -a sleep 1 > > ``` > > However, the PE_RAW type isn't allowed on the right of a term, even > > though in this case we just want to interpret it as a string. This > > leads to the following error on IcelakeX: > > ``` > > $ perf stat -e 'uncore_imc_free_running/event=read/' -a sleep 1 > > event syntax error: '..nning/event=read/' > > \___ parser error > > Run 'perf list' for a list of valid events > > > > Usage: perf stat [] [] > > > > -e, --event event selector. use 'perf list' to list available events > > ``` > > Fix this by allowing raw types on the right of terms and treat them as > > strings, just as is already done for PE_LEGACY_CACHE. Make this > > consistent by just entirely removing name_or_legacy and always using > > name_or_raw that covers all three cases. > > > > Fixes: 6fd1e5191591 ("perf parse-events: Support PMUs for legacy cache events") > > Signed-off-by: Ian Rogers Applied to perf-tools-next, thanks!