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] [day] [month] [year] [list]
Message-ID: <BY3PR17MB518624354091DB1B4FB7A7FCA5A1A@BY3PR17MB5186.namprd17.prod.outlook.com>
Date: Thu, 11 Dec 2025 01:12:34 +0000
From: "Jayaramappa, Srilakshmi" <sjayaram@...mai.com>
To: Ian Rogers <irogers@...gle.com>, Guilherme Amadio <amadio@...too.org>,
        Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        Namhyung Kim
	<namhyung@...nel.org>,
        Alexander Shishkin
	<alexander.shishkin@...ux.intel.com>,
        Jiri Olsa <jolsa@...nel.org>,
        "Adrian
 Hunter" <adrian.hunter@...el.com>,
        "linux-perf-users@...r.kernel.org"
	<linux-perf-users@...r.kernel.org>,
        "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v1] perf test subcmd help: Add exclude disjoint subcmd
 names


________________________________________
From: Ian Rogers <irogers@...gle.com>
Sent: Monday, December 8, 2025 9:23 AM
To: Jayaramappa, Srilakshmi; Guilherme Amadio; Peter Zijlstra; Ingo Molnar; Arnaldo Carvalho de Melo; Namhyung Kim; Alexander Shishkin; Jiri Olsa; Ian Rogers; Adrian Hunter; linux-perf-users@...r.kernel.org; linux-kernel@...r.kernel.org
Subject: [PATCH v1] perf test subcmd help: Add exclude disjoint subcmd names

!-------------------------------------------------------------------|
  This Message Is From an External Sender
  This message came from outside your organization.
|-------------------------------------------------------------------!

The test is based on an error/fix poseted to linux-perf-users.

Reported-by: Sri Jayaramappa <sjayaram@...mai.com>
Closes: https://urldefense.com/v3/__https://lore.kernel.org/linux-perf-users/20251202213632.2873731-1-sjayaram@akamai.com/__;!!GjvTz_vk!XehekKNUE4Ib_tvqIH6PMIIhly4X3BZ-Y40RC1HKMQ-6OdYEFvUPQhyWv_gk9vsRRN4_RcOLS2Bh0CQ$
Signed-off-by: Ian Rogers <irogers@...gle.com>
---
 tools/perf/tests/subcmd-help.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/tools/perf/tests/subcmd-help.c b/tools/perf/tests/subcmd-help.c
index 2280b4c0e5e7..9da96a16fd20 100644
--- a/tools/perf/tests/subcmd-help.c
+++ b/tools/perf/tests/subcmd-help.c
@@ -95,10 +95,36 @@ static int test__exclude_cmdnames(struct test_suite *test __maybe_unused,
        return TEST_OK;
 }

+static int test__exclude_cmdnames_no_overlap(struct test_suite *test __maybe_unused,
+                                            int subtest __maybe_unused)
+{
+       struct cmdnames cmds1 = {};
+       struct cmdnames cmds2 = {};
+
+       add_cmdname(&cmds1, "read-vdso32", 11);
+       add_cmdname(&cmds2, "archive", 7);
+
+       TEST_ASSERT_VAL("invalid original size", cmds1.cnt == 1);
+       TEST_ASSERT_VAL("invalid original size", cmds2.cnt == 1);
+
+       exclude_cmds(&cmds1, &cmds2);
+
+       TEST_ASSERT_VAL("invalid excluded size", cmds1.cnt == 1);
+       TEST_ASSERT_VAL("invalid excluded size", cmds2.cnt == 1);
+
+       TEST_ASSERT_VAL("cannot find cmd", is_in_cmdlist(&cmds1, "read-vdso32") == 1);
+       TEST_ASSERT_VAL("wrong cmd", is_in_cmdlist(&cmds1, "archive") == 0);
+
+       clean_cmdnames(&cmds1);
+       clean_cmdnames(&cmds2);
+       return TEST_OK;
+}
+
 static struct test_case tests__subcmd_help[] = {
        TEST_CASE("Load subcmd names", load_cmdnames),
        TEST_CASE("Uniquify subcmd names", uniq_cmdnames),
        TEST_CASE("Exclude duplicate subcmd names", exclude_cmdnames),
+       TEST_CASE("Exclude disjoint subcmd names", exclude_cmdnames_no_overlap),
        {       .name = NULL, }
 };

--
2.52.0.223.gf5cc29aaa4-goog


Reviewed-by: Sri Jayaramappa <sjayaram@...mai.com>

Looks good, thank you !

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ