Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp810140ybk; Wed, 13 May 2020 13:47:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzW5IVGODs8HgVOxJE+Sp6RESxHSlPNflLaWrLfJQ+X7E4WXaDo37JiuCb4I1wFh2C6/8W2 X-Received: by 2002:a17:906:8249:: with SMTP id f9mr762116ejx.313.1589402843741; Wed, 13 May 2020 13:47:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589402843; cv=none; d=google.com; s=arc-20160816; b=vXdGTlKC1WI9hN+EMXz2wUhdHI0h7zeIaBRztXapx+kXTMZVnu93b4t4NpsCx8nW3F WhfB6x/wO6mkgq3xfjxF/sD0w4SbIFychMfdg+IPjOtBG78KXmMxqbQ6vT8mkZre0EHy ALVMRQXb4a917vGOVMQp+tdw2pa2xRhzWdaplfsj7DbQnWehQkKpuMWKkUr33d4t4Oa0 saQVihB9OtBcKwKdoa1rlaxLtHzEHCoRelSXR1FYnSCPI5kJG/52aOM85xXHIqDa+edo mbFELWPgF+KXIroTJ/JclfcWAEd4aZf1Ht0BHkz/IX7TDw2E9Y4n6HkzgCR0cMyE45af a5Zw== 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=ILCVL7vlVG92bS37yQ7N2fhfcb84nVhCr32QqOAFlPM=; b=RCtPiG1eerGnEL0U4hFvpFAAqGkOmHv+agdjSnZz61siNUAXEqbKJfeuiSe7W9in1f PHXB25Ugvngt1cG4UyhQPcUcPx8wiYpLffdqR3kmpe4Ny5yjxkRxIYoiUBDWkU75hLjZ gJltz4cIUlpQtb9ZfkpJnf+q8P7Atu9q6dqysZ9EpgvHYLunTIL/ez/4hJdSZzNPp8Wr 3rwsbWP3webaQ3Q5ACUF1yGznTiuf5hSLQbF4iPlV73+tNuNZNqQYjvN+gRWawdah7gs yQUrzsEZ+vB6+a6kbrlFGAdUSMc+b9FdOsjeAjQka575oU6xl9enfAW+Xyua1hb8HcLz uiPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hgZQQ933; 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 qk11si525207ejb.436.2020.05.13.13.47.01; Wed, 13 May 2020 13:47:23 -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=hgZQQ933; 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 S2389000AbgEMOqV (ORCPT + 99 others); Wed, 13 May 2020 10:46:21 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:23921 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388806AbgEMOqV (ORCPT ); Wed, 13 May 2020 10:46:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589381179; 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=ILCVL7vlVG92bS37yQ7N2fhfcb84nVhCr32QqOAFlPM=; b=hgZQQ933WfacEJJi3effy6x7C3JtNzX4rSAJv20HtV0o7qpttBzdA9QUVxfP2hQteYNxMw z+0Yl+Gc1PaXVmbou2GmhhjtPsz6RKt3EJLWXwcOPuNxwq/lZCnusZYIu+uCU2rcLT/yi6 RkzfqyaDHBirk7p7oK2akohsA1pvPKE= 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-159-UX_yJiyJPkSpmvhEJGb99A-1; Wed, 13 May 2020 10:46:18 -0400 X-MC-Unique: UX_yJiyJPkSpmvhEJGb99A-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 67D6E461; Wed, 13 May 2020 14:46:16 +0000 (UTC) Received: from krava (unknown [10.40.195.109]) by smtp.corp.redhat.com (Postfix) with SMTP id 5059C99D6; Wed, 13 May 2020 14:46:11 +0000 (UTC) Date: Wed, 13 May 2020 16:46:10 +0200 From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: Ian Rogers , Jiri Olsa , 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: <20200513144610.GM3158213@krava> References: <20200511205307.3107775-1-jolsa@kernel.org> <20200511205307.3107775-5-jolsa@kernel.org> <20200513113424.GJ3158213@krava> <20200513140825.GG5583@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200513140825.GG5583@kernel.org> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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 11:08:25AM -0300, Arnaldo Carvalho de Melo wrote: > Em Wed, May 13, 2020 at 01:34:24PM +0200, Jiri Olsa escreveu: > > 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 ;-) > > So I had started processing this patchkit, I assume you will send a v2 > and I should drop what I had processed, is that ok? yes, I will resubmit on top of the other expr changes we have now pending jirka