Messages in this thread Patch in this message | | | Date | Tue, 07 Apr 2015 18:47:58 +0300 | From | Boaz Harrosh <> | Subject | [PATCH 1B] pmem: Add prints at module load and unload |
| |
When debugging people's systems it is helpful to see what went on. The load and unload of pmem is an important event.
The importance is the number of loaded devices and error status. The exact device's addresses created we can see from the other prints at e820 so no need to duplicate this information.
After this patch the important info at dmesg will be:
Printed by the e820 code on load: [ +0.000000] user: [mem 0x0000000100000000-0x000000015fffffff] persistent (type 12) [ +0.000000] user: [mem 0x0000000160000000-0x00000001dfffffff] persistent (type 12)
... Printed by pmem modprobe: [ +0.000537] pmem: init 2 devices => 0
... Printed by pmem modprobe -r: [ +0.000537] pmem: exit
Signed-off-by: Boaz Harrosh <boaz@plexistor.com> --- drivers/block/pmem.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/drivers/block/pmem.c b/drivers/block/pmem.c index 988f384..44d3f33 100644 --- a/drivers/block/pmem.c +++ b/drivers/block/pmem.c @@ -248,6 +248,9 @@ static int __init pmem_init(void) error = platform_driver_register(&pmem_driver); if (error) unregister_blkdev(pmem_major, "pmem"); + + pr_info("pmem: init %d devices => %d\n", + atomic_read(&pmem_index), error); return error; } module_init(pmem_init); @@ -256,6 +259,7 @@ static void pmem_exit(void) { platform_driver_unregister(&pmem_driver); unregister_blkdev(pmem_major, "pmem"); + pr_info("pmem: exit\n"); } module_exit(pmem_exit); -- 1.9.3
| |