get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2217551,
    "url": "http://patchwork.ozlabs.org/api/patches/2217551/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/ltp/patch/20260330071554.49304-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": "<20260330071554.49304-1-lufei@uniontech.com>",
    "list_archive_url": null,
    "date": "2026-03-30T07:15:54",
    "name": "[v2] Rewrite ftrace_regression tests with new C API",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": false,
    "hash": "83f49969b8541c65a52fb1f47a56a1e3d01ec56e",
    "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/20260330071554.49304-1-lufei@uniontech.com/mbox/",
    "series": [
        {
            "id": 497966,
            "url": "http://patchwork.ozlabs.org/api/series/497966/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/ltp/list/?series=497966",
            "date": "2026-03-30T07:15:54",
            "name": "[v2] Rewrite ftrace_regression tests with new C API",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/497966/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2217551/comments/",
    "check": "success",
    "checks": "http://patchwork.ozlabs.org/api/patches/2217551/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=KuV+XJZD;\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 4fkjGb3tzZz1y1q\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 30 Mar 2026 18:16:22 +1100 (AEDT)",
            "from picard.linux.it (localhost [IPv6:::1])\n\tby picard.linux.it (Postfix) with ESMTP id 93D783E4F03\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 30 Mar 2026 09:16:19 +0200 (CEST)",
            "from in-7.smtp.seeweb.it (in-7.smtp.seeweb.it\n [IPv6:2001:4b78:1:20::7])\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 9581E3E1558\n for <ltp@lists.linux.it>; Mon, 30 Mar 2026 09:16:13 +0200 (CEST)",
            "from smtpbgau2.qq.com (smtpbgau2.qq.com [54.206.34.216])\n (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n (No client certificate requested)\n by in-7.smtp.seeweb.it (Postfix) with ESMTPS id C6825200B6D\n for <ltp@lists.linux.it>; Mon, 30 Mar 2026 09:16:11 +0200 (CEST)",
            "from localhost.localdomain ( [1.85.7.34])\n by bizesmtp.qq.com (ESMTP) with\n id ; Mon, 30 Mar 2026 15:16:03 +0800 (CST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=uniontech.com;\n s=onoh2408; t=1774854967;\n bh=hPV9UA//PTuZtIKX2LD1UfHEvP3ldmk9UyRgVWO+Rxs=;\n h=From:To:Subject:Date:Message-Id:MIME-Version;\n b=KuV+XJZD1UQJkSD6K9x4TVk3hysXTfeYV907RPEN01+CPNvyX6cRAmmFMR0JBPEXr\n ioITKz6Bx2orPdlVJG0RiJUV0Z4WP4rNxQyA0ZDRP2cxE8GAbnkW6xoGCECSlNb0kz\n PGIynLwoiW9axCVbzzKSlKAxl1eCX+Y1o7TqkOwA=",
        "X-QQ-mid": "zesmtpgz5t1774854964tc4964100",
        "X-QQ-Originating-IP": "6T6q+XOd0chWiYDyiWGPymducZ5UVXZEtptogcbsEAs=",
        "X-QQ-SSF": "0000000000000000000000000000000",
        "X-QQ-GoodBg": "0",
        "X-BIZMAIL-ID": "12799103325790913714",
        "EX-QQ-RecipientCnt": "3",
        "From": "lufei <lufei@uniontech.com>",
        "To": "ltp@lists.linux.it",
        "Date": "Mon, 30 Mar 2026 15:15:54 +0800",
        "Message-Id": "<20260330071554.49304-1-lufei@uniontech.com>",
        "X-Mailer": "git-send-email 2.39.3",
        "In-Reply-To": "<20260304080538.1793-1-lufei@uniontech.com>",
        "References": "<20260304080538.1793-1-lufei@uniontech.com>",
        "MIME-Version": "1.0",
        "X-QQ-SENDSIZE": "520",
        "Feedback-ID": "zesmtpgz:uniontech.com:qybglogicsvrgz:qybglogicsvrgz3a-1",
        "X-QQ-XMAILINFO": "MrFsN+rSFYwlXU5MnaDwwJr6/0xEL76sJhu1dJ53pGFsiWjg2SYXrnf6\n aOxVpE3YEY1+h1Cfd34knDIcBleaj7XOqV3O7lJkA7bnXjRPlgir82qT/5kxtyrEGheAclt\n ukCsZvA3L79FXnafiIjSOzhLwubyI198vdKKl5xbGcCizkWeTAKZ8m6JYPJ4iWBSBgeWtyd\n vLFW0V5Rx7ZpShIFh/t5xJ317EYTpvRQ0p7ckp2npswJtLN7DgzGTN9mej/cmZzeMQZ5Gd0\n nzPRRFzW87F9SmvqLeJRN213OMzVUNB1jbQGMkVOc0a8iuTikf7x4CHCeS0QnQjU6/9F8MX\n REh69RJv5gRNEnyW4nI/yEXgffcFJP5cOBVF8UvO4NA8TxVYO/Kc5typI565FamBX8dfZIZ\n 6MAO70XwNEoFlkaU5lT37AradRESw5ndawzSUNyyD7z+kMD/Rv75RW2TSz3yG3QUTb7kpDL\n vvPLMjqnH8F5Jz23mP+03ie2KV63hC6GCyPZqlSbAFFKtApFxjzXv4ws5eNuG7VtPHqY7Dz\n tSAw/T5thAtttGrANM0zZdezrbkJh/B6N8DiBoIl1vZ8+fBzcLSnL4qZ/Ipk8Iu98zPzF8u\n ILz90ViWhIH4PqDaygCyEtRkh/BjKNKcEPy52qpySMqHQ9saCY2Ksq5hs1ZUVkCRFOyvF5n\n nkmGLOzO1ORv53kzcoTw8MwIUaS0dlIyUqrygET1ZKMycTVPbPVP0oKSMHVzOqIMh8ayw5J\n gOvXPSYddJl1LVM9nfKUxVVmuvJPPCUKYfrCHBTHYAJNEGDtm5DifgjKkRCOFYjRNpK/9R4\n GFCxBocj2y5A4nIU+0bxDUw3UJj5Bmf1/e7WDWgNSy8aeXOcrefBkXpIyxga/RxB7yEjlUe\n JLgYeAtDPv0lWY8p7fNOAUheJaRMGJePVBgA39ZR3HFDT+CZBghKU8z9FcHSR2yAnCzlVdi\n kgSkK6LPKp6gsTFfaqo/BWGXfMv78cdSIOVTs1NBxWN4bLK/eefteKCFR7gZhLzZtQ2da9C\n /fuOl+ojRCDFHgOGsuCOuIr1ZaEp8=",
        "X-QQ-XMRINFO": "M/715EihBoGS47X28/vv4NpnfpeBLnr4Qg==",
        "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-7.smtp.seeweb.it",
        "X-Virus-Scanned": "clamav-milter 1.0.9 at in-7.smtp.seeweb.it",
        "X-Virus-Status": "Clean",
        "Subject": "[LTP] [PATCH v2] 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 testcases/kernel/tracing/ftrace_test/Makefile |  3 +-\n .../tracing/ftrace_test/ftrace_regression.h   | 65 +++++++++++++++\n .../tracing/ftrace_test/ftrace_regression01.c | 83 +++++++++++++++++++\n .../ftrace_test/ftrace_regression01.sh        | 83 -------------------\n .../tracing/ftrace_test/ftrace_regression02.c | 70 ++++++++++++++++\n .../ftrace_test/ftrace_regression02.sh        | 63 --------------\n 7 files changed, 222 insertions(+), 149 deletions(-)\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/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..710276202\n--- /dev/null\n+++ b/testcases/kernel/tracing/ftrace_test/ftrace_regression.h\n@@ -0,0 +1,65 @@\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+\n+#define FTRACE_FILE_BUF_SIZE (1024*1024)\n+#define FTRACE_LINE_BUF_SIZE 1024\n+\n+/**\n+ * file_contains - Check if a file contains the given string\n+ * path: Path to the file\n+ * str: String to search for\n+ *\n+ * Returns: 1 if file contains str, 0 otherwise\n+ */\n+static inline int file_contains(const char *path, const char *str)\n+{\n+\tchar *buf = SAFE_MALLOC(FTRACE_FILE_BUF_SIZE);\n+\tbool found = false;\n+\n+\tbuf[0] = '\\0';\n+\tSAFE_FILE_SCANF(path, \"%1048575[^\\x01]\", buf);\n+\tfound = strstr(buf, str) != NULL;\n+\tfree(buf);\n+\n+\treturn found;\n+}\n+\n+/**\n+ * file_contains_line - Check if a file ocntains specific line, strictly\n+ *\n+ */\n+static inline int file_contains_line(const char *path, const char *str)\n+{\n+\tchar *buf = SAFE_MALLOC(FTRACE_LINE_BUF_SIZE);\n+\tbool found = false;\n+\tFILE *fp = SAFE_FOPEN(path, \"r\");\n+\n+\twhile (fgets(buf, FTRACE_LINE_BUF_SIZE, fp)) {\n+\t\tbuf[strcspn(buf, \"\\r\\n\")] = 0;\n+\t\tif (strcmp(buf, str) == 0) {\n+\t\t\tfound = true;\n+\t\t\tbreak;\n+\t\t}\n+\t}\n+\n+\tSAFE_FCLOSE(fp);\n+\tfree(buf);\n+\n+\treturn found;\n+}\n+\n+#endif /* FTRACE_REGRESSION_H */\n+\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..a67d07fd1\n--- /dev/null\n+++ b/testcases/kernel/tracing/ftrace_test/ftrace_regression01.c\n@@ -0,0 +1,83 @@\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+\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+\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_line(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+\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..97dbaf371\n--- /dev/null\n+++ b/testcases/kernel/tracing/ftrace_test/ftrace_regression02.c\n@@ -0,0 +1,70 @@\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+ *\n+ * Check signal:signal_generate gives 2 more fields: grp res\n+ *\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=\") && file_contains(TRACE_FILE, \"res=\"))\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": [
        "v2"
    ]
}