-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add softlockup scenario for kdump/Fadump testing
KernelCrash_KdumpSoftlockup testcase use source files(softlockup.c and Makefile).These files added to op-tests framework's directory "op-test/test_binaries". This testcase activates the kernel panic on soft lockup and copy softlockup.c and Makefile to /tmp directory to build kernel module. The command insmod used to insert generated kernel module(softlockup.ko) into the kernel and verify the dump file created after kernel panic on soft lockup. Signed-off-by: Sachin P Bappalige <sachinpb@linux.vnet.ibm.com>
- Loading branch information
Sachin P Bappalige
committed
Sep 22, 2023
1 parent
7e75b5a
commit 95a55aa
Showing
3 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
obj-m += softlockup.o | ||
|
||
all: | ||
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules | ||
|
||
clean: | ||
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#include <linux/init.h> | ||
#include <linux/kernel.h> | ||
#include <linux/module.h> | ||
#include <linux/spinlock.h> | ||
|
||
MODULE_LICENSE("GPL"); | ||
MODULE_AUTHOR("LIKHITHA"); | ||
MODULE_DESCRIPTION("Kernel Module for softlockups"); | ||
|
||
static spinlock_t my_lock; | ||
|
||
int a; | ||
|
||
static int __init my_init(void) | ||
{ | ||
spin_lock_init(&my_lock); | ||
printk(KERN_INFO "softlockup module: Initialized spinlock\n"); | ||
|
||
/* Perform critical section operations */ | ||
spin_lock(&my_lock); | ||
while (1) { | ||
a+=1; | ||
} | ||
spin_unlock(&my_lock); | ||
|
||
return 0; | ||
} | ||
|
||
static void __exit my_exit(void) | ||
{ | ||
printk(KERN_INFO "Exiting module\n"); | ||
} | ||
|
||
module_init(my_init); | ||
module_exit(my_exit); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters