Skip to content

Commit 36eebd9

Browse files
author
Stephen Biggs
committed
pmem: add test module for kernel api
The init portion will return an error and not stay loaded if there is any problem with the test. If there is no problem, an OK status is returned via the insmod or modprobe call and the module stays loaded in the kernel until it is removed via rmmod or modprobe. This set of tests is modeled after the userspace _pmem_test.c set of stress tests. This module does two nominal tests, testing first an allocation of 1 Megabyte at 4k page alignment, write and read-back and free, and the same cycle again at 1 Megabyte alignment and then the full nominal test done for 2 Megabytes at both alignments. A set of error parameters are passed in as expected failures. There is also an adversarial test where there are two allocations at once, one of 1 Megabyte and the other after at 64 K with the same read/write and free tests, for both types of alignment. Signed-off-by: Stephen Biggs <[email protected]>
1 parent 31bb33c commit 36eebd9

File tree

3 files changed

+442
-0
lines changed

3 files changed

+442
-0
lines changed

drivers/misc/Kconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ config ANDROID_PMEM_DEBUG
2222
depends on ANDROID_PMEM
2323
default n
2424

25+
config ANDROID_PMEM_KAPI_TEST
26+
tristate "Simple module to test Android pmem kernel API"
27+
depends on ANDROID_PMEM
28+
default m
29+
2530
config ATMEL_PWM
2631
tristate "Atmel AT32/AT91 PWM support"
2732
depends on AVR32 || ARCH_AT91SAM9263 || ARCH_AT91SAM9RL || ARCH_AT91CAP9

drivers/misc/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ obj-$(CONFIG_TIFM_CORE) += tifm_core.o
1313
obj-$(CONFIG_TIFM_7XX1) += tifm_7xx1.o
1414
obj-$(CONFIG_PHANTOM) += phantom.o
1515
obj-$(CONFIG_ANDROID_PMEM) += pmem.o
16+
obj-$(CONFIG_ANDROID_PMEM_KAPI_TEST) += pmem_kernel_test.o
1617
obj-$(CONFIG_SGI_IOC4) += ioc4.o
1718
obj-$(CONFIG_ENCLOSURE_SERVICES) += enclosure.o
1819
obj-$(CONFIG_KERNEL_DEBUGGER_CORE) += kernel_debugger.o

0 commit comments

Comments
 (0)