Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3348740ybb; Mon, 6 Apr 2020 07:16:22 -0700 (PDT) X-Google-Smtp-Source: APiQypKCxO3P1PfyKwJgsjz6hgFLJ79EmZ5swEZc3poNeKhdppv6OcTdYk5wHt18JmRvrqBM6Qz1 X-Received: by 2002:a9d:65d3:: with SMTP id z19mr2745177oth.314.1586182581998; Mon, 06 Apr 2020 07:16:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586182581; cv=none; d=google.com; s=arc-20160816; b=d15qvDbko9uZ2pwVybgCZTsQuz7HewNjZoEB2bNHr0Jk1BtHN/SNYoQ5zwiIQWwBao MSB9FIc46LOEUiun2c7yN0bSawIqAv3We6PACoDX7othIv+ry5CEmBlMX+9R0oUaldWZ HBLej9WbuFau4GCPhljZ82nTML6mlNhbqNEnUg7dW7wrB7265dMdn2vOrMFvKANmLTWU gydH5Nzakoyxl+EbYlX8WSlJmjIU2Is3GPqv6Nv/oZzv47Faj2Ec/zKIziPruRFXlEVR B8usVGlsZy89nSx8yEP3DAJnEgbRwQPgRDgTSTI1I22lHEKc5iOOKo0fMYL/NeNA6j7P YekA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:date:from :dkim-signature; bh=R0Dkto3Ot48r4LAZirJdCjJm2TIVdoamwirZwpn+9cw=; b=OIXhQBxqDr7h/eanLog2/q2sG/6YYyAi+p6FQCYiR0wG9sCSu7XfJierwJw1DgwBaW e468Mg7JwMXYq0oeQSnlFEbWFDwjIF7OBmEU/wekdQqSPEVgD7BRUproQv2sz6Ek6cIq 8qzapYKjWSWLihExi7a4pcwpvdqw73dxcS/+6XlhrNq+hRGnn0aa2D5Iq/plCIwiVPJV 0axItQ80PvoVTY4k4c2s/GKlaChHYc5+2xASRbGWpUNE6nALazrcc/Udp6JHYO4gLxY9 lADiun1OhmiyQuQxe9Lasz0RxBoGg2P+gDYmCLN2osErxxZQDY/J2aIBoJsqcoG/M24/ 9KSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jcx1bcE+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e24si7915897ooh.57.2020.04.06.07.16.08; Mon, 06 Apr 2020 07:16:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jcx1bcE+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728665AbgDFOOD (ORCPT + 99 others); Mon, 6 Apr 2020 10:14:03 -0400 Received: from mail-qv1-f68.google.com ([209.85.219.68]:37050 "EHLO mail-qv1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728558AbgDFOOC (ORCPT ); Mon, 6 Apr 2020 10:14:02 -0400 Received: by mail-qv1-f68.google.com with SMTP id n1so7559320qvz.4; Mon, 06 Apr 2020 07:14:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=R0Dkto3Ot48r4LAZirJdCjJm2TIVdoamwirZwpn+9cw=; b=jcx1bcE+a0LgJPXgP9nl9JzqNgJqVUUBtXhNmKY84/JIT5MP+YEoV0pzYdhGJ74g4I FR7P8JUeHNeXRPkEW9RavpxyoBRZ/NYBGdzMwUyRcF2dsfIbuJQ3JIfOwI49IRgfvPp2 sI+ykJEfGDfSIa0l3a9fahD1j5huAGIK4IJIZqZAxrx64yG74pe/eWDuf2lZTXZNNN0R aIWtKzPVWoF6hgPhXBtdvIPeWSCMitN/vXDd/qgFDT3w+hF2yhBnZQLUeeCSBRm0NoTM yJ2gnHUA6KeNPEc5u9x+UKsRaoAJL7dGmwBMy5TRhkhHCkaEyLl0C1afgCZzKeE+nGU5 KAuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=R0Dkto3Ot48r4LAZirJdCjJm2TIVdoamwirZwpn+9cw=; b=oJWd/LFS5EZpWQtqvQrAa8s1m6+us0RhW7XHZLc/d3yrJhiLFtojWY16DS8a1iHONH 4b67Pa5Hyicxhc6emlLb+cjss5kIp4NjLow1/G8bMTV+1uWCwdugylosRifGaivXmgZ1 eHsrxeExaM80lyUMzXIAxcdpEvLOd+zco2g30/+53KaoSDzXy/GgDLm/vTzMgU5d91S9 2ZJgNiuOr5T0RKa6+yAJ92RnP14t+eV45rWmH6T3KT31B2wcJwjuPYDRHyqrsN8P5VGR VngD3YLMqtlcQv+5k/8sWIuDigWPObpLemFjElAB9nw6xjuoLWAHQCObti5GGzQb2pu/ qv5A== X-Gm-Message-State: AGi0PuZR+fLOfUS7tQK29AMWIgTBOBhiVWWqDLEg0A9WanQ18Q5hK0Im sX2mro+3KSIdAsSBI/361dU= X-Received: by 2002:a0c:f207:: with SMTP id h7mr20287593qvk.20.1586182440215; Mon, 06 Apr 2020 07:14:00 -0700 (PDT) Received: from quaco.ghostprotocols.net ([179.97.37.151]) by smtp.gmail.com with ESMTPSA id g201sm14740449qke.99.2020.04.06.07.13.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Apr 2020 07:13:59 -0700 (PDT) From: Arnaldo Carvalho de Melo X-Google-Original-From: Arnaldo Carvalho de Melo Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 6983D409A3; Mon, 6 Apr 2020 11:13:57 -0300 (-03) Date: Mon, 6 Apr 2020 11:13:57 -0300 To: Kajol Jain 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 Message-ID: <20200406141357.GG29826@kernel.org> References: <20200401203340.31402-1-kjain@linux.ibm.com> <20200401203340.31402-2-kjain@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200401203340.31402-2-kjain@linux.ibm.com> X-Url: http://acmel.wordpress.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Thu, Apr 02, 2020 at 02:03:34AM +0530, Kajol Jain escreveu: > From: Jiri Olsa > > 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 > --- > 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 > #include > > -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