Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp151216lqa; Fri, 26 Apr 2024 18:36:12 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXnfgoPjXT1K6uyEZehjBzXaiqa0P9zIoG/iKbjVY2WccCeWLkOCDW/cRNaziqT2zB5itRLJ3RK5nVKa0UBJHDuTQ3oAbJ7p31++tu0mQ== X-Google-Smtp-Source: AGHT+IFVZ0eW3SPZMemX1VcCfzNXQihC73b/+XydXNol6+JXm9sXFuDGJewPwb/XQuW1WGqoZIL0 X-Received: by 2002:a05:6214:501d:b0:6a0:9f54:6013 with SMTP id jo29-20020a056214501d00b006a09f546013mr4939928qvb.2.1714181772111; Fri, 26 Apr 2024 18:36:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714181772; cv=pass; d=google.com; s=arc-20160816; b=p4mHh4ce0PWcSMB3FjJjCvLwXx4aKtUEn74dlwemrtIfAaOnH9jqR3bx89RZHPhtfb Jnz59gk/0UPtoISq2CGVspUQXd+ge2EZHxXzO3UvirhSb/dKO2UaI+5Qebf9ySHxoP0h DQC4NF1euxMAocVCJ+ACK0Ywhvfu89gUV5a9QDFZwiTcgHnkdnjAKODfLnGsQL4LJUZF KP1+XV2aBUzYyg7UcfLLCVJNe1E0po/cp29vvI+/FXN5Tutm7daB4b6nnoVg+T0e1K7g T74fgA05jarMYoNve0B/7sy0zDHeI50p8EZuFW/kV2oEH07AJ+iiptaOyXMiNQnU5iRp /f7A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ZZXHSCdlLsTjrpQI7zhIH6gQZbu170qyhA83+niqSwY=; fh=EpTOFePC4zDY+EDFkTtaJJJk++jF1xJf/weINkmoBKE=; b=sZHp15T4HIA35apjZ/hp4TQDPlyaiDFt24F3f0VVN/na3CgjpAJM6G0pkrbUso00WE jWaLj4NoTqsnJhIyUfyuqu2NYlyD+kuG6av24uhzIc5rQ/arn3K5Xor+rKmPjEK+cqcC +dU89n38b/ecakdpgUCQ7DL8n8pBfwVJaqDaCJne8gBHGBkxSecb9SaVWXGOsvL+xKew rHTf7j8SAIFfXKjAeXY/K6QMxQB5yKHp0UFjm8ynf3Q78vgiICCX5hCOLYj7vSD24vrm 9TnUs+/ppaFaK8m9MJGddGOJDnwhdXCMj0hdEELpnc781xUn97wwTvCa0YVE0BmuFn8R aUxA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=crPCgKfT; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-160851-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160851-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 11-20020a0562140ccb00b0069b6703f4fbsi22197899qvx.543.2024.04.26.18.36.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 18:36:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-160851-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=crPCgKfT; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-160851-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160851-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id CC88F1C21D19 for ; Sat, 27 Apr 2024 01:36:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7634738DC7; Sat, 27 Apr 2024 01:36:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="crPCgKfT" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 9670629409; Sat, 27 Apr 2024 01:36:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714181762; cv=none; b=j0oN+MVezT/h5nL5NVxgimxaasAtB2u6mcy9YQisAc4TCpWIw257/Tc6DhaW+nnkMGnKcjWN8/uGkbP6QcT4MgWfRI0etiYpIgAsG8feRvSjTJjA7o5mlpsnJgrLsFaQO+rDFnAkhOi2CyzOd51QkFQrPFRLJ4jdhNi0H7zbkuA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714181762; c=relaxed/simple; bh=FgfvRvIIdKg5M8VTG3GygY/t5MgGGpquPipWcwa1BbY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=t+48JnWoMarxgQuLl/RV6ZF38S7Zg8irtvAngLh92yFJNCXxhTT9xBDnZaa5PlhdXF0hCWzuyGdoChS3/zu3kw8guOxxsHc69msP+LMQ8CUifzdRdoB1aiPvliUUK+ptcPjp5jHpLWxHU/+cBy9cLixF2q8W05h/8rJXOZDnLGY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=crPCgKfT; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id C975BC113CD; Sat, 27 Apr 2024 01:36:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714181762; bh=FgfvRvIIdKg5M8VTG3GygY/t5MgGGpquPipWcwa1BbY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=crPCgKfTrZI69WjN8uB5eiXzpb46kN+36v9HtC11O3fsfXHLHCxx4LumYSIVXGZpT GFChac4esj36x6sTMDjqAysyEJsaPuTEWkvtMccXpAwwU2Yh4ruGaPZGnI6HxnewQ/ 4dG4NxFuN2z88eMrNpP8EYtaBiUiWizerlJcCqv18uLVpMpU/8g16sknhT9VI/24Ak Bn7vtTKjfPi8C9KApCmf86JnFIDRAamOCKfy9dkblIZz+ZUA0//6+pxHIh2L3fBbVm em9eaZqR8Re8l806rzxaBfTFvzK9UVPHTY9YCJgEp2XqpNaxm6v6aom0dn0Dh31pAu vg7ungBkC2sTg== Date: Fri, 26 Apr 2024 22:35:59 -0300 From: Arnaldo Carvalho de Melo To: Ian Rogers Cc: Peter Zijlstra , Ingo Molnar , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Adrian Hunter , Kan Liang , James Clark , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, Atish Patra , linux-riscv@lists.infradead.org, Beeman Strong Subject: Re: [PATCH v2 11/16] perf parse-events: Improve error message for bad numbers Message-ID: References: <20240416061533.921723-1-irogers@google.com> <20240416061533.921723-12-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240416061533.921723-12-irogers@google.com> On Mon, Apr 15, 2024 at 11:15:27PM -0700, Ian Rogers wrote: > Use the error handler from the parse_state to give a more informative > error message. > > Before: > ``` > $ perf stat -e 'cycles/period=99999999999999999999/' true > event syntax error: 'cycles/period=99999999999999999999/' > \___ 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 > ``` > > After: > ``` > $ perf stat -e 'cycles/period=99999999999999999999/' true > event syntax error: 'cycles/period=99999999999999999999/' > \___ parser error > This ended up in perf-tools-next, will have to look at what this problem is: 9 11.46 amazonlinux:2 : FAIL gcc version 7.3.1 20180712 (Red Hat 7.3.1-17) (GCC) yy_size_t parse_events_get_leng (yyscan_t yyscanner ); ^~~~~~~~~~~~~~~~~~~~~ util/parse-events.l:22:5: note: previous declaration of 'parse_events_get_leng' was here int parse_events_get_leng(yyscan_t yyscanner); ^~~~~~~~~~~~~~~~~~~~~ yy_size_t parse_events_get_leng (yyscan_t yyscanner) ^~~~~~~~~~~~~~~~~~~~~ util/parse-events.l:22:5: note: previous declaration of 'parse_events_get_leng' was here int parse_events_get_leng(yyscan_t yyscanner); ^~~~~~~~~~~~~~~~~~~~~ make[3]: *** [util] Error 2 Unsure if this will appear on the radar on other distros, maybe this is just something that pops up with older distros... Ran out of time today... - Arnaldo