From patchwork Fri May 8 13:05:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Linus Walleij X-Patchwork-Id: 1286135 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49JWMJ3Rc9z9sW2 for ; Fri, 8 May 2020 23:26:52 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linutronix.de Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 49JWMG1TQGzDr5h for ; Fri, 8 May 2020 23:26:50 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=linutronix.de (client-ip=2a0a:51c0:0:12e:550::1; helo=galois.linutronix.de; envelope-from=tip-bot2@linutronix.de; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=linutronix.de Received: from Galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) (using TLSv1.2 with cipher DHE-RSA-AES256-SHA256 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 49JVtr4nV8zDqHf for ; Fri, 8 May 2020 23:05:38 +1000 (AEST) 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 1jX2gu-0007lm-KB; Fri, 08 May 2020 15:05:24 +0200 Received: from [127.0.1.1] (localhost [IPv6:::1]) by tip-bot2.lab.linutronix.de (Postfix) with ESMTP id 5735A1C0852; Fri, 8 May 2020 15:05:08 +0200 (CEST) Date: Fri, 08 May 2020 13:05:08 -0000 From: "tip-bot2 for Kajol Jain" To: linux-tip-commits@vger.kernel.org Subject: [tip: perf/core] perf tests expr: Added test for runtime param in metric expression In-Reply-To: <20200401203340.31402-6-kjain@linux.ibm.com> References: <20200401203340.31402-6-kjain@linux.ibm.com> MIME-Version: 1.0 Message-ID: <158894310825.8414.975904064383982223.tip-bot2@tip-bot2> X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk 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 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: linux-kernel@vger.kernel.org Cc: Mark Rutland , Madhavan Srinivasan , Peter Zijlstra , Jin Yao , Jiri Olsa , Kan Liang , Andi Kleen , x86 , Alexander Shishkin , Anju T Sudhakar , Mamatha Inamdar , Sukadev Bhattiprolu , Ravi Bangoria , Kajol Jain , Arnaldo Carvalho de Melo , Joe Mario , Namhyung Kim , Thomas Gleixner , Michael Petlan , Greg Kroah-Hartman , LKML , linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" The following commit has been merged into the perf/core branch of tip: Commit-ID: 9022608ec5babbb0fa631234098d52895e7e34d8 Gitweb: https://git.kernel.org/tip/9022608ec5babbb0fa631234098d52895e7e34d8 Author: Kajol Jain AuthorDate: Thu, 02 Apr 2020 02:03:38 +05:30 Committer: Arnaldo Carvalho de Melo CommitterDate: Thu, 30 Apr 2020 10:48:33 -03:00 perf tests expr: Added test for runtime param in metric expression Added test case for parsing "?" in metric expression. Signed-off-by: Kajol Jain Acked-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: 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-6-kjain@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/tests/expr.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/perf/tests/expr.c b/tools/perf/tests/expr.c index 516504c..f9e8e56 100644 --- a/tools/perf/tests/expr.c +++ b/tools/perf/tests/expr.c @@ -59,6 +59,14 @@ int test__expr(struct test *t __maybe_unused, int subtest __maybe_unused) TEST_ASSERT_VAL("find other", !strcmp(other[2], "BOZO")); TEST_ASSERT_VAL("find other", other[3] == NULL); + TEST_ASSERT_VAL("find other", + expr__find_other("EVENT1\\,param\\=?@ + EVENT2\\,param\\=?@", NULL, + &other, &num_other, 3) == 0); + TEST_ASSERT_VAL("find other", num_other == 2); + TEST_ASSERT_VAL("find other", !strcmp(other[0], "EVENT1,param=3/")); + TEST_ASSERT_VAL("find other", !strcmp(other[1], "EVENT2,param=3/")); + TEST_ASSERT_VAL("find other", other[2] == NULL); + for (i = 0; i < num_other; i++) zfree(&other[i]); free((void *)other);