Skip to content

Commit aecce63

Browse files
olsajiriacmel
authored andcommitted
perf expr: Add expr_ prefix for parse_ctx and parse_id
Adding expr_ prefix for parse_ctx and parse_id, to straighten out the expr* namespace. There's no functional change. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Anju T Sudhakar <anju@linux.vnet.ibm.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Jin Yao <yao.jin@linux.intel.com> Cc: Joe Mario <jmario@redhat.com> Cc: Kajol Jain <kjain@linux.ibm.com> Cc: Kan Liang <kan.liang@linux.intel.com> Cc: Madhavan Srinivasan <maddy@linux.vnet.ibm.com> Cc: Mamatha Inamdar <mamatha4@linux.vnet.ibm.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Michael Petlan <mpetlan@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@ozlabs.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com> Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linuxppc-dev@lists.ozlabs.org Link: http://lore.kernel.org/lkml/20200401203340.31402-2-kjain@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent 04ed4cc commit aecce63

5 files changed

Lines changed: 17 additions & 17 deletions

File tree

‎tools/perf/tests/expr.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include <string.h>
77
#include <linux/zalloc.h>
88

9-
static int test(struct parse_ctx *ctx, const char *e, double val2)
9+
static int test(struct expr_parse_ctx *ctx, const char *e, double val2)
1010
{
1111
double val;
1212

@@ -22,7 +22,7 @@ int test__expr(struct test *t __maybe_unused, int subtest __maybe_unused)
2222
const char **other;
2323
double val;
2424
int i, ret;
25-
struct parse_ctx ctx;
25+
struct expr_parse_ctx ctx;
2626
int num_other;
2727

2828
expr__ctx_init(&ctx);

‎tools/perf/util/expr.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ extern int expr_debug;
1111
#endif
1212

1313
/* Caller must make sure id is allocated */
14-
void expr__add_id(struct parse_ctx *ctx, const char *name, double val)
14+
void expr__add_id(struct expr_parse_ctx *ctx, const char *name, double val)
1515
{
1616
int idx;
1717

@@ -21,13 +21,13 @@ void expr__add_id(struct parse_ctx *ctx, const char *name, double val)
2121
ctx->ids[idx].val = val;
2222
}
2323

24-
void expr__ctx_init(struct parse_ctx *ctx)
24+
void expr__ctx_init(struct expr_parse_ctx *ctx)
2525
{
2626
ctx->num_ids = 0;
2727
}
2828

2929
static int
30-
__expr__parse(double *val, struct parse_ctx *ctx, const char *expr,
30+
__expr__parse(double *val, struct expr_parse_ctx *ctx, const char *expr,
3131
int start)
3232
{
3333
YY_BUFFER_STATE buffer;
@@ -52,7 +52,7 @@ __expr__parse(double *val, struct parse_ctx *ctx, const char *expr,
5252
return ret;
5353
}
5454

55-
int expr__parse(double *final_val, struct parse_ctx *ctx, const char *expr)
55+
int expr__parse(double *final_val, struct expr_parse_ctx *ctx, const char *expr)
5656
{
5757
return __expr__parse(final_val, ctx, expr, EXPR_PARSE) ? -1 : 0;
5858
}
@@ -75,7 +75,7 @@ int expr__find_other(const char *expr, const char *one, const char ***other,
7575
int *num_other)
7676
{
7777
int err, i = 0, j = 0;
78-
struct parse_ctx ctx;
78+
struct expr_parse_ctx ctx;
7979

8080
expr__ctx_init(&ctx);
8181
err = __expr__parse(NULL, &ctx, expr, EXPR_OTHER);

‎tools/perf/util/expr.h‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@
55
#define EXPR_MAX_OTHER 20
66
#define MAX_PARSE_ID EXPR_MAX_OTHER
77

8-
struct parse_id {
8+
struct expr_parse_id {
99
const char *name;
1010
double val;
1111
};
1212

13-
struct parse_ctx {
13+
struct expr_parse_ctx {
1414
int num_ids;
15-
struct parse_id ids[MAX_PARSE_ID];
15+
struct expr_parse_id ids[MAX_PARSE_ID];
1616
};
1717

18-
void expr__ctx_init(struct parse_ctx *ctx);
19-
void expr__add_id(struct parse_ctx *ctx, const char *id, double val);
20-
int expr__parse(double *final_val, struct parse_ctx *ctx, const char *expr);
18+
void expr__ctx_init(struct expr_parse_ctx *ctx);
19+
void expr__add_id(struct expr_parse_ctx *ctx, const char *id, double val);
20+
int expr__parse(double *final_val, struct expr_parse_ctx *ctx, const char *expr);
2121
int expr__find_other(const char *expr, const char *one, const char ***other,
2222
int *num_other);
2323

‎tools/perf/util/expr.y‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
%define api.pure full
1616

1717
%parse-param { double *final_val }
18-
%parse-param { struct parse_ctx *ctx }
18+
%parse-param { struct expr_parse_ctx *ctx }
1919
%parse-param {void *scanner}
2020
%lex-param {void* scanner}
2121

@@ -39,14 +39,14 @@
3939

4040
%{
4141
static void expr_error(double *final_val __maybe_unused,
42-
struct parse_ctx *ctx __maybe_unused,
42+
struct expr_parse_ctx *ctx __maybe_unused,
4343
void *scanner,
4444
const char *s)
4545
{
4646
pr_debug("%s\n", s);
4747
}
4848

49-
static int lookup_id(struct parse_ctx *ctx, char *id, double *val)
49+
static int lookup_id(struct expr_parse_ctx *ctx, char *id, double *val)
5050
{
5151
int i;
5252

‎tools/perf/util/stat-shadow.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@ static void generic_metric(struct perf_stat_config *config,
729729
struct runtime_stat *st)
730730
{
731731
print_metric_t print_metric = out->print_metric;
732-
struct parse_ctx pctx;
732+
struct expr_parse_ctx pctx;
733733
double ratio, scale;
734734
int i;
735735
void *ctxp = out->ctx;

0 commit comments

Comments
 (0)