Message ID | 20230303183147.934793-2-schspa@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp570567wrd; Fri, 3 Mar 2023 10:43:31 -0800 (PST) X-Google-Smtp-Source: AK7set9s2ECjSbMaxTKwcrPz1IG6Tjen6JUf+CxNP98GfP2zsr6ScC5sAY+839dpUerj6e7GvE68 X-Received: by 2002:a17:906:af18:b0:8aa:c155:9233 with SMTP id lx24-20020a170906af1800b008aac1559233mr2846133ejb.26.1677869010959; Fri, 03 Mar 2023 10:43:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677869010; cv=none; d=google.com; s=arc-20160816; b=j+VvhSk1m6SzHURGxIpc2HqSags4d06AXbQk8MMBMgpx7YSFLX5GGOPn7Wcc/jCHxf nzDn5LmdQvYlzkIxZO8JoUqj0SW/3/gpO8CgpMaNRePCc2/Lk/uQyZ5gpCpHCXJKknLF aRO2D3wQnZiDIrYVGnieyfuG0Wy1Qr8gZlkD/1nEP+bjf+rTb/kX2I4hwdb23bOc5VhW YlUk0akXeV3O7Ca2Qeao/IWjBqTjd+KsQg6LlOAPhtSQMt77DaKrO2NRfUB0hq2JNT9G wipbdW2PARsow+upFb+RHIDhPaGbxEF4jkzb7mOIa/QphFcfSFgQxJgfVAJ5SlkX4Wcu +Zug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Lj/t6Fz/u75jqRo8OM20KwqRZGxc+UX5ZSqckuG+0gc=; b=QmdjtYZ+4JyxK9UJ7l/Z1LnVcW2eZNwk9Um6awzUyM3AWHsLaEafW4jdLzBy3kXdf/ 2YY5aAAxEkcMhnfhWqzq26OGR9db+YZjH+EJr+vI9FVPFt3wOBN8s8XJkIdXv97EqwTT 4XFVXr1B/wfr1YPqo0Ibl5miGqeTazHaUmllXv8KtFMBZ7N/p1O+rwCFTbEnj4KTUv7m tf2l4BGnOQ9TgH8O8nL3O1ioapZtTKLoiGCdDqB5GTPrK7A7MKGCuSJBubju2hBflNsy IpGQ/r+OO0lrrIwQ7yEbu6VAalw7GG7zqGbRDOdR7zSOUI2WzjdDDkJupcDZBlxxhsTU tXYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=aYvV43QP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u10-20020a1709067d0a00b008ede8c6eecasi3013457ejo.146.2023.03.03.10.43.08; Fri, 03 Mar 2023 10:43:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=aYvV43QP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231750AbjCCSkh (ORCPT <rfc822;davidbtadokoro@gmail.com> + 99 others); Fri, 3 Mar 2023 13:40:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231531AbjCCSkT (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 3 Mar 2023 13:40:19 -0500 Received: from mail-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A80D962332 for <linux-kernel@vger.kernel.org>; Fri, 3 Mar 2023 10:39:23 -0800 (PST) Received: by mail-io1-xd31.google.com with SMTP id v10so1351850iox.8 for <linux-kernel@vger.kernel.org>; Fri, 03 Mar 2023 10:39:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1677868752; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Lj/t6Fz/u75jqRo8OM20KwqRZGxc+UX5ZSqckuG+0gc=; b=aYvV43QPE3cPf6fntBuyX9cMHioXxxVTAMrSpgyW/aUaKAKKUVJ4JyrjKtrBn0yafI vm0DeyPOkvctS8L1wE0Eg57BVSlGQn3jhpwOPPMbsOICpG/VV5reP05gispHhJkPvJk1 JfJAeIqtWYeTbIocnz5oRQIQATb3iawG5t9arkCQFahGf94YgUUUfZgD/Xjea4vuVtQO 7rt1gPV9GpO0wJrK31+Cm96hm7O52eelQSQ4E9S8j7cF9aQXXGChf7lJIq5CZLZU8IAK 55673Uj6te34ngXvKHDlsuMYNCxwHDSj2BwWTQLTJ5ykiAaq3CFq4C4A3qZTQk20vFG/ 0ZUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677868752; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Lj/t6Fz/u75jqRo8OM20KwqRZGxc+UX5ZSqckuG+0gc=; b=26FTa3Qmh3FXq2+nMA0CrArwjzOW1BecuRy+yjXX3hJ8IZdbJiaoOriuwmyPPDDKcH lVGukSo1kG9iG8qj5BRxoye3ExK/hE/g7PkV1neECuonoWHNr0IF0kZK9ByPQNBfkqUu YQBT51mDPfPz4nuvL2D54wt7Nv5iqzUUXh/y+qgphNBZdG1fjWHda073E0rYpWIPATFD BWpqkaBRs1UFnU1Zz+rBrBQQs0CXV6C+LYjibaj4o+3rE6nIuZsnwSuIk9plxu/5ou0p wpcTstru2iELMmY2QnqesY57FBdQVX4sQm5AASBIdWtyF+r677GjYbwzjgtWSnYnQCgW w+KA== X-Gm-Message-State: AO0yUKUBQPJS0eY0quBOnFGD650vEZNiUk4tanSCprdsUD5oYwBFVtwb cHo/iJts0gJdTX7PPKA/GAg= X-Received: by 2002:a5d:8150:0:b0:74d:1ccb:e5a5 with SMTP id f16-20020a5d8150000000b0074d1ccbe5a5mr1503812ioo.6.1677868752557; Fri, 03 Mar 2023 10:39:12 -0800 (PST) Received: from ArchLinux.lan ([68.74.118.125]) by smtp.gmail.com with ESMTPSA id e12-20020a5ede0c000000b0074c9a4bb374sm875009iok.11.2023.03.03.10.39.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Mar 2023 10:39:12 -0800 (PST) From: Schspa Shi <schspa@gmail.com> To: tglx@linutronix.de, longman@redhat.com, swboyd@chromium.org, linux@roeck-us.net, wuchi.zero@gmail.com Cc: linux-kernel@vger.kernel.org, Schspa Shi <schspa@gmail.com> Subject: [PATCH v2 2/2] debugobject: add unit test for static debug object Date: Sat, 4 Mar 2023 02:31:48 +0800 Message-Id: <20230303183147.934793-2-schspa@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230303183147.934793-1-schspa@gmail.com> References: <20230303183147.934793-1-schspa@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=1.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759373176481437551?= X-GMAIL-MSGID: =?utf-8?q?1759373176481437551?= |
Series |
[v2,1/2] debugobject: fix concurrency issues with is_static_object
|
|
Commit Message
Schspa Shi
March 3, 2023, 6:31 p.m. UTC
Add test case to enusre that static debug object correctness.
Tested on little-endian arm64 qemu, result:
[ 2.385735] KTAP version 1
[ 2.385860] 1..1
[ 2.386406] KTAP version 1
[ 2.386658] # Subtest: static debugobject init
[ 2.386726] 1..1
[ 2.401777] ok 1 static_debugobject_test
[ 2.402455] ok 1 static debugobject init
Signed-off-by: Schspa Shi <schspa@gmail.com>
---
MAINTAINERS | 5 ++
lib/Kconfig.debug | 14 ++++
lib/Makefile | 2 +
lib/test_static_debug_object.c | 125 +++++++++++++++++++++++++++++++++
4 files changed, 146 insertions(+)
create mode 100644 lib/test_static_debug_object.c
Comments
Hi Schspa, I love your patch! Yet something to improve: [auto build test ERROR on linus/master] [also build test ERROR on v6.2 next-20230303] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Schspa-Shi/debugobject-add-unit-test-for-static-debug-object/20230304-024247 patch link: https://lore.kernel.org/r/20230303183147.934793-2-schspa%40gmail.com patch subject: [PATCH v2 2/2] debugobject: add unit test for static debug object config: alpha-allyesconfig (https://download.01.org/0day-ci/archive/20230304/202303041412.ikI5GiS6-lkp@intel.com/config) compiler: alpha-linux-gcc (GCC) 12.1.0 reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/intel-lab-lkp/linux/commit/54cf5a36c1c89cb79463e38bdbd636a016a80c66 git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Schspa-Shi/debugobject-add-unit-test-for-static-debug-object/20230304-024247 git checkout 54cf5a36c1c89cb79463e38bdbd636a016a80c66 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=alpha olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=alpha SHELL=/bin/bash If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot <lkp@intel.com> | Link: https://lore.kernel.org/oe-kbuild-all/202303041412.ikI5GiS6-lkp@intel.com/ All error/warnings (new ones prefixed by >>): In file included from include/linux/kgdb.h:19, from include/drm/drm_util.h:36, from include/drm/drm_connector.h:32, from include/drm/drm_modes.h:33, from include/drm/drm_crtc.h:32, from include/drm/drm_atomic_helper.h:31, from drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c:8: >> include/linux/kprobes.h:70:9: error: unknown type name 'kprobe_opcode_t' 70 | kprobe_opcode_t *addr; | ^~~~~~~~~~~~~~~ include/linux/kprobes.h:85:9: error: unknown type name 'kprobe_opcode_t' 85 | kprobe_opcode_t opcode; | ^~~~~~~~~~~~~~~ >> include/linux/kprobes.h:88:35: error: field 'ainsn' has incomplete type 88 | struct arch_specific_insn ainsn; | ^~~~~ include/linux/kprobes.h:174:9: error: unknown type name 'kprobe_opcode_t' 174 | kprobe_opcode_t *ret_addr; | ^~~~~~~~~~~~~~~ include/linux/kprobes.h:298:33: error: unknown type name 'kprobe_opcode_t' 298 | extern int kprobe_on_func_entry(kprobe_opcode_t *addr, const char *sym, unsigned long offset); | ^~~~~~~~~~~~~~~ In file included from include/asm-generic/percpu.h:7, from arch/alpha/include/asm/percpu.h:17, from include/linux/irqflags.h:17, from include/linux/spinlock.h:59, from include/drm/drm_crtc.h:28: include/linux/kprobes.h: In function 'get_kprobe_ctlblk': >> include/linux/percpu-defs.h:219:59: error: invalid use of undefined type 'struct kprobe_ctlblk' 219 | const void __percpu *__vpp_verify = (typeof((ptr) + 0))NULL; \ | ^ include/linux/percpu-defs.h:241:9: note: in expansion of macro '__verify_pcpu_ptr' 241 | __verify_pcpu_ptr(ptr); \ | ^~~~~~~~~~~~~~~~~ include/linux/percpu-defs.h:252:27: note: in expansion of macro 'raw_cpu_ptr' 252 | #define this_cpu_ptr(ptr) raw_cpu_ptr(ptr) | ^~~~~~~~~~~ include/linux/kprobes.h:414:16: note: in expansion of macro 'this_cpu_ptr' 414 | return this_cpu_ptr(&kprobe_ctlblk); | ^~~~~~~~~~~~ include/linux/kprobes.h: At top level: include/linux/kprobes.h:417:1: error: unknown type name 'kprobe_opcode_t' 417 | kprobe_opcode_t *kprobe_lookup_name(const char *name, unsigned int offset); | ^~~~~~~~~~~~~~~ include/linux/kprobes.h:418:1: error: unknown type name 'kprobe_opcode_t' 418 | kprobe_opcode_t *arch_adjust_kprobe_addr(unsigned long addr, unsigned long offset, bool *on_func_entry); | ^~~~~~~~~~~~~~~ include/linux/kprobes.h: In function 'kprobe_page_fault': >> include/linux/kprobes.h:599:16: error: implicit declaration of function 'kprobe_fault_handler' [-Werror=implicit-function-declaration] 599 | return kprobe_fault_handler(regs, trap); | ^~~~~~~~~~~~~~~~~~~~ cc1: some warnings being treated as errors -- In file included from include/linux/kgdb.h:19, from include/linux/fb.h:6, from include/linux/vga_switcheroo.h:34, from sound/pci/hda/hda_intel.c:52: >> include/linux/kprobes.h:70:9: error: unknown type name 'kprobe_opcode_t' 70 | kprobe_opcode_t *addr; | ^~~~~~~~~~~~~~~ include/linux/kprobes.h:85:9: error: unknown type name 'kprobe_opcode_t' 85 | kprobe_opcode_t opcode; | ^~~~~~~~~~~~~~~ >> include/linux/kprobes.h:88:35: error: field 'ainsn' has incomplete type 88 | struct arch_specific_insn ainsn; | ^~~~~ include/linux/kprobes.h:174:9: error: unknown type name 'kprobe_opcode_t' 174 | kprobe_opcode_t *ret_addr; | ^~~~~~~~~~~~~~~ include/linux/kprobes.h:298:33: error: unknown type name 'kprobe_opcode_t' 298 | extern int kprobe_on_func_entry(kprobe_opcode_t *addr, const char *sym, unsigned long offset); | ^~~~~~~~~~~~~~~ In file included from include/asm-generic/percpu.h:7, from arch/alpha/include/asm/percpu.h:17, from include/linux/irqflags.h:17, from include/linux/rcupdate.h:26, from include/linux/rculist.h:11, from include/linux/pid.h:5, from include/linux/sched.h:14, from include/linux/delay.h:23, from sound/pci/hda/hda_intel.c:23: include/linux/kprobes.h: In function 'get_kprobe_ctlblk': >> include/linux/percpu-defs.h:219:59: error: invalid use of undefined type 'struct kprobe_ctlblk' 219 | const void __percpu *__vpp_verify = (typeof((ptr) + 0))NULL; \ | ^ include/linux/percpu-defs.h:241:9: note: in expansion of macro '__verify_pcpu_ptr' 241 | __verify_pcpu_ptr(ptr); \ | ^~~~~~~~~~~~~~~~~ include/linux/percpu-defs.h:252:27: note: in expansion of macro 'raw_cpu_ptr' 252 | #define this_cpu_ptr(ptr) raw_cpu_ptr(ptr) | ^~~~~~~~~~~ include/linux/kprobes.h:414:16: note: in expansion of macro 'this_cpu_ptr' 414 | return this_cpu_ptr(&kprobe_ctlblk); | ^~~~~~~~~~~~ include/linux/kprobes.h: At top level: include/linux/kprobes.h:417:1: error: unknown type name 'kprobe_opcode_t' 417 | kprobe_opcode_t *kprobe_lookup_name(const char *name, unsigned int offset); | ^~~~~~~~~~~~~~~ include/linux/kprobes.h:418:1: error: unknown type name 'kprobe_opcode_t' 418 | kprobe_opcode_t *arch_adjust_kprobe_addr(unsigned long addr, unsigned long offset, bool *on_func_entry); | ^~~~~~~~~~~~~~~ include/linux/kprobes.h: In function 'kprobe_page_fault': >> include/linux/kprobes.h:599:16: error: implicit declaration of function 'kprobe_fault_handler' [-Werror=implicit-function-declaration] 599 | return kprobe_fault_handler(regs, trap); | ^~~~~~~~~~~~~~~~~~~~ In file included from include/linux/init.h:5, from include/linux/printk.h:6, from include/asm-generic/bug.h:22, from arch/alpha/include/asm/bug.h:23, from include/linux/bug.h:5, from include/linux/thread_info.h:13, from include/asm-generic/current.h:5, from ./arch/alpha/include/generated/asm/current.h:1, from include/linux/sched.h:12: sound/pci/hda/hda_intel.c: At top level: include/linux/build_bug.h:16:51: error: bit-field '<anonymous>' width not an integer constant 16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); }))) | ^ include/linux/compiler.h:232:33: note: in expansion of macro 'BUILD_BUG_ON_ZERO' 232 | #define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0])) | ^~~~~~~~~~~~~~~~~ include/linux/kernel.h:55:59: note: in expansion of macro '__must_be_array' 55 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr)) | ^~~~~~~~~~~~~~~ include/linux/moduleparam.h:517:20: note: in expansion of macro 'ARRAY_SIZE' 517 | = { .max = ARRAY_SIZE(array), .num = nump, \ | ^~~~~~~~~~ include/linux/moduleparam.h:501:9: note: in expansion of macro 'module_param_array_named' 501 | module_param_array_named(name, name, type, nump, perm) | ^~~~~~~~~~~~~~~~~~~~~~~~ sound/pci/hda/hda_intel.c:125:1: note: in expansion of macro 'module_param_array' 125 | module_param_array(index, int, NULL, 0444); | ^~~~~~~~~~~~~~~~~~ sound/pci/hda/hda_intel.c:104:12: warning: 'index' defined but not used [-Wunused-variable] 104 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; | ^~~~~ cc1: some warnings being treated as errors -- In file included from include/linux/kgdb.h:19, from include/drm/drm_util.h:36, from include/drm/drm_connector.h:32, from include/drm/drm_modes.h:33, from include/drm/drm_crtc.h:32, from include/drm/drm_atomic.h:31, from drivers/gpu/drm/arm/malidp_planes.c:12: >> include/linux/kprobes.h:70:9: error: unknown type name 'kprobe_opcode_t' 70 | kprobe_opcode_t *addr; | ^~~~~~~~~~~~~~~ include/linux/kprobes.h:85:9: error: unknown type name 'kprobe_opcode_t' 85 | kprobe_opcode_t opcode; | ^~~~~~~~~~~~~~~ >> include/linux/kprobes.h:88:35: error: field 'ainsn' has incomplete type 88 | struct arch_specific_insn ainsn; | ^~~~~ include/linux/kprobes.h:174:9: error: unknown type name 'kprobe_opcode_t' 174 | kprobe_opcode_t *ret_addr; | ^~~~~~~~~~~~~~~ include/linux/kprobes.h:298:33: error: unknown type name 'kprobe_opcode_t' 298 | extern int kprobe_on_func_entry(kprobe_opcode_t *addr, const char *sym, unsigned long offset); | ^~~~~~~~~~~~~~~ In file included from include/asm-generic/percpu.h:7, from arch/alpha/include/asm/percpu.h:17, from include/linux/irqflags.h:17, from include/linux/spinlock.h:59, from include/linux/mmzone.h:8, from include/linux/gfp.h:7, from include/linux/mm.h:7, from include/linux/scatterlist.h:8, from include/linux/iommu.h:10, from drivers/gpu/drm/arm/malidp_planes.c:9: include/linux/kprobes.h: In function 'get_kprobe_ctlblk': >> include/linux/percpu-defs.h:219:59: error: invalid use of undefined type 'struct kprobe_ctlblk' 219 | const void __percpu *__vpp_verify = (typeof((ptr) + 0))NULL; \ | ^ include/linux/percpu-defs.h:241:9: note: in expansion of macro '__verify_pcpu_ptr' 241 | __verify_pcpu_ptr(ptr); \ | ^~~~~~~~~~~~~~~~~ include/linux/percpu-defs.h:252:27: note: in expansion of macro 'raw_cpu_ptr' 252 | #define this_cpu_ptr(ptr) raw_cpu_ptr(ptr) | ^~~~~~~~~~~ include/linux/kprobes.h:414:16: note: in expansion of macro 'this_cpu_ptr' 414 | return this_cpu_ptr(&kprobe_ctlblk); | ^~~~~~~~~~~~ include/linux/kprobes.h: At top level: include/linux/kprobes.h:417:1: error: unknown type name 'kprobe_opcode_t' 417 | kprobe_opcode_t *kprobe_lookup_name(const char *name, unsigned int offset); | ^~~~~~~~~~~~~~~ include/linux/kprobes.h:418:1: error: unknown type name 'kprobe_opcode_t' 418 | kprobe_opcode_t *arch_adjust_kprobe_addr(unsigned long addr, unsigned long offset, bool *on_func_entry); | ^~~~~~~~~~~~~~~ include/linux/kprobes.h: In function 'kprobe_page_fault': include/linux/kprobes.h:599:16: error: implicit declaration of function 'kprobe_fault_handler'; did you mean 'iommu_set_fault_handler'? [-Werror=implicit-function-declaration] 599 | return kprobe_fault_handler(regs, trap); | ^~~~~~~~~~~~~~~~~~~~ | iommu_set_fault_handler cc1: some warnings being treated as errors -- In file included from include/linux/kgdb.h:19, from drivers/gpu/drm/amd/amdgpu/../display/dc/os_types.h:31, from drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services_types.h:29, from drivers/gpu/drm/amd/amdgpu/../include/dm_pp_interface.h:26, from drivers/gpu/drm/amd/amdgpu/amdgpu.h:64, from drivers/gpu/drm/amd/amdgpu/si_dma.c:25: >> include/linux/kprobes.h:70:9: error: unknown type name 'kprobe_opcode_t' 70 | kprobe_opcode_t *addr; | ^~~~~~~~~~~~~~~ include/linux/kprobes.h:85:9: error: unknown type name 'kprobe_opcode_t' 85 | kprobe_opcode_t opcode; | ^~~~~~~~~~~~~~~ >> include/linux/kprobes.h:88:35: error: field 'ainsn' has incomplete type 88 | struct arch_specific_insn ainsn; | ^~~~~ include/linux/kprobes.h:174:9: error: unknown type name 'kprobe_opcode_t' 174 | kprobe_opcode_t *ret_addr; | ^~~~~~~~~~~~~~~ include/linux/kprobes.h:298:33: error: unknown type name 'kprobe_opcode_t' 298 | extern int kprobe_on_func_entry(kprobe_opcode_t *addr, const char *sym, unsigned long offset); | ^~~~~~~~~~~~~~~ In file included from include/asm-generic/percpu.h:7, from arch/alpha/include/asm/percpu.h:17, from include/linux/irqflags.h:17, from include/linux/spinlock.h:59, from include/linux/wait.h:9, from include/linux/dma-fence.h:17, from include/drm/gpu_scheduler.h:28, from drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h:28, from drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.h:29, from drivers/gpu/drm/amd/amdgpu/amdgpu.h:43: include/linux/kprobes.h: In function 'get_kprobe_ctlblk': >> include/linux/percpu-defs.h:219:59: error: invalid use of undefined type 'struct kprobe_ctlblk' 219 | const void __percpu *__vpp_verify = (typeof((ptr) + 0))NULL; \ | ^ include/linux/percpu-defs.h:241:9: note: in expansion of macro '__verify_pcpu_ptr' 241 | __verify_pcpu_ptr(ptr); \ | ^~~~~~~~~~~~~~~~~ include/linux/percpu-defs.h:252:27: note: in expansion of macro 'raw_cpu_ptr' 252 | #define this_cpu_ptr(ptr) raw_cpu_ptr(ptr) | ^~~~~~~~~~~ include/linux/kprobes.h:414:16: note: in expansion of macro 'this_cpu_ptr' 414 | return this_cpu_ptr(&kprobe_ctlblk); | ^~~~~~~~~~~~ include/linux/kprobes.h: At top level: include/linux/kprobes.h:417:1: error: unknown type name 'kprobe_opcode_t' 417 | kprobe_opcode_t *kprobe_lookup_name(const char *name, unsigned int offset); | ^~~~~~~~~~~~~~~ include/linux/kprobes.h:418:1: error: unknown type name 'kprobe_opcode_t' 418 | kprobe_opcode_t *arch_adjust_kprobe_addr(unsigned long addr, unsigned long offset, bool *on_func_entry); | ^~~~~~~~~~~~~~~ include/linux/kprobes.h: In function 'kprobe_page_fault': >> include/linux/kprobes.h:599:16: error: implicit declaration of function 'kprobe_fault_handler' [-Werror=implicit-function-declaration] 599 | return kprobe_fault_handler(regs, trap); | ^~~~~~~~~~~~~~~~~~~~ In file included from drivers/gpu/drm/amd/amdgpu/../display/dc/dc_types.h:37, from drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services_types.h:30: drivers/gpu/drm/amd/amdgpu/../display/dc/dc_hdmi_types.h: At top level: drivers/gpu/drm/amd/amdgpu/../display/dc/dc_hdmi_types.h:53:22: warning: 'dp_hdmi_dongle_signature_str' defined but not used [-Wunused-const-variable=] 53 | static const uint8_t dp_hdmi_dongle_signature_str[] = "DP-HDMI ADAPTOR"; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: some warnings being treated as errors -- In file included from include/linux/kgdb.h:19, from drivers/gpu/drm/amd/amdgpu/../display/dc/os_types.h:31, from drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services_types.h:29, from drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services.h:35, from drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_opp.c:26: >> include/linux/kprobes.h:70:9: error: unknown type name 'kprobe_opcode_t' 70 | kprobe_opcode_t *addr; | ^~~~~~~~~~~~~~~ include/linux/kprobes.h:85:9: error: unknown type name 'kprobe_opcode_t' 85 | kprobe_opcode_t opcode; | ^~~~~~~~~~~~~~~ >> include/linux/kprobes.h:88:35: error: field 'ainsn' has incomplete type 88 | struct arch_specific_insn ainsn; | ^~~~~ include/linux/kprobes.h:174:9: error: unknown type name 'kprobe_opcode_t' 174 | kprobe_opcode_t *ret_addr; | ^~~~~~~~~~~~~~~ include/linux/kprobes.h:298:33: error: unknown type name 'kprobe_opcode_t' 298 | extern int kprobe_on_func_entry(kprobe_opcode_t *addr, const char *sym, unsigned long offset); | ^~~~~~~~~~~~~~~ In file included from include/asm-generic/percpu.h:7, from arch/alpha/include/asm/percpu.h:17, from include/linux/irqflags.h:17, from include/linux/spinlock.h:59, from include/linux/mmzone.h:8, from include/linux/gfp.h:7, from include/linux/slab.h:15, from drivers/gpu/drm/amd/amdgpu/../display/dc/os_types.h:30: include/linux/kprobes.h: In function 'get_kprobe_ctlblk': >> include/linux/percpu-defs.h:219:59: error: invalid use of undefined type 'struct kprobe_ctlblk' 219 | const void __percpu *__vpp_verify = (typeof((ptr) + 0))NULL; \ | ^ include/linux/percpu-defs.h:241:9: note: in expansion of macro '__verify_pcpu_ptr' 241 | __verify_pcpu_ptr(ptr); \ | ^~~~~~~~~~~~~~~~~ include/linux/percpu-defs.h:252:27: note: in expansion of macro 'raw_cpu_ptr' 252 | #define this_cpu_ptr(ptr) raw_cpu_ptr(ptr) | ^~~~~~~~~~~ include/linux/kprobes.h:414:16: note: in expansion of macro 'this_cpu_ptr' 414 | return this_cpu_ptr(&kprobe_ctlblk); | ^~~~~~~~~~~~ include/linux/kprobes.h: At top level: include/linux/kprobes.h:417:1: error: unknown type name 'kprobe_opcode_t' 417 | kprobe_opcode_t *kprobe_lookup_name(const char *name, unsigned int offset); | ^~~~~~~~~~~~~~~ include/linux/kprobes.h:418:1: error: unknown type name 'kprobe_opcode_t' 418 | kprobe_opcode_t *arch_adjust_kprobe_addr(unsigned long addr, unsigned long offset, bool *on_func_entry); | ^~~~~~~~~~~~~~~ include/linux/kprobes.h: In function 'kprobe_page_fault': >> include/linux/kprobes.h:599:16: error: implicit declaration of function 'kprobe_fault_handler' [-Werror=implicit-function-declaration] 599 | return kprobe_fault_handler(regs, trap); | ^~~~~~~~~~~~~~~~~~~~ In file included from drivers/gpu/drm/amd/amdgpu/../display/dc/inc/core_types.h:32, from drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_opp.h:30, from drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_opp.c:29: drivers/gpu/drm/amd/amdgpu/../display/include/ddc_service_types.h: At top level: drivers/gpu/drm/amd/amdgpu/../display/include/ddc_service_types.h:143:22: warning: 'SYNAPTICS_DEVICE_ID' defined but not used [-Wunused-const-variable=] 143 | static const uint8_t SYNAPTICS_DEVICE_ID[] = "SYNA"; | ^~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/amd/amdgpu/../display/include/ddc_service_types.h:140:22: warning: 'DP_VGA_LVDS_CONVERTER_ID_3' defined but not used [-Wunused-const-variable=] 140 | static const uint8_t DP_VGA_LVDS_CONVERTER_ID_3[] = "dnomlA"; | ^~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/amd/amdgpu/../display/include/ddc_service_types.h:138:22: warning: 'DP_VGA_LVDS_CONVERTER_ID_2' defined but not used [-Wunused-const-variable=] 138 | static const uint8_t DP_VGA_LVDS_CONVERTER_ID_2[] = "sivarT"; | ^~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/amd/amdgpu/../display/include/ddc_service_types.h:135:17: warning: 'DP_SINK_BRANCH_DEV_NAME_7580' defined but not used [-Wunused-const-variable=] 135 | static const u8 DP_SINK_BRANCH_DEV_NAME_7580[] = "7580\x80u"; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/amd/amdgpu/../display/include/ddc_service_types.h:133:22: warning: 'DP_SINK_DEVICE_STR_ID_2' defined but not used [-Wunused-const-variable=] 133 | static const uint8_t DP_SINK_DEVICE_STR_ID_2[] = {7, 1, 8, 7, 5}; | ^~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/amd/amdgpu/../display/include/ddc_service_types.h:132:22: warning: 'DP_SINK_DEVICE_STR_ID_1' defined but not used [-Wunused-const-variable=] 132 | static const uint8_t DP_SINK_DEVICE_STR_ID_1[] = {7, 1, 8, 7, 3}; | ^~~~~~~~~~~~~~~~~~~~~~~ In file included from drivers/gpu/drm/amd/amdgpu/../display/dc/dc_types.h:37, from drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services_types.h:30: drivers/gpu/drm/amd/amdgpu/../display/dc/dc_hdmi_types.h:53:22: warning: 'dp_hdmi_dongle_signature_str' defined but not used [-Wunused-const-variable=] 53 | static const uint8_t dp_hdmi_dongle_signature_str[] = "DP-HDMI ADAPTOR"; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: some warnings being treated as errors .. Kconfig warnings: (for reference only) WARNING: unmet direct dependencies detected for KPROBES Depends on [n]: MODULES [=y] && HAVE_KPROBES [=n] Selected by [y]: - TEST_STATIC_DEBUGOBJECT [=y] && RUNTIME_TESTING_MENU [=y] && KUNIT [=y] vim +/kprobe_opcode_t +70 include/linux/kprobes.h d0aaff9796c331 Prasanna S Panchamukhi 2005-09-06 49 ^1da177e4c3f41 Linus Torvalds 2005-04-16 50 struct kprobe; ^1da177e4c3f41 Linus Torvalds 2005-04-16 51 struct pt_regs; b94cce926b2b90 Hien Nguyen 2005-06-23 52 struct kretprobe; b94cce926b2b90 Hien Nguyen 2005-06-23 53 struct kretprobe_instance; ^1da177e4c3f41 Linus Torvalds 2005-04-16 54 typedef int (*kprobe_pre_handler_t) (struct kprobe *, struct pt_regs *); ^1da177e4c3f41 Linus Torvalds 2005-04-16 55 typedef void (*kprobe_post_handler_t) (struct kprobe *, struct pt_regs *, ^1da177e4c3f41 Linus Torvalds 2005-04-16 56 unsigned long flags); b94cce926b2b90 Hien Nguyen 2005-06-23 57 typedef int (*kretprobe_handler_t) (struct kretprobe_instance *, b94cce926b2b90 Hien Nguyen 2005-06-23 58 struct pt_regs *); b94cce926b2b90 Hien Nguyen 2005-06-23 59 ^1da177e4c3f41 Linus Torvalds 2005-04-16 60 struct kprobe { ^1da177e4c3f41 Linus Torvalds 2005-04-16 61 struct hlist_node hlist; ^1da177e4c3f41 Linus Torvalds 2005-04-16 62 64f562c6df3cfc Ananth N Mavinakayanahalli 2005-05-05 63 /* list of kprobes for multi-handler support */ 64f562c6df3cfc Ananth N Mavinakayanahalli 2005-05-05 64 struct list_head list; 64f562c6df3cfc Ananth N Mavinakayanahalli 2005-05-05 65 ea32c65cc2d229 Prasanna S Panchamukhi 2005-06-23 66 /*count the number of times this probe was temporarily disarmed */ ea32c65cc2d229 Prasanna S Panchamukhi 2005-06-23 67 unsigned long nmissed; ea32c65cc2d229 Prasanna S Panchamukhi 2005-06-23 68 ^1da177e4c3f41 Linus Torvalds 2005-04-16 69 /* location of the probe point */ ^1da177e4c3f41 Linus Torvalds 2005-04-16 @70 kprobe_opcode_t *addr; ^1da177e4c3f41 Linus Torvalds 2005-04-16 71 3a872d89baae82 Ananth N Mavinakayanahalli 2006-10-02 72 /* Allow user to indicate symbol name of the probe point */ 9b3af29bf33bfe Ananth N Mavinakayanahalli 2007-05-08 73 const char *symbol_name; 3a872d89baae82 Ananth N Mavinakayanahalli 2006-10-02 74 3a872d89baae82 Ananth N Mavinakayanahalli 2006-10-02 75 /* Offset into the symbol */ 3a872d89baae82 Ananth N Mavinakayanahalli 2006-10-02 76 unsigned int offset; 3a872d89baae82 Ananth N Mavinakayanahalli 2006-10-02 77 ^1da177e4c3f41 Linus Torvalds 2005-04-16 78 /* Called before addr is executed. */ ^1da177e4c3f41 Linus Torvalds 2005-04-16 79 kprobe_pre_handler_t pre_handler; ^1da177e4c3f41 Linus Torvalds 2005-04-16 80 ^1da177e4c3f41 Linus Torvalds 2005-04-16 81 /* Called after addr is executed, unless... */ ^1da177e4c3f41 Linus Torvalds 2005-04-16 82 kprobe_post_handler_t post_handler; ^1da177e4c3f41 Linus Torvalds 2005-04-16 83 ^1da177e4c3f41 Linus Torvalds 2005-04-16 84 /* Saved opcode (which has been replaced with breakpoint) */ ^1da177e4c3f41 Linus Torvalds 2005-04-16 85 kprobe_opcode_t opcode; ^1da177e4c3f41 Linus Torvalds 2005-04-16 86 ^1da177e4c3f41 Linus Torvalds 2005-04-16 87 /* copy of the original instruction */ ^1da177e4c3f41 Linus Torvalds 2005-04-16 @88 struct arch_specific_insn ainsn; e8386a0cb22f4a Masami Hiramatsu 2009-01-06 89 de5bd88d5a5cce Masami Hiramatsu 2009-04-06 90 /* de5bd88d5a5cce Masami Hiramatsu 2009-04-06 91 * Indicates various status flags. de5bd88d5a5cce Masami Hiramatsu 2009-04-06 92 * Protected by kprobe_mutex after this kprobe is registered. de5bd88d5a5cce Masami Hiramatsu 2009-04-06 93 */ e8386a0cb22f4a Masami Hiramatsu 2009-01-06 94 u32 flags; ^1da177e4c3f41 Linus Torvalds 2005-04-16 95 }; ^1da177e4c3f41 Linus Torvalds 2005-04-16 96
Hi Schspa,
I love your patch! Yet something to improve:
[auto build test ERROR on linus/master]
[also build test ERROR on v6.2 next-20230303]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Schspa-Shi/debugobject-add-unit-test-for-static-debug-object/20230304-024247
patch link: https://lore.kernel.org/r/20230303183147.934793-2-schspa%40gmail.com
patch subject: [PATCH v2 2/2] debugobject: add unit test for static debug object
config: s390-allmodconfig (https://download.01.org/0day-ci/archive/20230304/202303041802.KTXFKBzL-lkp@intel.com/config)
compiler: s390-linux-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/intel-lab-lkp/linux/commit/54cf5a36c1c89cb79463e38bdbd636a016a80c66
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Schspa-Shi/debugobject-add-unit-test-for-static-debug-object/20230304-024247
git checkout 54cf5a36c1c89cb79463e38bdbd636a016a80c66
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=s390 olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=s390 SHELL=/bin/bash
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202303041802.KTXFKBzL-lkp@intel.com/
All errors (new ones prefixed by >>, old ones prefixed by <<):
>> ERROR: modpost: "regs_get_register" [lib/test_static_debug_object.ko] undefined!
ERROR: modpost: "devm_ioremap_resource" [drivers/dma/qcom/hdma.ko] undefined!
ERROR: modpost: "devm_platform_ioremap_resource" [drivers/dma/fsl-edma.ko] undefined!
ERROR: modpost: "devm_platform_ioremap_resource" [drivers/dma/idma64.ko] undefined!
ERROR: modpost: "iounmap" [drivers/tty/ipwireless/ipwireless.ko] undefined!
ERROR: modpost: "ioremap" [drivers/tty/ipwireless/ipwireless.ko] undefined!
ERROR: modpost: "devm_platform_ioremap_resource" [drivers/char/xillybus/xillybus_of.ko] undefined!
ERROR: modpost: "devm_memremap" [drivers/misc/open-dice.ko] undefined!
ERROR: modpost: "devm_memunmap" [drivers/misc/open-dice.ko] undefined!
ERROR: modpost: "iounmap" [drivers/net/ethernet/8390/pcnet_cs.ko] undefined!
WARNING: modpost: suppressed 16 unresolved symbol warnings because there were too many)
diff --git a/MAINTAINERS b/MAINTAINERS index b0db911207ba4..38187e2921691 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -23202,6 +23202,11 @@ L: linux-mm@kvack.org S: Maintained F: mm/zswap.c +STATIC DEBUGOBJECT TEST +M: Schspa Shi <schspa@gmail.com> +S: Maintained +F: lib/test_static_debug_object.c + THE REST M: Linus Torvalds <torvalds@linux-foundation.org> L: linux-kernel@vger.kernel.org diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index c8b379e2e9adc..9d5ee631d4380 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -2801,6 +2801,20 @@ config TEST_CLOCKSOURCE_WATCHDOG If unsure, say N. +config TEST_STATIC_DEBUGOBJECT + tristate "KUnit test for static debugobject" + depends on KUNIT + select KPROBES + select DEBUG_OBJECTS + select DEBUG_OBJECTS_TIMERS + help + This builds the static debugobject unit test, which runs on boot. + Tests the static debug object correctness. + For more information on KUnit and unit tests in general please refer + to the KUnit documentation in Documentation/dev-tools/kunit/. + + If unsure, say N. + endif # RUNTIME_TESTING_MENU config ARCH_USE_MEMTEST diff --git a/lib/Makefile b/lib/Makefile index baf2821f7a00f..f663686beabd9 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -427,3 +427,5 @@ $(obj)/$(TEST_FORTIFY_LOG): $(addprefix $(obj)/, $(TEST_FORTIFY_LOGS)) FORCE ifeq ($(CONFIG_FORTIFY_SOURCE),y) $(obj)/string.o: $(obj)/$(TEST_FORTIFY_LOG) endif + +obj-$(CONFIG_TEST_STATIC_DEBUGOBJECT) += test_static_debug_object.o diff --git a/lib/test_static_debug_object.c b/lib/test_static_debug_object.c new file mode 100644 index 0000000000000..8a0d6ab5c24b5 --- /dev/null +++ b/lib/test_static_debug_object.c @@ -0,0 +1,125 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * THis module tests the static debugobject via a static timer instance. This + * test use kretprobe to inject some delay to make the problem easier to + * reproduce. + * + * Copyright (c) 2023, Schspa Shi <schspa@gmail.com> + */ + +#include <linux/kernel.h> +#include <linux/module.h> +#include <linux/sched.h> +#include <linux/timer.h> +#include <linux/delay.h> +#include <linux/kprobes.h> +#include <linux/workqueue.h> +#include <linux/cpu.h> +#include <kunit/test.h> + +static void ktest_timer_func(struct timer_list *); + +static DEFINE_TIMER(ktest_timer, ktest_timer_func); +static int timer_stop; +DEFINE_SPINLOCK(tlock); + +static DEFINE_PER_CPU(struct work_struct, timer_debugobject_test_work); + +static void timer_debugobject_workfn(struct work_struct *work) +{ + mod_timer(&ktest_timer, jiffies + (5 * HZ)); +} + +/* + * Reaper for links from keyrings to dead keys. + */ +static void ktest_timer_func(struct timer_list *t) +{ + unsigned long flags; + + spin_lock_irqsave(&tlock, flags); + if (!timer_stop) + mod_timer(&ktest_timer, jiffies + (1 * HZ)); + spin_unlock_irqrestore(&tlock, flags); +} + + +static int static_object_check_handler( + struct kretprobe_instance *ri, struct pt_regs *regs) +{ + void *address; + + address = (void *)regs_get_register(regs, 0); + + if (address == &ktest_timer) { + int this_cpu = raw_smp_processor_id(); + /* + * This hook point adds an extra delay to make the problem + * easier to reproduce. We need different delay for + * differenct processor. + */ + mdelay(this_cpu * 100); + } + + return 0; +} + + +static struct kretprobe is_static_kretprobes = { + .entry_handler = static_object_check_handler, + .data_size = 0, + /* Probe up to 512 instances concurrently. */ + .maxactive = 512, + .kp = { + .symbol_name = "timer_is_static_object", + } +}; + + +static void static_debugobject_test(struct kunit *test) +{ + unsigned long flags; + int cpu; + int ret; + + ret = register_kretprobe(&is_static_kretprobes); + KUNIT_ASSERT_EQ(test, ret, 0); + + /* Do test */ + cpus_read_lock(); + for_each_online_cpu(cpu) { + struct work_struct *work = + &per_cpu(timer_debugobject_test_work, cpu); + INIT_WORK(work, timer_debugobject_workfn); + schedule_work_on(cpu, work); + } + + for_each_online_cpu(cpu) { + struct work_struct *work = + &per_cpu(timer_debugobject_test_work, cpu); + flush_work(work); + } + cpus_read_unlock(); + + spin_lock_irqsave(&tlock, flags); + timer_stop = 0; + spin_unlock_irqrestore(&tlock, flags); + + del_timer_sync(&ktest_timer); + + unregister_kretprobe(&is_static_kretprobes); +} + +static struct kunit_case static_debugobject_init_cases[] = { + KUNIT_CASE(static_debugobject_test), + {} +}; + +static struct kunit_suite static_debugobject_suite = { + .name = "static debugobject init", + .test_cases = static_debugobject_init_cases, +}; + +kunit_test_suite(static_debugobject_suite); +MODULE_AUTHOR("Schspa <schspa@gmail.com>"); +MODULE_LICENSE("GPL");