Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp806094ybk; Wed, 13 May 2020 13:39:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxWk6xlpPicytoECee7UzdEwMBr93HTY7t3Od8lUFgbQVJZJBpD+vwC3yZAk5sJyEMcEvbs X-Received: by 2002:aa7:d513:: with SMTP id y19mr1359440edq.367.1589402385721; Wed, 13 May 2020 13:39:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589402385; cv=none; d=google.com; s=arc-20160816; b=wjzkvhMDzKnYc64LbFz9l3sD9gL4eUlkKPChZY6ZSS7JVisHi6g2aBiAKmUegAA+mF /BEFzUVRSKZTmnww0NwIU62TV9bikBLAQT0/6mWWNYpnb7LViuKnw1cTw4XNokfGbdQL K527pub64m97LytXQgBwRHo5ECKsfF8DAdMgJ2eJuYyECOItH6AoVIMUIOaaNWKjwFsx wa08au8Yd25czL/S8HqoDZWV3+70Op93j0HqCDB3s5e5vXi68NfIruBRxla9qROWihUB 3hS+HIg3yYHi4EL5rDdVsGrPXOT+Kt2r07DeUmfsvQbCawL2FKiTKJXHHXNQoNqvhoi1 q7Iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=HtclPAaVYkOroDgjLz8DtG3xfoOYXGN7ClRQrx80G0w=; b=eZKxIuIB3Q/XAiJlVR088JnHVszAiCuroKf5Y4pKHhuDIreV/BcikqPWZjd/mn+AF/ G3CCDCb2lwnODw+nVuHnZ/VfFrpOhyIhhVTxfh+T1Td/DlStrmZstfXy1nzdszXR4DAS rrmcmoOE0l8WJ0PZt8bjN5oSRfp3Pnc8Xbs+vnJ/UcTuzWs/hi7ILPSJu6lUSzTfA3kO A0iWLxeomHVMUO2V7WFyGIWNvgpkVvpHyDrnl9WlBSUp+VwQWApa+UwkUcDm3D+TP+gr ti/A0PhUcQPDsrHgSAzTOfl0d496yfOkx6Drz9/GZc2KgKygROfwUfJtyHj0MIcxizaj Ec8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Bl+Zmt3Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dr10si655169ejc.190.2020.05.13.13.39.22; Wed, 13 May 2020 13:39:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Bl+Zmt3Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728930AbgEMLec (ORCPT + 99 others); Wed, 13 May 2020 07:34:32 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:20620 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726889AbgEMLec (ORCPT ); Wed, 13 May 2020 07:34:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589369671; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=HtclPAaVYkOroDgjLz8DtG3xfoOYXGN7ClRQrx80G0w=; b=Bl+Zmt3ZHhkKb6QuFOfhfCh5G64q5BJKYrw6Zm+LKMmSufKyucafBdCWb16nRo3ZodOrL3 lr0TSoqVisRckVbSHPwQOrRZkJnIxiLrw/qrkIFQSz5Dw5S09ZqzvRw7PjiBwtYY6r7YG8 dDQFGm0w3jxR2UvxNlY8GEW+sfD6mro= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-199-4EUCvJYrN-iyzP9rV0-X_g-1; Wed, 13 May 2020 07:34:29 -0400 X-MC-Unique: 4EUCvJYrN-iyzP9rV0-X_g-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2F216100CCC9; Wed, 13 May 2020 11:34:28 +0000 (UTC) Received: from krava (unknown [10.40.195.109]) by smtp.corp.redhat.com (Postfix) with SMTP id 763AF1000079; Wed, 13 May 2020 11:34:25 +0000 (UTC) Date: Wed, 13 May 2020 13:34:24 +0200 From: Jiri Olsa To: Ian Rogers Cc: Jiri Olsa , Arnaldo Carvalho de Melo , lkml , Ingo Molnar , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Michael Petlan , Joe Mario , Andi Kleen , Kajol Jain , John Garry Subject: Re: [PATCH 4/4] perf expr: Report line number with error Message-ID: <20200513113424.GJ3158213@krava> References: <20200511205307.3107775-1-jolsa@kernel.org> <20200511205307.3107775-5-jolsa@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 13, 2020 at 12:09:30AM -0700, Ian Rogers wrote: > On Mon, May 11, 2020 at 1:54 PM Jiri Olsa wrote: > > > > Display line number on when parsing custom metrics file, like: > > > > $ cat metrics > > // IPC > > mine1 = inst_retired.any / cpu_clk_unhalted.thread; > > > > krava > > $ sudo perf stat --metrics-file ./metrics -M mine1 -a -I 1000 --metric-only > > failed to parse metrics file: ./metrics:4 > > > > Please note that because the grammar is flexible on new lines, > > the syntax could be broken on the next 'not fitting' item and > > not the first wrong word, like: > > > > $ cat metrics > > // IPC > > krava > > mine1 = inst_retired.any / cpu_clk_unhalted.thread; > > $ sudo perf stat --metrics-file ./metrics -M mine1 -a -I 1000 --metric-only > > failed to parse metrics file: ./metrics:3 > > A line number is better than nothing :-) It'd be nice to be told about > broken events and more information about what's broken in the line. A > common failure is @ vs / encoding and also no-use or misuse of \\. > Perhaps expand the test coverage. yep, error reporting needs more changes.. but the line is crucial ;-) jirka