Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp647218ybz; Wed, 22 Apr 2020 05:26:02 -0700 (PDT) X-Google-Smtp-Source: APiQypKg8sSg3TiqlWthrsj9TXjya9VO7aES/bs0jk1i1CKbIOqI4TZeiu060HWc+O9tICqw1Fec X-Received: by 2002:a17:906:c839:: with SMTP id dd25mr25336054ejb.164.1587558362310; Wed, 22 Apr 2020 05:26:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587558362; cv=none; d=google.com; s=arc-20160816; b=mqkuNbBJFec4knMTGZnemwkQu0BqViCdsv0e/Q9ePv5f/70Sov9fHs3gCCCPP2EsYV uf2IfCkfGvGQWJDaKMjCdE0VP3VRA0c4LLmwASWg2OSXggIPlKSMBs5rCm1v42ZTKgTd 1vqwEFY6cCO7DjDqyPZCiGS5zNDTUtSbt54ZJyo+3HayU/uA4Nu6VNO07Iz/ZBLGsI8t 4OGiSaSyJbIVw0BjeKp6ZFOj4xyXWEwdttOzoeDV/LqutWEy9BWoaWRQemn9F7vYelzy bFNYyRrPohtYNyZ4PWVmJimzq5m3GcNMv1YRtlmkX6db6qnqWwHPwyQOr23Wuem/d0Zc DDuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :robot-unsubscribe:robot-id:message-id:mime-version:references :in-reply-to:cc:subject:to:reply-to:from:date; bh=lrFz8eAoAqQ9D6WZ28f+SzCCEWgp0udG48BuU5G7nwU=; b=NXwnJz+cy6Fj4Q0DbHUPrxovejfOAOCckHWGzfvGtSTI5QL589RJH40/orMiwtmqnn nAS5k487QPx5QXWXdKOL61FZOL7nxYJ7b2ZDLTv+AE2qKnDdiBqbTwbWbKNpazMMyE56 rJOmZ6ACtPVBp5KBROhGTwtOL/+ioTHQ31yeGW0Vol86cnQ5qFTztq3SoRiUF2HwzzEB 3TAiWkVxrJWw/GnLvECgIF2vgOxu5juEL8SU4JX19Dz5fyUeH/kJdB6pDtCmzpGdh//X RGM6k/XRGtZdXv4OyQCZsyMmu7CF7diaXmrrwwEeAerjfNYMIrUn9JsrE+FlKxnQuBTb glNA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k11si3409491edx.311.2020.04.22.05.25.38; Wed, 22 Apr 2020 05:26:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728903AbgDVMTu (ORCPT + 99 others); Wed, 22 Apr 2020 08:19:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728872AbgDVMRy (ORCPT ); Wed, 22 Apr 2020 08:17:54 -0400 Received: from Galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90800C03C1AB; Wed, 22 Apr 2020 05:17:54 -0700 (PDT) Received: from [5.158.153.53] (helo=tip-bot2.lab.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1jREJr-0007u5-50; Wed, 22 Apr 2020 14:17:35 +0200 Received: from [127.0.1.1] (localhost [IPv6:::1]) by tip-bot2.lab.linutronix.de (Postfix) with ESMTP id 627A51C04CD; Wed, 22 Apr 2020 14:17:29 +0200 (CEST) Date: Wed, 22 Apr 2020 12:17:29 -0000 From: "tip-bot2 for Jiri Olsa" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: perf/core] perf expr: Add expr_ prefix for parse_ctx and parse_id Cc: Jiri Olsa , Alexander Shishkin , Andi Kleen , Anju T Sudhakar , Benjamin Herrenschmidt , "Greg Kroah-Hartman" , Jin Yao , Joe Mario , Kajol Jain , Kan Liang , Madhavan Srinivasan , Mamatha Inamdar , Mark Rutland , Michael Ellerman , Michael Petlan , Namhyung Kim , Paul Mackerras , Peter Zijlstra , Ravi Bangoria , Sukadev Bhattiprolu , Thomas Gleixner , linuxppc-dev@lists.ozlabs.org, Arnaldo Carvalho de Melo , x86 , LKML In-Reply-To: <20200401203340.31402-2-kjain@linux.ibm.com> References: <20200401203340.31402-2-kjain@linux.ibm.com> MIME-Version: 1.0 Message-ID: <158755784901.28353.11635773468936681149.tip-bot2@tip-bot2> X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the perf/core branch of tip: Commit-ID: aecce63e2b98f28606b063949cca06facf215d6c Gitweb: https://git.kernel.org/tip/aecce63e2b98f28606b063949cca06facf215d6c Author: Jiri Olsa AuthorDate: Thu, 02 Apr 2020 02:03:34 +05:30 Committer: Arnaldo Carvalho de Melo CommitterDate: Thu, 16 Apr 2020 12:19:13 -03:00 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 Cc: Alexander Shishkin Cc: Andi Kleen Cc: Anju T Sudhakar Cc: Benjamin Herrenschmidt Cc: Greg Kroah-Hartman Cc: Jin Yao Cc: Joe Mario Cc: Kajol Jain Cc: Kan Liang Cc: Madhavan Srinivasan Cc: Mamatha Inamdar Cc: Mark Rutland Cc: Michael Ellerman Cc: Michael Petlan Cc: Namhyung Kim Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Sukadev Bhattiprolu Cc: Thomas Gleixner 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 --- 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 28313e5..ea10fc4 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 fd192dd..c8ccc54 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 9377538..b9e53f2 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 4720cbe..cd17486 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 03ecb8c..1ad5c5b 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;