All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>
To: Kajol Jain <kjain@linux.ibm.com>
Cc: linuxppc-dev@lists.ozlabs.org, mpe@ellerman.id.au,
	sukadev@linux.vnet.ibm.com, linux-kernel@vger.kernel.org,
	linux-perf-users@vger.kernel.org, anju@linux.vnet.ibm.com,
	maddy@linux.vnet.ibm.com, ravi.bangoria@linux.ibm.com,
	peterz@infradead.org, yao.jin@linux.intel.com,
	ak@linux.intel.com, jolsa@kernel.org, kan.liang@linux.intel.com,
	jmario@redhat.com, alexander.shishkin@linux.intel.com,
	mingo@kernel.org, paulus@ozlabs.org, namhyung@kernel.org,
	mpetlan@redhat.com, gregkh@linuxfoundation.org,
	benh@kernel.crashing.org, mamatha4@linux.vnet.ibm.com,
	mark.rutland@arm.com, tglx@linutronix.de
Subject: Re: [PATCH v8 1/7] perf expr: Add expr_ prefix for parse_ctx and parse_id
Date: Mon, 6 Apr 2020 11:13:57 -0300	[thread overview]
Message-ID: <20200406141357.GG29826@kernel.org> (raw)
In-Reply-To: <20200401203340.31402-2-kjain@linux.ibm.com>

Em Thu, Apr 02, 2020 at 02:03:34AM +0530, Kajol Jain escreveu:
> From: Jiri Olsa <jolsa@kernel.org>
> 
> Adding expr_ prefix for parse_ctx and parse_id,
> to straighten out the expr* namespace.
> 
> There's no functional change.

Next time please add your Signed-off-by: as well when pushing 3rd party
patches.

Applied.

- Arnaldo
 
> Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> ---
>  tools/perf/tests/expr.c       |  4 ++--
>  tools/perf/util/expr.c        | 10 +++++-----
>  tools/perf/util/expr.h        | 12 ++++++------
>  tools/perf/util/expr.y        |  6 +++---
>  tools/perf/util/stat-shadow.c |  2 +-
>  5 files changed, 17 insertions(+), 17 deletions(-)
> 
> diff --git a/tools/perf/tests/expr.c b/tools/perf/tests/expr.c
> index 28313e59d6f6..ea10fc4412c4 100644
> --- a/tools/perf/tests/expr.c
> +++ b/tools/perf/tests/expr.c
> @@ -6,7 +6,7 @@
>  #include <string.h>
>  #include <linux/zalloc.h>
>  
> -static int test(struct parse_ctx *ctx, const char *e, double val2)
> +static int test(struct expr_parse_ctx *ctx, const char *e, double val2)
>  {
>  	double val;
>  
> @@ -22,7 +22,7 @@ int test__expr(struct test *t __maybe_unused, int subtest __maybe_unused)
>  	const char **other;
>  	double val;
>  	int i, ret;
> -	struct parse_ctx ctx;
> +	struct expr_parse_ctx ctx;
>  	int num_other;
>  
>  	expr__ctx_init(&ctx);
> diff --git a/tools/perf/util/expr.c b/tools/perf/util/expr.c
> index fd192ddf93c1..c8ccc548a585 100644
> --- a/tools/perf/util/expr.c
> +++ b/tools/perf/util/expr.c
> @@ -11,7 +11,7 @@ extern int expr_debug;
>  #endif
>  
>  /* Caller must make sure id is allocated */
> -void expr__add_id(struct parse_ctx *ctx, const char *name, double val)
> +void expr__add_id(struct expr_parse_ctx *ctx, const char *name, double val)
>  {
>  	int idx;
>  
> @@ -21,13 +21,13 @@ void expr__add_id(struct parse_ctx *ctx, const char *name, double val)
>  	ctx->ids[idx].val = val;
>  }
>  
> -void expr__ctx_init(struct parse_ctx *ctx)
> +void expr__ctx_init(struct expr_parse_ctx *ctx)
>  {
>  	ctx->num_ids = 0;
>  }
>  
>  static int
> -__expr__parse(double *val, struct parse_ctx *ctx, const char *expr,
> +__expr__parse(double *val, struct expr_parse_ctx *ctx, const char *expr,
>  	      int start)
>  {
>  	YY_BUFFER_STATE buffer;
> @@ -52,7 +52,7 @@ __expr__parse(double *val, struct parse_ctx *ctx, const char *expr,
>  	return ret;
>  }
>  
> -int expr__parse(double *final_val, struct parse_ctx *ctx, const char *expr)
> +int expr__parse(double *final_val, struct expr_parse_ctx *ctx, const char *expr)
>  {
>  	return __expr__parse(final_val, ctx, expr, EXPR_PARSE) ? -1 : 0;
>  }
> @@ -75,7 +75,7 @@ int expr__find_other(const char *expr, const char *one, const char ***other,
>  		     int *num_other)
>  {
>  	int err, i = 0, j = 0;
> -	struct parse_ctx ctx;
> +	struct expr_parse_ctx ctx;
>  
>  	expr__ctx_init(&ctx);
>  	err = __expr__parse(NULL, &ctx, expr, EXPR_OTHER);
> diff --git a/tools/perf/util/expr.h b/tools/perf/util/expr.h
> index 9377538f4097..b9e53f2b5844 100644
> --- a/tools/perf/util/expr.h
> +++ b/tools/perf/util/expr.h
> @@ -5,19 +5,19 @@
>  #define EXPR_MAX_OTHER 20
>  #define MAX_PARSE_ID EXPR_MAX_OTHER
>  
> -struct parse_id {
> +struct expr_parse_id {
>  	const char *name;
>  	double val;
>  };
>  
> -struct parse_ctx {
> +struct expr_parse_ctx {
>  	int num_ids;
> -	struct parse_id ids[MAX_PARSE_ID];
> +	struct expr_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);
> -int expr__parse(double *final_val, struct parse_ctx *ctx, const char *expr);
> +void expr__ctx_init(struct expr_parse_ctx *ctx);
> +void expr__add_id(struct expr_parse_ctx *ctx, const char *id, double val);
> +int expr__parse(double *final_val, struct expr_parse_ctx *ctx, const char *expr);
>  int expr__find_other(const char *expr, const char *one, const char ***other,
>  		int *num_other);
>  
> diff --git a/tools/perf/util/expr.y b/tools/perf/util/expr.y
> index 4720cbe79357..cd17486c1c5d 100644
> --- a/tools/perf/util/expr.y
> +++ b/tools/perf/util/expr.y
> @@ -15,7 +15,7 @@
>  %define api.pure full
>  
>  %parse-param { double *final_val }
> -%parse-param { struct parse_ctx *ctx }
> +%parse-param { struct expr_parse_ctx *ctx }
>  %parse-param {void *scanner}
>  %lex-param {void* scanner}
>  
> @@ -39,14 +39,14 @@
>  
>  %{
>  static void expr_error(double *final_val __maybe_unused,
> -		       struct parse_ctx *ctx __maybe_unused,
> +		       struct expr_parse_ctx *ctx __maybe_unused,
>  		       void *scanner,
>  		       const char *s)
>  {
>  	pr_debug("%s\n", s);
>  }
>  
> -static int lookup_id(struct parse_ctx *ctx, char *id, double *val)
> +static int lookup_id(struct expr_parse_ctx *ctx, char *id, double *val)
>  {
>  	int i;
>  
> diff --git a/tools/perf/util/stat-shadow.c b/tools/perf/util/stat-shadow.c
> index 0fd713d3674f..402af3e8d287 100644
> --- a/tools/perf/util/stat-shadow.c
> +++ b/tools/perf/util/stat-shadow.c
> @@ -729,7 +729,7 @@ static void generic_metric(struct perf_stat_config *config,
>  			   struct runtime_stat *st)
>  {
>  	print_metric_t print_metric = out->print_metric;
> -	struct parse_ctx pctx;
> +	struct expr_parse_ctx pctx;
>  	double ratio, scale;
>  	int i;
>  	void *ctxp = out->ctx;
> -- 
> 2.21.0
> 

-- 

- Arnaldo

WARNING: multiple messages have this Message-ID (diff)
From: Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>
To: Kajol Jain <kjain@linux.ibm.com>
Cc: mark.rutland@arm.com, maddy@linux.vnet.ibm.com,
	peterz@infradead.org, yao.jin@linux.intel.com, mingo@kernel.org,
	kan.liang@linux.intel.com, ak@linux.intel.com,
	alexander.shishkin@linux.intel.com, anju@linux.vnet.ibm.com,
	mamatha4@linux.vnet.ibm.com, sukadev@linux.vnet.ibm.com,
	ravi.bangoria@linux.ibm.com, jmario@redhat.com,
	namhyung@kernel.org, tglx@linutronix.de, mpetlan@redhat.com,
	gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
	linux-perf-users@vger.kernel.org, jolsa@kernel.org,
	linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v8 1/7] perf expr: Add expr_ prefix for parse_ctx and parse_id
Date: Mon, 6 Apr 2020 11:13:57 -0300	[thread overview]
Message-ID: <20200406141357.GG29826@kernel.org> (raw)
In-Reply-To: <20200401203340.31402-2-kjain@linux.ibm.com>

Em Thu, Apr 02, 2020 at 02:03:34AM +0530, Kajol Jain escreveu:
> From: Jiri Olsa <jolsa@kernel.org>
> 
> Adding expr_ prefix for parse_ctx and parse_id,
> to straighten out the expr* namespace.
> 
> There's no functional change.

Next time please add your Signed-off-by: as well when pushing 3rd party
patches.

Applied.

- Arnaldo
 
> Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> ---
>  tools/perf/tests/expr.c       |  4 ++--
>  tools/perf/util/expr.c        | 10 +++++-----
>  tools/perf/util/expr.h        | 12 ++++++------
>  tools/perf/util/expr.y        |  6 +++---
>  tools/perf/util/stat-shadow.c |  2 +-
>  5 files changed, 17 insertions(+), 17 deletions(-)
> 
> diff --git a/tools/perf/tests/expr.c b/tools/perf/tests/expr.c
> index 28313e59d6f6..ea10fc4412c4 100644
> --- a/tools/perf/tests/expr.c
> +++ b/tools/perf/tests/expr.c
> @@ -6,7 +6,7 @@
>  #include <string.h>
>  #include <linux/zalloc.h>
>  
> -static int test(struct parse_ctx *ctx, const char *e, double val2)
> +static int test(struct expr_parse_ctx *ctx, const char *e, double val2)
>  {
>  	double val;
>  
> @@ -22,7 +22,7 @@ int test__expr(struct test *t __maybe_unused, int subtest __maybe_unused)
>  	const char **other;
>  	double val;
>  	int i, ret;
> -	struct parse_ctx ctx;
> +	struct expr_parse_ctx ctx;
>  	int num_other;
>  
>  	expr__ctx_init(&ctx);
> diff --git a/tools/perf/util/expr.c b/tools/perf/util/expr.c
> index fd192ddf93c1..c8ccc548a585 100644
> --- a/tools/perf/util/expr.c
> +++ b/tools/perf/util/expr.c
> @@ -11,7 +11,7 @@ extern int expr_debug;
>  #endif
>  
>  /* Caller must make sure id is allocated */
> -void expr__add_id(struct parse_ctx *ctx, const char *name, double val)
> +void expr__add_id(struct expr_parse_ctx *ctx, const char *name, double val)
>  {
>  	int idx;
>  
> @@ -21,13 +21,13 @@ void expr__add_id(struct parse_ctx *ctx, const char *name, double val)
>  	ctx->ids[idx].val = val;
>  }
>  
> -void expr__ctx_init(struct parse_ctx *ctx)
> +void expr__ctx_init(struct expr_parse_ctx *ctx)
>  {
>  	ctx->num_ids = 0;
>  }
>  
>  static int
> -__expr__parse(double *val, struct parse_ctx *ctx, const char *expr,
> +__expr__parse(double *val, struct expr_parse_ctx *ctx, const char *expr,
>  	      int start)
>  {
>  	YY_BUFFER_STATE buffer;
> @@ -52,7 +52,7 @@ __expr__parse(double *val, struct parse_ctx *ctx, const char *expr,
>  	return ret;
>  }
>  
> -int expr__parse(double *final_val, struct parse_ctx *ctx, const char *expr)
> +int expr__parse(double *final_val, struct expr_parse_ctx *ctx, const char *expr)
>  {
>  	return __expr__parse(final_val, ctx, expr, EXPR_PARSE) ? -1 : 0;
>  }
> @@ -75,7 +75,7 @@ int expr__find_other(const char *expr, const char *one, const char ***other,
>  		     int *num_other)
>  {
>  	int err, i = 0, j = 0;
> -	struct parse_ctx ctx;
> +	struct expr_parse_ctx ctx;
>  
>  	expr__ctx_init(&ctx);
>  	err = __expr__parse(NULL, &ctx, expr, EXPR_OTHER);
> diff --git a/tools/perf/util/expr.h b/tools/perf/util/expr.h
> index 9377538f4097..b9e53f2b5844 100644
> --- a/tools/perf/util/expr.h
> +++ b/tools/perf/util/expr.h
> @@ -5,19 +5,19 @@
>  #define EXPR_MAX_OTHER 20
>  #define MAX_PARSE_ID EXPR_MAX_OTHER
>  
> -struct parse_id {
> +struct expr_parse_id {
>  	const char *name;
>  	double val;
>  };
>  
> -struct parse_ctx {
> +struct expr_parse_ctx {
>  	int num_ids;
> -	struct parse_id ids[MAX_PARSE_ID];
> +	struct expr_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);
> -int expr__parse(double *final_val, struct parse_ctx *ctx, const char *expr);
> +void expr__ctx_init(struct expr_parse_ctx *ctx);
> +void expr__add_id(struct expr_parse_ctx *ctx, const char *id, double val);
> +int expr__parse(double *final_val, struct expr_parse_ctx *ctx, const char *expr);
>  int expr__find_other(const char *expr, const char *one, const char ***other,
>  		int *num_other);
>  
> diff --git a/tools/perf/util/expr.y b/tools/perf/util/expr.y
> index 4720cbe79357..cd17486c1c5d 100644
> --- a/tools/perf/util/expr.y
> +++ b/tools/perf/util/expr.y
> @@ -15,7 +15,7 @@
>  %define api.pure full
>  
>  %parse-param { double *final_val }
> -%parse-param { struct parse_ctx *ctx }
> +%parse-param { struct expr_parse_ctx *ctx }
>  %parse-param {void *scanner}
>  %lex-param {void* scanner}
>  
> @@ -39,14 +39,14 @@
>  
>  %{
>  static void expr_error(double *final_val __maybe_unused,
> -		       struct parse_ctx *ctx __maybe_unused,
> +		       struct expr_parse_ctx *ctx __maybe_unused,
>  		       void *scanner,
>  		       const char *s)
>  {
>  	pr_debug("%s\n", s);
>  }
>  
> -static int lookup_id(struct parse_ctx *ctx, char *id, double *val)
> +static int lookup_id(struct expr_parse_ctx *ctx, char *id, double *val)
>  {
>  	int i;
>  
> diff --git a/tools/perf/util/stat-shadow.c b/tools/perf/util/stat-shadow.c
> index 0fd713d3674f..402af3e8d287 100644
> --- a/tools/perf/util/stat-shadow.c
> +++ b/tools/perf/util/stat-shadow.c
> @@ -729,7 +729,7 @@ static void generic_metric(struct perf_stat_config *config,
>  			   struct runtime_stat *st)
>  {
>  	print_metric_t print_metric = out->print_metric;
> -	struct parse_ctx pctx;
> +	struct expr_parse_ctx pctx;
>  	double ratio, scale;
>  	int i;
>  	void *ctxp = out->ctx;
> -- 
> 2.21.0
> 

-- 

- Arnaldo

  reply	other threads:[~2020-04-06 14:13 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-01 20:33 [PATCH v8 0/7] powerpc/perf: Add json file metric support for the hv_24x7 socket/chip level events Kajol Jain
2020-04-01 20:33 ` Kajol Jain
2020-04-01 20:33 ` [PATCH v8 1/7] perf expr: Add expr_ prefix for parse_ctx and parse_id Kajol Jain
2020-04-01 20:33   ` Kajol Jain
2020-04-06 14:13   ` Arnaldo Carvalho de Melo [this message]
2020-04-06 14:13     ` Arnaldo Carvalho de Melo
2020-04-07  7:11     ` kajoljain
2020-04-07  7:11       ` kajoljain
2020-04-22 12:17   ` [tip: perf/core] " tip-bot2 for Jiri Olsa
2020-04-22 12:17     ` tip-bot2 for Jiri Olsa
2020-04-01 20:33 ` [PATCH v8 2/7] perf expr: Add expr_scanner_ctx object Kajol Jain
2020-04-01 20:33   ` Kajol Jain
2020-04-22 12:17   ` [tip: perf/core] " tip-bot2 for Jiri Olsa
2020-04-22 12:17     ` tip-bot2 for Jiri Olsa
2020-04-01 20:33 ` [PATCH v8 3/7] perf/tools: Refactoring metricgroup__add_metric function Kajol Jain
2020-04-01 20:33   ` Kajol Jain
2020-04-22 12:17   ` [tip: perf/core] perf metrictroup: Split the " tip-bot2 for Kajol Jain
2020-04-22 12:17     ` tip-bot2 for Kajol Jain
2020-04-01 20:33 ` [PATCH v8 4/7] perf/tools: Enhance JSON/metric infrastructure to handle "?" Kajol Jain
2020-04-01 20:33   ` Kajol Jain
2020-05-01 15:56   ` Ian Rogers
2020-05-01 15:56     ` Ian Rogers
2020-05-01 15:56     ` Ian Rogers
2020-05-08 13:05   ` [tip: perf/core] perf metricgroups: " tip-bot2 for Kajol Jain
2020-05-08 13:05     ` tip-bot2 for Kajol Jain
2020-04-01 20:33 ` [PATCH v8 5/7] perf/tests/expr: Added test for runtime param in metric expression Kajol Jain
2020-04-01 20:33   ` Kajol Jain
2020-05-08 13:05   ` [tip: perf/core] perf tests expr: " tip-bot2 for Kajol Jain
2020-05-08 13:05     ` tip-bot2 for Kajol Jain
2020-04-01 20:33 ` [PATCH v8 6/7] tools/perf: Enable Hz/hz prinitg for --metric-only option Kajol Jain
2020-04-01 20:33   ` Kajol Jain
2020-04-02 12:49   ` Jiri Olsa
2020-04-02 12:49     ` Jiri Olsa
2020-04-02 20:42     ` Andi Kleen
2020-04-02 20:42       ` Andi Kleen
2020-05-08 13:05   ` [tip: perf/core] perf tools: " tip-bot2 for Kajol Jain
2020-05-08 13:05     ` tip-bot2 for Kajol Jain
2020-04-01 20:33 ` [PATCH v8 7/7] perf/tools/pmu-events/powerpc: Add hv_24x7 socket/chip level metric events Kajol Jain
2020-04-01 20:33   ` Kajol Jain
2020-05-08 13:05   ` [tip: perf/core] perf vendor events power9: " tip-bot2 for Kajol Jain
2020-05-08 13:05     ` tip-bot2 for Kajol Jain
2020-04-02 21:27 ` [PATCH v8 0/7] powerpc/perf: Add json file metric support for the hv_24x7 socket/chip level events Jiri Olsa
2020-04-02 21:27   ` Jiri Olsa
2020-04-28  6:32 ` kajoljain
2020-04-28  6:32   ` kajoljain
2020-04-29 14:46   ` Arnaldo Carvalho de Melo
2020-04-29 14:46     ` Arnaldo Carvalho de Melo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200406141357.GG29826@kernel.org \
    --to=arnaldo.melo@gmail.com \
    --cc=ak@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=anju@linux.vnet.ibm.com \
    --cc=benh@kernel.crashing.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jmario@redhat.com \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@linux.intel.com \
    --cc=kjain@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maddy@linux.vnet.ibm.com \
    --cc=mamatha4@linux.vnet.ibm.com \
    --cc=mark.rutland@arm.com \
    --cc=mingo@kernel.org \
    --cc=mpe@ellerman.id.au \
    --cc=mpetlan@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=paulus@ozlabs.org \
    --cc=peterz@infradead.org \
    --cc=ravi.bangoria@linux.ibm.com \
    --cc=sukadev@linux.vnet.ibm.com \
    --cc=tglx@linutronix.de \
    --cc=yao.jin@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.