Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp1205067ybf; Thu, 27 Feb 2020 06:47:20 -0800 (PST) X-Google-Smtp-Source: APXvYqyX6t1ENsCljXwR1DDq6dP+GOBijllNpr6BNyu8ZlZd8vhdWzf96KP1pm4hXEX2ZvdXr1xb X-Received: by 2002:aca:3087:: with SMTP id w129mr2748045oiw.8.1582814839878; Thu, 27 Feb 2020 06:47:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582814839; cv=none; d=google.com; s=arc-20160816; b=GzSykfW/XIqMZylIvEzr83UKt1zxqatNWhKLOhWA87P7evk6dA+cMb4s7ejq5m01Wg QjBuYXAnNVI8ana/qb4THWXdz64hTjSUrfB0RVH7zbuUTK1hTb5aso1HIerqNuZxMxEZ xuUW428EEk5wG7xHN57pVDXarZhWJrIWMcTm4qqG9ks4aSqqKXsQNuTztPT+8GiizYEv qFe235h7qdAiOOvPcIhL8d2ITjP/vlGe5baBBdzoGZakHUXXeRMgiuxQ9nHKSQpFukq5 HKxm263XO4sYHbWGo4QGI8bInKYRU21DiEIj5WPU4tkW6vwAjmc8wByUNUi8cgwYIQdH aJcg== 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:date:from :dkim-signature; bh=MNKG4+F+LTFwpzpyT4+p3VzII4Y7Yin7L8vMm6TuNbw=; b=in3F2jYaWMBL0Fa4QhK23KBXtOnhnbodR/ZN6x/kDVMuqlSkd3gjkRbfvH5IGiowQE 7mKIQG0XW7rvML2Nz9v7/R27Rc/VCqM5C4DMpTxNbZAWityOl2t2FWld5VpmepwPbgdj s47e2Rq+3Tf0DALTB1UbUdXKDYm7ubGt1gjU7ZSluBTu/eoQn2TCP+CcwKxaqJaOengr mEWd6+sAfPiYab5U1D1D+JwJ/ywKNEimnRLAUI9Npg6MolC6B7mokF4sEZjiykhuTBnY HoJE/d6XlgiCy5/unAGRb9wpvBCY4xMXGU1zAaCugQhfLGwQWMKU1CeHjf77QFNpzH8h MiJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=maOSf5TO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a14si1373277oid.102.2020.02.27.06.47.07; Thu, 27 Feb 2020 06:47:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=maOSf5TO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730045AbgB0Nqe (ORCPT + 99 others); Thu, 27 Feb 2020 08:46:34 -0500 Received: from mail-qk1-f196.google.com ([209.85.222.196]:40814 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730514AbgB0Nq3 (ORCPT ); Thu, 27 Feb 2020 08:46:29 -0500 Received: by mail-qk1-f196.google.com with SMTP id m2so3114348qka.7 for ; Thu, 27 Feb 2020 05:46:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=MNKG4+F+LTFwpzpyT4+p3VzII4Y7Yin7L8vMm6TuNbw=; b=maOSf5TOiNL1jUWavOPbZlor+ttx5R8cCBG00EGM+fvyjeh/hhhD+/1DSlj/eYNsWK WVpUc8Gnhyw9KLH0S4KS9NQTS574W5iLNgyBfk5UeMQxVUntv8VpJIljeIKxrhDC69K6 VMzj+fJiWy4OPLtTIEBUqxTp18PMMgiceIjIIh1PBdlsse8e6tipJqBeFpt6064bFygX C5GeFgq+8rTsbexcZHFXb8O/OBND9+di5yo/8NQukf2628xEuipl5eI/ARRBBAYZbc7p tG0deKD8A594XAYjujjDIqN3ULVWJkvsEt+jsJxuoiXtYDQAgZHE0nPUTFJbvtGn9h9I KE1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=MNKG4+F+LTFwpzpyT4+p3VzII4Y7Yin7L8vMm6TuNbw=; b=I/WFSYVTQiGuiar5LEMI0g5CW3qCS1fxY6cUM2jLsei5M/rhdhUEdvyv2ASadkrLl3 IzXFfsdTG1tdE/wd2LN+pRIrN/lp8DA3qcRA5TdT6PAPbJ1glRpIm0zzk0JVKH5sMY8C L3N9UUq6j0QFbFNlwlRttjHsBstP5eNO1sCKMG0gTaxf1C1ptODwnlssJm4mKp9zblux XWy/QcHJFc4P7YCVgFXvwwpMQrJgXtJaoJo7k1X4kBWfAWpowMdjf+BUo1bAxdhHwyUd 7DAklAeL1/0VNA6+rUcCylRvs3/iq/BmcG1QsmUyFLU+x6FDswVJEG1ZILlUalzqN5/3 FayA== X-Gm-Message-State: APjAAAVl5K+jjy1jqMZexOvcmb6g0M2oaJAo8wULCUSGEOyOCTA7h9Uu fP3Ba5FjMujAuMnstSkiLKz6wMrI0vg= X-Received: by 2002:a37:6c9:: with SMTP id 192mr5356300qkg.25.1582811188307; Thu, 27 Feb 2020 05:46:28 -0800 (PST) Received: from quaco.ghostprotocols.net ([179.97.37.151]) by smtp.gmail.com with ESMTPSA id v82sm3129067qka.51.2020.02.27.05.46.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Feb 2020 05:46:27 -0800 (PST) From: Arnaldo Carvalho de Melo X-Google-Original-From: Arnaldo Carvalho de Melo Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id B8485403AD; Thu, 27 Feb 2020 10:46:25 -0300 (-03) Date: Thu, 27 Feb 2020 10:46:25 -0300 To: Jiri Olsa Cc: Jiri Olsa , lkml , Ingo Molnar , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Michael Petlan , Ravi Bangoria , Andi Kleen , Kajol Jain , John Garry Subject: Re: [PATCHv2 0/5] perf expr: Add flex scanner Message-ID: <20200227134625.GC10761@kernel.org> References: <20200224082918.58489-1-jolsa@kernel.org> <20200227121000.GE34774@krava> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200227121000.GE34774@krava> X-Url: http://acmel.wordpress.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Thu, Feb 27, 2020 at 01:10:00PM +0100, Jiri Olsa escreveu: > On Mon, Feb 24, 2020 at 09:29:13AM +0100, Jiri Olsa wrote: > > hi, > > while preparing changes for user defined metric expressions > > I also moved the expression manual parser to flex. > > > > The reason is to have an easy and reasonable way to support > > and parse multiple user-defined metric expressions from > > command line or file. > > > > I was posponing the change, but I just saw another update to > > the expr manual scanner (from Kajol Jain), so cherry picked > > just the expr flex code changes to get it out. > > > > Kajol Jain, > > I think it should ease up your change for unknown values marked > > by '?'. Would you consider rebasing your changes on top of this? > > > > > > kajoljain found and issue in this one, I'll send v3 as > soon as he confirms the fix Ok, I'll hold off processing those patches then, thanks! - Arnaldo > jirka > > > > v2 changes: > > - handle special chars properly > > - fix return value for expr__parse > > > > Available also in: > > git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git > > perf/metric_flex > > > > thanks, > > jirka > > > > > > --- > > Jiri Olsa (5): > > perf expr: Add expr.c object > > perf expr: Move expr lexer to flex > > perf expr: Increase EXPR_MAX_OTHER > > perf expr: Straighten expr__parse/expr__find_other interface > > perf expr: Make expr__parse return -1 on error > > > > tools/perf/tests/expr.c | 10 +++--- > > tools/perf/util/Build | 11 ++++++- > > tools/perf/util/expr.c | 112 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > > tools/perf/util/expr.h | 8 ++--- > > tools/perf/util/expr.l | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++ > > tools/perf/util/expr.y | 208 ++++++++++++++++++++++++++++++++----------------------------------------------------------------------------------------- > > tools/perf/util/stat-shadow.c | 4 +-- > > 7 files changed, 272 insertions(+), 168 deletions(-) > > create mode 100644 tools/perf/util/expr.c > > create mode 100644 tools/perf/util/expr.l > > > -- - Arnaldo