diff options
author | Ingo Molnar <mingo@kernel.org> | 2017-03-24 19:37:40 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2017-03-24 19:37:40 +0100 |
commit | e3a6a62400520452fe39740dca90a1d0b94b8f92 (patch) | |
tree | 0339ad6ca5de37105e47d4fa0d3b082e091ccbb0 /tools/perf/util/expr.h | |
parent | 267dd0a07eefbb37264fcfad984fffc8856898ad (diff) | |
parent | bf874fcf9f2fed58510dc83abcee388cee2b427e (diff) |
Merge tag 'perf-core-for-mingo-4.12-20170324' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo:
User visible changes:
- Allow suppressing 'uncore_' when specifying PMU events (Andi Kleen)
- Collapse identically named PMU events in 'perf stat', allow
not merging it via --no-merge (Andi Kleen)
Fixes:
- Use more precise 'grep -v' to suppress unwanted 'objdump -dS'
disassembly output to not ditch line:number lines needed by
'perf annotate --print-lines' logic (Taeung Song)
Infrastructure changes:
- SDT (Statically Defined Tracing)/uprobes_events arguments improvements
(Alexis Berlemont, Ravi Bangoria)
- Improvements for the handling of JSON described vendor events,
including having an expression parser to calculate metrics
from multiple vendor events (Andi Kleen)
- Update Intel JSON vendor event files (Andi Kleen)
- Restore error reporting in 'perf probe -d' when none of the events
requested to be deleted exist. (Kefeng Wang)
- Bump MAX_CMDLEN in 'perf probe' to match what the kernel accepts
(Ravi Bangoria)
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/perf/util/expr.h')
-rw-r--r-- | tools/perf/util/expr.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tools/perf/util/expr.h b/tools/perf/util/expr.h new file mode 100644 index 000000000000..9c2760a1a96e --- /dev/null +++ b/tools/perf/util/expr.h @@ -0,0 +1,25 @@ +#ifndef PARSE_CTX_H +#define PARSE_CTX_H 1 + +#define EXPR_MAX_OTHER 8 +#define MAX_PARSE_ID EXPR_MAX_OTHER + +struct parse_id { + const char *name; + double val; +}; + +struct parse_ctx { + int num_ids; + struct parse_id ids[MAX_PARSE_ID]; +}; + +void expr__ctx_init(struct parse_ctx *ctx); +void expr__add_id(struct parse_ctx *ctx, const char *id, double val); +#ifndef IN_EXPR_Y +int expr__parse(double *final_val, struct parse_ctx *ctx, const char **pp); +#endif +int expr__find_other(const char *p, const char *one, const char ***other, + int *num_other); + +#endif |