Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp1048643ybf; Thu, 27 Feb 2020 04:10:48 -0800 (PST) X-Google-Smtp-Source: APXvYqwZ+UxCGGANvjxyBnZf2j3lI3q+RDcJvbkQdIfEHx6xwFGlhhlwY2JLIDlR3Q8CKWeuAIwa X-Received: by 2002:a05:6830:1011:: with SMTP id a17mr2887317otp.45.1582805448746; Thu, 27 Feb 2020 04:10:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582805448; cv=none; d=google.com; s=arc-20160816; b=pZKd3YhGiugXUZ6BgSJXvt6AVtmYBSy0FzzLHtRpFEW97AWMANlazfC3hDnoPbdCSY XXMvYbV7aDQT/o3JzrT4efponzHkKVJtUMxV0rtIll+vHXP5LedjnOcVhi2tzWZ0hjn4 tdAb80NzG6i5YbJ6vLiLU96n9KvxRXSn88Qs/odqclvtKzO8iFsgo3S6GSK4G1lYjRRK AsvndyGjYNzqbOJ/Fxf9wQClHcruIIY6jBuXjcxXbR1ssIbwE4236PczDhc/kCcTGbhl mgwyncVwFcnyTcYGcJ3D2VF3rotzr+WzTxS/++6oIFsuPXePi+CB80zzARBHCftkv0JD a6+A== 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=47eZt9nqc2W9fzz4oCXWLbKvTh1nCIZ5kasqAm1JXXA=; b=xHA2rDnkPESPwy20jGqU3rMgaoGycFUHs6N+sBfAhzLOhDPcLcxkaVFOIK86TxB3dd pZJUEB2SXImKFBntMLRNK3JyCCXG3HkWO5yLtitzR2FUqewf5+IXlwoGLBzCeRcif0Yk KFNrAV8BkgGrPVcUEVkFd7UFLVJIS5rC1qk8oaapOYtI5RjjUxZtTvbuDEglAM6Ftbpp wk4oHvniia1bj7o2Xo/+m7vWohBDL04EA8dTz8TvbGyUOVorbHvq8O3rH2CQ5LrbQc8n qQI8p0lccndQffSc0H3RuSi5U+BrIXjUzFDvfQ/RX22pzm3aGtn7NfIfvNdWWMg95QFk ZyNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="SnBAZZ/a"; 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=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h11si1442674otr.197.2020.02.27.04.10.36; Thu, 27 Feb 2020 04:10:48 -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=@redhat.com header.s=mimecast20190719 header.b="SnBAZZ/a"; 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=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728940AbgB0MKN (ORCPT + 99 others); Thu, 27 Feb 2020 07:10:13 -0500 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:60990 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728856AbgB0MKM (ORCPT ); Thu, 27 Feb 2020 07:10:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582805411; 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=47eZt9nqc2W9fzz4oCXWLbKvTh1nCIZ5kasqAm1JXXA=; b=SnBAZZ/a1KyCm+6q7ROFDYSbDEVegFU7JW3CvwdrR1U0o8k15bJwOUqlXQwwyBzqh6dbi8 JZ0xVB+ujDeO2uFDPpF13U542KEhLUSfEFANPTRUI24GOvEU9HU+8utzSdeNir8ShldlN4 yNhalJ4tsbGSRCK+N1g7+JJ5wyJMioA= 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-50-7e27G3WDNViPf9YEaXi6tA-1; Thu, 27 Feb 2020 07:10:07 -0500 X-MC-Unique: 7e27G3WDNViPf9YEaXi6tA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2F9A713E6; Thu, 27 Feb 2020 12:10:05 +0000 (UTC) Received: from krava (unknown [10.43.17.9]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C0D8A90CD2; Thu, 27 Feb 2020 12:10:02 +0000 (UTC) Date: Thu, 27 Feb 2020 13:10:00 +0100 From: Jiri Olsa To: Jiri Olsa , Arnaldo Carvalho de Melo Cc: 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: <20200227121000.GE34774@krava> References: <20200224082918.58489-1-jolsa@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200224082918.58489-1-jolsa@kernel.org> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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 >