linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv2 0/5] perf expr: Add flex scanner
@ 2020-02-24  8:29 Jiri Olsa
  2020-02-24  8:29 ` [PATCH 1/5] perf expr: Add expr.c object Jiri Olsa
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Jiri Olsa @ 2020-02-24  8:29 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: lkml, Ingo Molnar, Namhyung Kim, Alexander Shishkin,
	Peter Zijlstra, Michael Petlan, Ravi Bangoria, Andi Kleen,
	Kajol Jain, John Garry

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?


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


^ permalink raw reply	[flat|nested] 10+ messages in thread
* [PATCHv3 0/5] perf expr: Add flex scanner
@ 2020-02-28  9:36 Jiri Olsa
  2020-02-28  9:36 ` [PATCH 1/5] perf expr: Add expr.c object Jiri Olsa
  0 siblings, 1 reply; 10+ messages in thread
From: Jiri Olsa @ 2020-02-28  9:36 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: lkml, Ingo Molnar, Namhyung Kim, Alexander Shishkin,
	Peter Zijlstra, Michael Petlan, Ravi Bangoria, Andi Kleen,
	Kajol Jain, John Garry

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?


v3 changes:
  - keep the EXPR_MAX_OTHER not too high (Andi)
  - add normalize call to flexer, so we have all symbols covered [kajoljain]

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        | 114 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 tools/perf/util/expr.y        | 185 +++++++++++++++++++++----------------------------------------------------------------------------------------------------
 tools/perf/util/stat-shadow.c |   4 +--
 7 files changed, 276 insertions(+), 168 deletions(-)
 create mode 100644 tools/perf/util/expr.c
 create mode 100644 tools/perf/util/expr.l


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-02-28  9:36 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-24  8:29 [PATCHv2 0/5] perf expr: Add flex scanner Jiri Olsa
2020-02-24  8:29 ` [PATCH 1/5] perf expr: Add expr.c object Jiri Olsa
2020-02-24  8:29 ` [PATCH 2/5] perf expr: Move expr lexer to flex Jiri Olsa
2020-02-24  8:29 ` [PATCH 3/5] perf expr: Increase EXPR_MAX_OTHER Jiri Olsa
2020-02-24 21:03   ` Andi Kleen
2020-02-24  8:29 ` [PATCH 4/5] perf expr: Straighten expr__parse/expr__find_other interface Jiri Olsa
2020-02-24  8:29 ` [PATCH 5/5] perf expr: Make expr__parse return -1 on error Jiri Olsa
2020-02-27 12:10 ` [PATCHv2 0/5] perf expr: Add flex scanner Jiri Olsa
2020-02-27 13:46   ` Arnaldo Carvalho de Melo
2020-02-28  9:36 [PATCHv3 " Jiri Olsa
2020-02-28  9:36 ` [PATCH 1/5] perf expr: Add expr.c object Jiri Olsa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).