From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boaz Harrosh Subject: [PATCH 1B] pmem: Add prints at module load and unload Date: Tue, 07 Apr 2015 18:47:58 +0300 Message-ID: <5523FC2E.1020809@plexistor.com> References: <1427872339-6688-1-git-send-email-hch@lst.de> <5523FBC7.80301@plexistor.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: ross.zwisler@linux.intel.com To: Christoph Hellwig , linux-nvdimm@ml01.01.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, x86@kernel.org, axboe@kernel.dk Return-path: Received: from mail-wg0-f50.google.com ([74.125.82.50]:36599 "EHLO mail-wg0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753414AbbDGPsC (ORCPT ); Tue, 7 Apr 2015 11:48:02 -0400 Received: by wgsk9 with SMTP id k9so38015060wgs.3 for ; Tue, 07 Apr 2015 08:48:00 -0700 (PDT) In-Reply-To: <5523FBC7.80301@plexistor.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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 --- 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