mbox series

[0/5] libsas: Some logging tidy-up

Message ID 1542203269-174932-1-git-send-email-john.garry@huawei.com
Headers show
Series libsas: Some logging tidy-up | expand

Message

John Garry Nov. 14, 2018, 1:47 p.m. UTC
This patchset presents some logging tidy-up, namely removing the printk
wrappers and using pr_XXX() instead.

In addition, some log levels are revised, as previous levels (generally
debug) were too low.

Finally a referece to "pci" is removed from a log, and unreferenced dump
files are deleted.

John Garry (5):
  scsi: libsas: Delete sas_dump.{c, h}
  scsi: libsas: Use pr_fmt(fmt)
  scsi: libsas: Drop sas_printk()
  scsi: libsas: Drop SAS_DPRINTK() and revise logs levels
  scsi: libsas: Remove pcidev reference

 drivers/scsi/libsas/Makefile        |   3 +-
 drivers/scsi/libsas/sas_ata.c       |  24 ++--
 drivers/scsi/libsas/sas_discover.c  |  34 ++---
 drivers/scsi/libsas/sas_dump.c      |  63 ---------
 drivers/scsi/libsas/sas_dump.h      |  29 -----
 drivers/scsi/libsas/sas_event.c     |   1 -
 drivers/scsi/libsas/sas_expander.c  | 249 ++++++++++++++++++------------------
 drivers/scsi/libsas/sas_init.c      |  10 +-
 drivers/scsi/libsas/sas_internal.h  |  14 +-
 drivers/scsi/libsas/sas_phy.c       |   8 +-
 drivers/scsi/libsas/sas_port.c      |  23 ++--
 drivers/scsi/libsas/sas_scsi_host.c | 128 +++++++++---------
 12 files changed, 245 insertions(+), 341 deletions(-)
 delete mode 100644 drivers/scsi/libsas/sas_dump.c
 delete mode 100644 drivers/scsi/libsas/sas_dump.h

-- 
1.9.1

Comments

John Garry Nov. 14, 2018, 3:12 p.m. UTC | #1
On 14/11/2018 14:53, Joe Perches wrote:
> On Wed, 2018-11-14 at 21:47 +0800, John Garry wrote:

>> Like sas_printk() did previously, SAS_DPRINTK() offers little value now

>> that libsas logs already have the "sas" prefix through pr_fmt(fmt). So it

>> can be dropped.

>>

>> However, after reviewing some logs in libsas, it is noticed that debug

>> level is too low in many instances.

>>

>> So this change drops SAS_DPRINTK() and revises some logs to a more

>> appropriate level. However many stay at debug level, although some

>> are significantly promoted.

> []

>> All the pre-existing checkpatch errors for spanning messages across

>> multiple lines are untouched.

>

> I think coalescing would be useful.


Sorry, I missed that. Do you mean that we stop spanning strings over 
multiple lines?

If yes, I tend to agree. It means we can grep for full strings vs just a 
different checkpatch issue (>80 lines or spanning multiple lines)

>

> Where there are already embedded "sas: "

> prefixes, those should be removed too.


Ah, I missed that guy. File sas_ata.c may also have some.

>

> You could verify this by using

>

> 	$ strings drivers/scsi/libsas/*.o | grep "^[0-7]"

>

>> @@ -186,10 +186,10 @@ int sas_notify_lldd_dev_found(struct domain_device *dev)

>>

>>  	res = i->dft->lldd_dev_found(dev);

>>  	if (res) {

>> -		printk("sas: driver on pcidev %s cannot handle "

>> -		       "device %llx, error:%d\n",

>> -		       dev_name(sas_ha->dev),

>> -		       SAS_ADDR(dev->sas_addr), res);

>> +		pr_warn("sas: driver on pcidev %s cannot handle "

>> +			"device %llx, error:%d\n",

>> +			dev_name(sas_ha->dev),

>> +			SAS_ADDR(dev->sas_addr), res);

>

> e.g.: this now emits "sas: sas: driver etc..."

>

>


Cheers,
John

>

> .

>