Re: [PATCH 12/12] misc: pci_endpoint_test: Add debug and error messages

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Feb 15, 2023 at 12:21:55PM +0900, Damien Le Moal wrote:
> Add dynamic debug messages with dev_dbg() to help troubleshoot issues
> when running the endpoint tests. The debug messages for errors detected
> in pci_endpoint_test_validate_xfer_params() are changed to error
> messages.
> 
> Signed-off-by: Damien Le Moal <damien.lemoal@xxxxxxxxxxxxxxxxxx>
> ---
>  drivers/misc/pci_endpoint_test.c | 26 ++++++++++++++++++++++++--
>  1 file changed, 24 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/misc/pci_endpoint_test.c b/drivers/misc/pci_endpoint_test.c
> index b05d3db85da8..c47f6e708ea2 100644
> --- a/drivers/misc/pci_endpoint_test.c
> +++ b/drivers/misc/pci_endpoint_test.c
> @@ -267,12 +267,15 @@ static bool pci_endpoint_test_bar(struct pci_endpoint_test *test,
>  	u32 val;
>  	int size;
>  	struct pci_dev *pdev = test->pdev;
> +	struct device *dev = &pdev->dev;
>  
>  	if (!test->bar[barno])
>  		return false;
>  
>  	size = pci_resource_len(pdev, barno);
>  
> +	dev_dbg(dev, "Test BAR %d, %d B\n", (int)barno, size);
> +
>  	if (barno == test->test_reg_bar)
>  		size = 0x4;
>  
> @@ -291,6 +294,10 @@ static bool pci_endpoint_test_bar(struct pci_endpoint_test *test,
>  static bool pci_endpoint_test_legacy_irq(struct pci_endpoint_test *test)
>  {
>  	u32 val;
> +	struct pci_dev *pdev = test->pdev;
> +	struct device *dev = &pdev->dev;
> +
> +	dev_dbg(dev, "Test legacy IRQ\n");

Please don't do this, it's one of the things that we remove from
drivers before merging.

If you need to follow the driver flow, then use ftrace, that's what it
is there for, don't add this type of "now in this function!" debug
lines, as that is redundant.

thanks,

greg k-h



[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux