lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu,  2 Apr 2020 02:03:38 +0530
From:   Kajol Jain <kjain@...ux.ibm.com>
To:     acme@...nel.org, linuxppc-dev@...ts.ozlabs.org, mpe@...erman.id.au,
        sukadev@...ux.vnet.ibm.com
Cc:     linux-kernel@...r.kernel.org, linux-perf-users@...r.kernel.org,
        anju@...ux.vnet.ibm.com, maddy@...ux.vnet.ibm.com,
        ravi.bangoria@...ux.ibm.com, peterz@...radead.org,
        yao.jin@...ux.intel.com, ak@...ux.intel.com, jolsa@...nel.org,
        kan.liang@...ux.intel.com, jmario@...hat.com,
        alexander.shishkin@...ux.intel.com, mingo@...nel.org,
        paulus@...abs.org, namhyung@...nel.org, mpetlan@...hat.com,
        gregkh@...uxfoundation.org, benh@...nel.crashing.org,
        mamatha4@...ux.vnet.ibm.com, mark.rutland@....com,
        tglx@...utronix.de, kjain@...ux.ibm.com
Subject: [PATCH v8 5/7] perf/tests/expr: Added test for runtime param in metric expression

Added test case for parsing  "?" in metric expression.

Signed-off-by: Kajol Jain <kjain@...ux.ibm.com>
---
 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 516504cf0ea5..f9e8e5628836 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);
-- 
2.21.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ