get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/2217929/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2217929,
    "url": "http://patchwork.ozlabs.org/api/patches/2217929/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/ltp/patch/20260331015538.53326-1-lufei@uniontech.com/",
    "project": {
        "id": 59,
        "url": "http://patchwork.ozlabs.org/api/projects/59/?format=api",
        "name": "Linux Test Project development",
        "link_name": "ltp",
        "list_id": "ltp.lists.linux.it",
        "list_email": "ltp@lists.linux.it",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20260331015538.53326-1-lufei@uniontech.com>",
    "list_archive_url": null,
    "date": "2026-03-31T01:55:38",
    "name": "[v3] Rewrite ftrace_regression tests with new C API",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "31df26019633a7b3b2200370d0471ae8cc4f5c18",
    "submitter": {
        "id": 88121,
        "url": "http://patchwork.ozlabs.org/api/people/88121/?format=api",
        "name": "lufei",
        "email": "lufei@uniontech.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/ltp/patch/20260331015538.53326-1-lufei@uniontech.com/mbox/",
    "series": [
        {
            "id": 498117,
            "url": "http://patchwork.ozlabs.org/api/series/498117/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/ltp/list/?series=498117",
            "date": "2026-03-31T01:55:38",
            "name": "[v3] Rewrite ftrace_regression tests with new C API",
            "version": 3,
            "mbox": "http://patchwork.ozlabs.org/series/498117/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2217929/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2217929/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "ltp@lists.linux.it"
        ],
        "Delivered-To": [
            "patchwork-incoming@legolas.ozlabs.org",
            "ltp@picard.linux.it"
        ],
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n unprotected) header.d=uniontech.com header.i=@uniontech.com\n header.a=rsa-sha256 header.s=onoh2408 header.b=TmSjqdzS;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it\n (client-ip=2001:1418:10:5::2; helo=picard.linux.it;\n envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it;\n receiver=patchwork.ozlabs.org)"
        ],
        "Received": [
            "from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4flB6W4zt6z1yGH\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 31 Mar 2026 12:56:01 +1100 (AEDT)",
            "from picard.linux.it (localhost [IPv6:::1])\n\tby picard.linux.it (Postfix) with ESMTP id 07F7F3E9319\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 31 Mar 2026 03:55:58 +0200 (CEST)",
            "from in-5.smtp.seeweb.it (in-5.smtp.seeweb.it\n [IPv6:2001:4b78:1:20::5])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature ECDSA (secp384r1))\n (No client certificate requested)\n by picard.linux.it (Postfix) with ESMTPS id F0B9A3CB8BA\n for <ltp@lists.linux.it>; Tue, 31 Mar 2026 03:55:52 +0200 (CEST)",
            "from smtpbguseast1.qq.com (smtpbguseast1.qq.com [54.204.34.129])\n (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n (No client certificate requested)\n by in-5.smtp.seeweb.it (Postfix) with ESMTPS id 1ADA1600713\n for <ltp@lists.linux.it>; Tue, 31 Mar 2026 03:55:50 +0200 (CEST)",
            "from localhost.localdomain ( [1.85.7.34])\n by bizesmtp.qq.com (ESMTP) with\n id ; Tue, 31 Mar 2026 09:55:42 +0800 (CST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=uniontech.com;\n s=onoh2408; t=1774922147;\n bh=Q3RBl+AbVRYnyg6S05wrshviCgjpmi0MWAoZdRxMh1Q=;\n h=From:To:Subject:Date:Message-Id:MIME-Version;\n b=TmSjqdzSCS5wf4Urj6Z3KIkfxH32HptrBsX51UZOOgB99P0DMAF7v7/FWjRUqVjNq\n OIpYyddNVpm1oW75qMAImSSFgDCnVfSojIqmM2dqCn3/Rm0hNxt1fArDbfIEoRcvS4\n hDa2aGqd4MEO7SFihqNo/IC63/7OPe7cFp7CJuLY=",
        "X-QQ-mid": "esmtpsz11t1774922144t84c96df7",
        "X-QQ-Originating-IP": "riXMWeUfoh5Mrr7xt3gl+Jle89vzGoBe3+RFjNhiJdI=",
        "X-QQ-SSF": "0000000000000000000000000000000",
        "X-QQ-GoodBg": "0",
        "X-BIZMAIL-ID": "6793847804531186962",
        "EX-QQ-RecipientCnt": "3",
        "From": "lufei <lufei@uniontech.com>",
        "To": "ltp@lists.linux.it",
        "Date": "Tue, 31 Mar 2026 09:55:38 +0800",
        "Message-Id": "<20260331015538.53326-1-lufei@uniontech.com>",
        "X-Mailer": "git-send-email 2.39.3",
        "In-Reply-To": "<20260330071554.49304-1-lufei@uniontech.com>",
        "References": "<20260330071554.49304-1-lufei@uniontech.com>",
        "MIME-Version": "1.0",
        "X-QQ-SENDSIZE": "520",
        "Feedback-ID": "esmtpsz:uniontech.com:qybglogicsvrgz:qybglogicsvrgz3a-1",
        "X-QQ-XMAILINFO": "NBhX117m75pMI85oE4Uc9WJpnVfJnYWi6iDzu34BCkc/43cl55BT+VIX\n Foe+LA0ke5R9L0Ed7/mmhZQNaRFg99e4W5/KA+Lekagj5HbHHI7Y2wc6E8AUvM90vmIKZuq\n GAwC+9ul7fU1ETvSn6Istgnb63EuYXKYse7qn+gRPzDi+rk/lb1JFUpe6lnSjGg0d18UtGM\n ZMsKmULoZ7h6Qrc8Rqt1/9ADmif30eOgrytn+TK9DfSpIyePtEtkQbf0v6Z+eZrhe5tWr5K\n MuzC9irZ5HPCSFndrU2MUF03xYj98VsUll02b+RnsahTFMqZqyytULkdcamrtA2HqFuCvwb\n qC8AO/sffBbAA/S0IQBZMRjqdJADmIWkb1bs4UlxJuxofpkCi3IXxOvrj0Li2NW7Q/HZU+S\n p979OMVnL7S1ZKJdiiObaNg7LJQGmFETIrSq7lap33z+17Hu1YsBcaAuMG99vVh83X0gNCM\n mlenuC/LEb3eU6d5PLY6F3iW+O3Wjx1NMsNSRYgnPgJPmV1k4M6GnbZodnjiJrwIMC/7Rtj\n QYlIwqqwyZ/5Wsn3zDJ9/zpOm6dJ9Z/YINHcgpoTgxbc2yGdiaZANPecozA9HgoqPckrw6A\n yDdGFRl0YBJ9TcQPBN5K3IFCBMSBaRJ4INmDihGsrdzMhxE+LjCy2jQkNhwcd36zQ40ZpD8\n 2/1Yaiz/DFcpSHgiKhhP1bCxEbbC3OJ7JaU2hfpVxVs79QVxuuFScpa7U1AEvRaQZCMBMo/\n UBBraAgRY0xcEuqtjJvTchJdC6IN8zJJgyR9Jhcl3u13b1Rm0OQk4Lpi9LVtthhT/8abAfQ\n Ea0KYAYQSa/doXUT2FJYdVltN9TmbQ1ExkqDeqo4xpDlgK2UE1MYAY/QCdrb24NGVv9dKsB\n riXUo5D+evxUFSKqYJDhVXCuxXfqqCTwlm4HGfXvZPhSOFiNL9sj2r1JWGNR3UaRr2trjRN\n ZOBD44gmpQdQ4tsOvaePNJHHZ4jby/DjqOU2yVkuheGku75moVc5wU21wxpH7IAqGJsROMB\n Ytxt8fbw4tIj7FTdU78GEKUhlN0VA=",
        "X-QQ-XMRINFO": "NI4Ajvh11aEjEMj13RCX7UuhPEoou2bs1g==",
        "X-QQ-RECHKSPAM": "0",
        "X-Spam-Status": "No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID,\n DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS shortcircuit=no\n autolearn=disabled version=4.0.1",
        "X-Spam-Checker-Version": "SpamAssassin 4.0.1 (2024-03-25) on in-5.smtp.seeweb.it",
        "X-Virus-Scanned": "clamav-milter 1.0.9 at in-5.smtp.seeweb.it",
        "X-Virus-Status": "Clean",
        "Subject": "[LTP] [PATCH v3] Rewrite ftrace_regression tests with new C API",
        "X-BeenThere": "ltp@lists.linux.it",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "Linux Test Project <ltp.lists.linux.it>",
        "List-Unsubscribe": "<https://lists.linux.it/options/ltp>,\n <mailto:ltp-request@lists.linux.it?subject=unsubscribe>",
        "List-Archive": "<http://lists.linux.it/pipermail/ltp/>",
        "List-Post": "<mailto:ltp@lists.linux.it>",
        "List-Help": "<mailto:ltp-request@lists.linux.it?subject=help>",
        "List-Subscribe": "<https://lists.linux.it/listinfo/ltp>,\n <mailto:ltp-request@lists.linux.it?subject=subscribe>",
        "Cc": "lufei <lufei@uniontech.com>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it",
        "Sender": "\"ltp\" <ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it>"
    },
    "content": "Rewritten from old shell scripts.\n\nftrace_regression01: regression test for panic bug while using\nuserstacktrace, set userstacktrace in loop and check if success.\n\nftrace_regression02: for checking signal:signal_generate gives\n2 more fields: grp res.\n\nSigned-off-by: lufei <lufei@uniontech.com>\n---\n runtest/tracing                               |  4 +-\n .../kernel/tracing/ftrace_test/.gitignore     |  2 +\n testcases/kernel/tracing/ftrace_test/Makefile |  3 +-\n .../tracing/ftrace_test/ftrace_regression.h   | 49 +++++++++++\n .../tracing/ftrace_test/ftrace_regression01.c | 88 +++++++++++++++++++\n .../ftrace_test/ftrace_regression01.sh        | 83 -----------------\n .../tracing/ftrace_test/ftrace_regression02.c | 68 ++++++++++++++\n .../ftrace_test/ftrace_regression02.sh        | 63 -------------\n 8 files changed, 211 insertions(+), 149 deletions(-)\n create mode 100644 testcases/kernel/tracing/ftrace_test/.gitignore\n create mode 100644 testcases/kernel/tracing/ftrace_test/ftrace_regression.h\n create mode 100644 testcases/kernel/tracing/ftrace_test/ftrace_regression01.c\n delete mode 100755 testcases/kernel/tracing/ftrace_test/ftrace_regression01.sh\n create mode 100644 testcases/kernel/tracing/ftrace_test/ftrace_regression02.c\n delete mode 100755 testcases/kernel/tracing/ftrace_test/ftrace_regression02.sh",
    "diff": "diff --git a/runtest/tracing b/runtest/tracing\nindex 674e2ad97..2a4a92c5f 100644\n--- a/runtest/tracing\n+++ b/runtest/tracing\n@@ -1,6 +1,6 @@\n #DESCRIPTION:Tracing testing\n-ftrace_regression01\tftrace_regression01.sh\n-ftrace_regression02\tftrace_regression02.sh\n+ftrace_regression01\tftrace_regression01\n+ftrace_regression02\tftrace_regression02\n ftrace-stress-test\tftrace_stress_test.sh 90\n dynamic_debug01\t\tdynamic_debug01.sh\n fanotify25 fanotify25\ndiff --git a/testcases/kernel/tracing/ftrace_test/.gitignore b/testcases/kernel/tracing/ftrace_test/.gitignore\nnew file mode 100644\nindex 000000000..b0153e9fa\n--- /dev/null\n+++ b/testcases/kernel/tracing/ftrace_test/.gitignore\n@@ -0,0 +1,2 @@\n+ftrace_regression01\n+ftrace_regression02\ndiff --git a/testcases/kernel/tracing/ftrace_test/Makefile b/testcases/kernel/tracing/ftrace_test/Makefile\nindex e4a913a56..618cce7e1 100644\n--- a/testcases/kernel/tracing/ftrace_test/Makefile\n+++ b/testcases/kernel/tracing/ftrace_test/Makefile\n@@ -2,6 +2,7 @@ top_srcdir              ?= ../../../..\n \n include $(top_srcdir)/include/mk/testcases.mk\n \n-INSTALL_TARGETS         := *.sh ftrace_stress/*\n+INSTALL_TARGETS         := *.sh ftrace_stress/* ftrace_regression01 \\\n+\t\t\t\tftrace_regression02\n \n include $(top_srcdir)/include/mk/generic_leaf_target.mk\ndiff --git a/testcases/kernel/tracing/ftrace_test/ftrace_regression.h b/testcases/kernel/tracing/ftrace_test/ftrace_regression.h\nnew file mode 100644\nindex 000000000..82687089b\n--- /dev/null\n+++ b/testcases/kernel/tracing/ftrace_test/ftrace_regression.h\n@@ -0,0 +1,49 @@\n+/* SPDX-License-Identifier: GPL-2.0-or-later\n+ *\n+ * Copyright (c) 2026 lufei <lufei@uniontech.com>\n+ *\n+ * Shared header for ftrace regression tests.\n+ */\n+\n+#ifndef FTRACE_REGRESSION_H\n+#define FTRACE_REGRESSION_H\n+\n+#include \"tst_test.h\"\n+#include \"tst_safe_file_ops.h\"\n+#include \"tst_safe_stdio.h\"\n+\n+#include <string.h>\n+#include <regex.h>\n+\n+#define FTRACE_LINE_BUF_SIZE 1024\n+\n+/**\n+ * file_contains - Check if a file contains specific regex pattern.\n+ */\n+static inline int file_contains(const char *path, const char *pattern)\n+{\n+\tFILE *fp = SAFE_FOPEN(path, \"r\");\n+\tchar *buf = SAFE_MALLOC(FTRACE_LINE_BUF_SIZE);\n+\tbool found = false;\n+\n+\tregex_t re;\n+\n+\tif (regcomp(&re, pattern, REG_EXTENDED | REG_NOSUB) != 0) {\n+\t\tSAFE_FCLOSE(fp);\n+\t\treturn found;\n+\t}\n+\n+\twhile (fgets(buf, FTRACE_LINE_BUF_SIZE, fp)) {\n+\t\tif (regexec(&re, buf, 0, NULL, 0) == 0) {\n+\t\t\tfound = true;\n+\t\t\tbreak;\n+\t\t}\n+\t}\n+\n+\tregfree(&re);\n+\tSAFE_FCLOSE(fp);\n+\tfree(buf);\n+\treturn found;\n+}\n+\n+#endif /* FTRACE_REGRESSION_H */\ndiff --git a/testcases/kernel/tracing/ftrace_test/ftrace_regression01.c b/testcases/kernel/tracing/ftrace_test/ftrace_regression01.c\nnew file mode 100644\nindex 000000000..b76d5bf7e\n--- /dev/null\n+++ b/testcases/kernel/tracing/ftrace_test/ftrace_regression01.c\n@@ -0,0 +1,88 @@\n+// SPDX-License-Identifier: GPL-2.0-or-later\n+/*\n+ * Copyright (c) 2015 Red Hat Inc.\n+ * Copyright (c) 2026 lufei <lufei@uniontech.com>\n+ */\n+\n+/*\\\n+ * Regression test for panic while using userstacktrace.\n+ *\n+ * BUG: unable to handle kernel paging request at 00000000417683c0\n+ *      IP: [<ffffffff8105c834>] update_curr+0x124/0x1e0\n+ *      Thread overran stack, or stack corrupted\n+ *      Oops: 0000 [#1] SMP\n+ *      last sysfs file: ../system/cpu/cpu15/cache/index2/shared_cpu_map\n+ *\n+ * The bug was fixed by:\n+ *      1dbd195 (tracing: Fix preempt count leak)\n+ */\n+\n+#include <unistd.h>\n+#include <stdio.h>\n+#include \"ftrace_regression.h\"\n+\n+#define DEBUGFS_DIR \"debugfs\"\n+#define STACK_TRACER_PATH \"/proc/sys/kernel/stack_tracer_enabled\"\n+#define TRACE_OPTIONS DEBUGFS_DIR \"/tracing/trace_options\"\n+#define EXC_PAGE_FAULT DEBUGFS_DIR \"/tracing/events/exceptions/page_fault_kernel/enable\"\n+#define MM_PAGE_FAULT DEBUGFS_DIR \"/tracing/events/kmem/mm_kernel_pagefault/enable\"\n+\n+#define LOOP 10\n+\n+static const char *page_fault_path;\n+static int page_fault_origin;\n+\n+static void setup(void)\n+{\n+\tSAFE_MKDIR(DEBUGFS_DIR, 0755);\n+\tSAFE_MOUNT(NULL, DEBUGFS_DIR, \"debugfs\", 0, NULL);\n+\n+\tif (access(EXC_PAGE_FAULT, F_OK) == 0)\n+\t\tpage_fault_path = EXC_PAGE_FAULT;\n+\telse if (access(MM_PAGE_FAULT, F_OK) == 0)\n+\t\tpage_fault_path = MM_PAGE_FAULT;\n+\telse\n+\t\ttst_brk(TCONF, \"Page fault event not available\");\n+\n+\tSAFE_FILE_SCANF(page_fault_path, \"%d\", &page_fault_origin);\n+}\n+\n+static void run(void)\n+{\n+\tint i;\n+\n+\tfor (i = 0; i < LOOP; i++) {\n+\t\tSAFE_FILE_PRINTF(STACK_TRACER_PATH, \"1\");\n+\t\tSAFE_FILE_PRINTF(TRACE_OPTIONS, \"userstacktrace\");\n+\n+\t\tif (!file_contains(TRACE_OPTIONS, \"^userstacktrace\"))\n+\t\t\ttst_brk(TBROK, \"Failed to set userstacktrace\");\n+\n+\t\tSAFE_FILE_PRINTF(page_fault_path, \"1\");\n+\t}\n+\n+\tSAFE_FILE_PRINTF(page_fault_path, \"%d\", page_fault_origin);\n+\n+\ttst_res(TPASS, \"Finished running the test\");\n+}\n+\n+static void cleanup(void)\n+{\n+\tSAFE_UMOUNT(DEBUGFS_DIR);\n+}\n+\n+static struct tst_test test = {\n+\t.needs_root = 1,\n+\t.needs_tmpdir = 1,\n+\t.setup = setup,\n+\t.test_all = run,\n+\t.cleanup = cleanup,\n+\t.save_restore = (const struct tst_path_val[]) {\n+\t\t{STACK_TRACER_PATH, NULL, TST_SR_TCONF},\n+\t\t{}\n+\t},\n+\t.tags = (const struct tst_tag[]) {\n+\t\t{\"linux-git\", \"1dbd195\"},\n+\t\t{}\n+\t},\n+};\ndiff --git a/testcases/kernel/tracing/ftrace_test/ftrace_regression01.sh b/testcases/kernel/tracing/ftrace_test/ftrace_regression01.sh\ndeleted file mode 100755\nindex d6969cfc6..000000000\n--- a/testcases/kernel/tracing/ftrace_test/ftrace_regression01.sh\n+++ /dev/null\n@@ -1,83 +0,0 @@\n-#! /bin/sh\n-\n-###########################################################################\n-##                                                                       ##\n-## Copyright (c) 2015, Red Hat Inc.                                      ##\n-##                                                                       ##\n-## This program is free software: you can redistribute it and/or modify  ##\n-## it under the terms of the GNU General Public License as published by  ##\n-## the Free Software Foundation, either version 3 of the License, or     ##\n-## (at your option) any later version.                                   ##\n-##                                                                       ##\n-## This program is distributed in the hope that it will be useful,       ##\n-## but WITHOUT ANY WARRANTY; without even the implied warranty of        ##\n-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the          ##\n-## GNU General Public License for more details.                          ##\n-##                                                                       ##\n-## You should have received a copy of the GNU General Public License     ##\n-## along with this program. If not, see <http://www.gnu.org/licenses/>.  ##\n-##                                                                       ##\n-## Author: Li Wang <liwang@redhat.com>                                   ##\n-##                                                                       ##\n-###########################################################################\n-##                                                                       ##\n-## Summary:  panic while using userstacktrace                            ##\n-##                                                                       ##\n-## BUG: unable to handle kernel paging request at 00000000417683c0       ##\n-##      IP: [<ffffffff8105c834>] update_curr+0x124/0x1e0                 ##\n-##      PGD 41a796067 PUD 0                                              ##\n-##      Thread overran stack, or stack corrupted                         ##\n-##      Oops: 0000 [#1] SMP                                              ##\n-##      last sysfs file: ../system/cpu/cpu15/cache/index2/shared_cpu_map ##\n-##                                                                       ##\n-## The bug was fixed by:                                                 ##\n-##      1dbd195 (tracing: Fix preempt count leak)                        ##\n-##                                                                       ##\n-###########################################################################\n-\n-export TCID=\"ftrace_regression01\"\n-export TST_TOTAL=1\n-\n-. ftrace_lib.sh\n-\n-LOOP=10\n-\n-TSTACK_TRACE_PATH=\"/proc/sys/kernel/stack_tracer_enabled\"\n-EXC_PAGE_FAULT_ENABLE=\"$TRACING_PATH/events/exceptions/page_fault_kernel/enable\"\n-MM_PAGE_FAULT_ENABLE=\"$TRACING_PATH/events/kmem/mm_kernel_pagefault/enable\"\n-\n-ftrace_userstacktrace_test()\n-{\n-\tif [ ! -e \"$TSTACK_TRACE_PATH\" ]; then\n-\t\ttst_brkm TCONF \"Stack Tracer is not cofigured in This kernel\"\n-\tfi\n-\n-\tfor i in $(seq $LOOP); do\n-\t\techo 1 >  $TSTACK_TRACE_PATH\n-\t\techo userstacktrace > $TRACING_PATH/trace_options\n-\t\tgrep -q \"^userstacktrace\"  $TRACING_PATH/trace_options\n-\t\tif [ $? -ne 0 ]; then\n-\t\t\ttst_brkm TBROK \"Failed to set userstacktrace\"\n-\t\tfi\n-\n-\t\tif [ -f \"$EXC_PAGE_FAULT_ENABLE\" ]; then\n-\t\t\texc_page_fault_enable=`cat $EXC_PAGE_FAULT_ENABLE`\n-\t\t\techo 1 > $EXC_PAGE_FAULT_ENABLE\n-\t\telse\n-\t\t\tmm_page_fault_enable=`cat $MM_PAGE_FAULT_ENABLE`\n-\t\t\techo 1 > $MM_PAGE_FAULT_ENABLE\n-\t\tfi\n-\tdone\n-\n-\tif [ -f \"$EXC_PAGE_FAULT_ENABLE\" ]; then\n-\t\techo \"$exc_page_fault_enable\" > $EXC_PAGE_FAULT_ENABLE\n-\telse\n-\t\techo \"$mm_page_fault_enable\" > $MM_PAGE_FAULT_ENABLE\n-\tfi\n-\n-\ttst_resm TPASS \"Finished running the test\"\n-}\n-\n-ftrace_userstacktrace_test\n-\n-tst_exit\ndiff --git a/testcases/kernel/tracing/ftrace_test/ftrace_regression02.c b/testcases/kernel/tracing/ftrace_test/ftrace_regression02.c\nnew file mode 100644\nindex 000000000..498db29e5\n--- /dev/null\n+++ b/testcases/kernel/tracing/ftrace_test/ftrace_regression02.c\n@@ -0,0 +1,68 @@\n+// SPDX-License-Identifier: GPL-2.0-or-later\n+/*\n+ * Copyright (c) 2015 Red Hat Inc.\n+ * Copyright (c) 2026 lufei <lufei@uniontech.com>\n+ */\n+\n+/*\\\n+ * Check signal:signal_generate gives 2 more fields: grp=[0-9] res=[0-9]\n+ */\n+\n+#include <unistd.h>\n+#include <stdio.h>\n+#include \"ftrace_regression.h\"\n+\n+#define DEBUGFS_DIR \"debugfs\"\n+#define SET_EVENT DEBUGFS_DIR \"/tracing/set_event\"\n+#define TRACING_ON DEBUGFS_DIR \"/tracing/tracing_on\"\n+#define TRACE_FILE DEBUGFS_DIR \"/tracing/trace\"\n+\n+#define LOOP 100\n+\n+static void setup(void)\n+{\n+\tSAFE_MKDIR(DEBUGFS_DIR, 0755);\n+\tSAFE_MOUNT(NULL, DEBUGFS_DIR, \"debugfs\", 0, NULL);\n+}\n+\n+static void run(void)\n+{\n+\tint i;\n+\n+\tSAFE_FILE_PRINTF(SET_EVENT, \"signal:signal_generate\");\n+\tSAFE_FILE_PRINTF(TRACING_ON, \"1\");\n+\tSAFE_FILE_PRINTF(TRACE_FILE, \"\\n\");\n+\n+\tfor (i = 0; i < LOOP; i++)\n+\t\ttst_cmd((const char *[]){\"ls\", \"-l\", \"/proc\", NULL},\n+\t\t\t\"/dev/null\", \"/dev/null\", 0);\n+\n+\tif (file_contains(TRACE_FILE, \"grp=[0-9]\") && file_contains(TRACE_FILE, \"res=[0-9]\"))\n+\t\ttst_res(TPASS, \"Finished running the test\");\n+\telse\n+\t\ttst_res(TFAIL, \"Pattern grp=[0-9] res=[0-9] not found in trace\");\n+}\n+\n+static void cleanup(void)\n+{\n+\tSAFE_UMOUNT(DEBUGFS_DIR);\n+}\n+\n+static struct tst_test test = {\n+\t.needs_root = 1,\n+\t.needs_tmpdir = 1,\n+\t.setup = setup,\n+\t.test_all = run,\n+\t.cleanup = cleanup,\n+\t.needs_cmds = (struct tst_cmd[]) {\n+\t\t{.cmd = \"ls\"},\n+\t\t{}\n+\t},\n+\t.min_kver = \"3.2\",\n+\t.tags = (const struct tst_tag[]) {\n+\t\t{\"linux-git\", \"6c303d3\"},\n+\t\t{\"linux-git\", \"163566f\"},\n+\t\t{}\n+\t},\n+};\n+\ndiff --git a/testcases/kernel/tracing/ftrace_test/ftrace_regression02.sh b/testcases/kernel/tracing/ftrace_test/ftrace_regression02.sh\ndeleted file mode 100755\nindex 3c32f219e..000000000\n--- a/testcases/kernel/tracing/ftrace_test/ftrace_regression02.sh\n+++ /dev/null\n@@ -1,63 +0,0 @@\n-#! /bin/sh\n-\n-###########################################################################\n-##                                                                       ##\n-## Copyright (c) 2015, Red Hat Inc.                                      ##\n-##                                                                       ##\n-## This program is free software: you can redistribute it and/or modify  ##\n-## it under the terms of the GNU General Public License as published by  ##\n-## the Free Software Foundation, either version 3 of the License, or     ##\n-## (at your option) any later version.                                   ##\n-##                                                                       ##\n-## This program is distributed in the hope that it will be useful,       ##\n-## but WITHOUT ANY WARRANTY; without even the implied warranty of        ##\n-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the          ##\n-## GNU General Public License for more details.                          ##\n-##                                                                       ##\n-## You should have received a copy of the GNU General Public License     ##\n-## along with this program. If not, see <http://www.gnu.org/licenses/>.  ##\n-##                                                                       ##\n-## Author: Li Wang <liwang@redhat.com>                                   ##\n-##                                                                       ##\n-###########################################################################\n-##                                                                       ##\n-## Summary: check signal:signal_generate gives 2 more fields: grp res    ##\n-##                                                                       ##\n-## This testcase is writing for signal events change:                    ##\n-##       6c303d3 tracing: let trace_signal_generate() report more info...##\n-##       163566f tracing: send_sigqueue() needs trace_signal_generate()  ##\n-##                                                                       ##\n-###########################################################################\n-\n-export TCID=\"ftrace_regression02\"\n-export TST_TOTAL=1\n-\n-. ftrace_lib.sh\n-\n-ftrace_signal_test()\n-{\n-\t# Set envent\n-\techo 'signal:signal_generate' > $TRACING_PATH/set_event\n-\techo 1 > $TRACING_PATH/tracing_on\n-\techo > $TRACING_PATH/trace\n-\n-\t# just to generate trace\n-\tfor i in $(seq 100); do\n-\t\tls -l /proc > /dev/null 2>&1\n-\tdone\n-\n-\tgrep -q 'grp=[0-9] res=[0-9]' $TRACING_PATH/trace\n-\tif [ $? -eq 0 ]; then\n-\t\ttst_resm TPASS \"finished running the test.\"\n-\telse\n-\t\ttst_resm TFAIL \"running the test failed, please check log message.\"\n-\tfi\n-}\n-\n-if tst_kvcmp -lt \"3.2\"; then\n-\ttst_brkm TCONF \"The test should be run in kernels >= 3.2.0 Skip the test...\"\n-fi\n-\n-ftrace_signal_test\n-\n-tst_exit\n",
    "prefixes": [
        "v3"
    ]
}