mirror of
https://github.com/torvalds/linux.git
synced 2026-11-27 17:02:17 +00:00
The #slots literal will return NAN when not on ARM64 which causes a
perf test failure when not on an ARM64 for a JEVENTS_ARCH=all build:
..
10.4: Parsing of PMU event table metrics with fake PMUs : FAILED!
..
Add an is_test boolean so that the failure can be avoided when running
as a test.
Fixes: acef233b7c ("perf pmu: Add #slots literal support for arm64")
Reviewed-by: John Garry <[email protected]>
Reviewed-by: Kajol Jain <[email protected]>
Signed-off-by: Ian Rogers <[email protected]>
Cc: Adrian Hunter <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Caleb Biggers <[email protected]>
Cc: Florian Fischer <[email protected]>
Cc: Ian Rogers <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: James Clark <[email protected]>
Cc: Jing Zhang <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Kan Liang <[email protected]>
Cc: Kang Minchul <[email protected]>
Cc: Kim Phillips <[email protected]>
Cc: Leo Yan <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Mike Leach <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Perry Taylor <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Ravi Bangoria <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Sandipan Das <[email protected]>
Cc: Stephane Eranian <[email protected]>
Cc: Will Deacon <[email protected]>
Cc: Xing Zhengjun <[email protected]>
Cc: [email protected]
Cc: [email protected]
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
59 lines
1.8 KiB
C
59 lines
1.8 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef PARSE_CTX_H
|
|
#define PARSE_CTX_H 1
|
|
|
|
struct hashmap;
|
|
struct metric_ref;
|
|
|
|
struct expr_scanner_ctx {
|
|
char *user_requested_cpu_list;
|
|
int runtime;
|
|
bool system_wide;
|
|
bool is_test;
|
|
};
|
|
|
|
struct expr_parse_ctx {
|
|
struct hashmap *ids;
|
|
struct expr_scanner_ctx sctx;
|
|
};
|
|
|
|
struct expr_id_data;
|
|
|
|
struct hashmap *ids__new(void);
|
|
void ids__free(struct hashmap *ids);
|
|
int ids__insert(struct hashmap *ids, const char *id);
|
|
/*
|
|
* Union two sets of ids (hashmaps) and construct a third, freeing ids1 and
|
|
* ids2.
|
|
*/
|
|
struct hashmap *ids__union(struct hashmap *ids1, struct hashmap *ids2);
|
|
|
|
struct expr_parse_ctx *expr__ctx_new(void);
|
|
void expr__ctx_clear(struct expr_parse_ctx *ctx);
|
|
void expr__ctx_free(struct expr_parse_ctx *ctx);
|
|
|
|
void expr__del_id(struct expr_parse_ctx *ctx, const char *id);
|
|
int expr__add_id(struct expr_parse_ctx *ctx, const char *id);
|
|
int expr__add_id_val(struct expr_parse_ctx *ctx, const char *id, double val);
|
|
int expr__add_id_val_source_count(struct expr_parse_ctx *ctx, const char *id,
|
|
double val, int source_count);
|
|
int expr__add_ref(struct expr_parse_ctx *ctx, struct metric_ref *ref);
|
|
int expr__get_id(struct expr_parse_ctx *ctx, const char *id,
|
|
struct expr_id_data **data);
|
|
bool expr__subset_of_ids(struct expr_parse_ctx *haystack,
|
|
struct expr_parse_ctx *needles);
|
|
int expr__resolve_id(struct expr_parse_ctx *ctx, const char *id,
|
|
struct expr_id_data **datap);
|
|
|
|
int expr__parse(double *final_val, struct expr_parse_ctx *ctx,
|
|
const char *expr);
|
|
|
|
int expr__find_ids(const char *expr, const char *one,
|
|
struct expr_parse_ctx *ids);
|
|
|
|
double expr_id_data__value(const struct expr_id_data *data);
|
|
double expr_id_data__source_count(const struct expr_id_data *data);
|
|
double expr__get_literal(const char *literal, const struct expr_scanner_ctx *ctx);
|
|
|
|
#endif
|