Skip to content

perf expr: Add flex scanner

Jiri Olsa lkml 3 versions – Applied

Status from this message: Thanks, applied,

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest5 patches 2 repliesApplied
  2. v25 patches 3 repliesSuperseded
  3. v1 RFC4 patches 3 repliesSuperseded

Changes in v3 from the cover letter

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

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/5perf expr: Add expr.c objecttools/perf/util/Build tools/perf/util/expr.c tools/perf/util/expr.y+20 -160 replies
2/5perf expr: Move expr lexer to flextools/perf/util/Build tools/perf/util/expr.c tools/perf/util/expr.h +2 more+247 -1410 replies
3/5perf expr: Increase EXPR_MAX_OTHERtools/perf/util/expr.h+1 -10 replies
4/5perf expr: Straighten expr__parse/expr__find_other interfacetools/perf/tests/expr.c tools/perf/util/expr.c tools/perf/util/expr.h +1 more+10 -120 replies
5/5perf expr: Make expr__parse return -1 on errortools/perf/tests/expr.c tools/perf/util/expr.c+3 -30 replies

Reviews trailers per patch

None of the 5 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchAndi Kleen
SeriesR-b
1/5
2/5
3/5
4/5
5/5

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCHv3 0/5] perf expr: Add flex scanner

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