All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] target: Fix a pr_debug() argument
@ 2019-11-07 21:55 Bart Van Assche
  2019-11-19  5:32 ` Martin K. Petersen
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Bart Van Assche @ 2019-11-07 21:55 UTC (permalink / raw)
  To: target-devel

Print the string for which conversion failed instead of printing the
function name twice.

Cc: Christoph Hellwig <hch@lst.de>
Fixes: 2650d71e244f ("target: move transport ID handling to the core")
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/target/target_core_fabric_lib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/target/target_core_fabric_lib.c b/drivers/target/target_core_fabric_lib.c
index 3c79411c4cd0..6b4b354c88aa 100644
--- a/drivers/target/target_core_fabric_lib.c
+++ b/drivers/target/target_core_fabric_lib.c
@@ -118,7 +118,7 @@ static int srp_get_pr_transport_id(
 	memset(buf + 8, 0, leading_zero_bytes);
 	rc = hex2bin(buf + 8 + leading_zero_bytes, p, count);
 	if (rc < 0) {
-		pr_debug("hex2bin failed for %s: %d\n", __func__, rc);
+		pr_debug("hex2bin failed for %s: %d\n", p, rc);
 		return rc;
 	}
 
-- 
2.24.0.rc1.363.gb1bccd3e3d-goog

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] target: Fix a pr_debug() argument
  2019-11-07 21:55 [PATCH] target: Fix a pr_debug() argument Bart Van Assche
@ 2019-11-19  5:32 ` Martin K. Petersen
  2019-11-19 16:30 ` Bart Van Assche
  2019-11-20  3:02 ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2019-11-19  5:32 UTC (permalink / raw)
  To: target-devel


Hi Bart!

> Print the string for which conversion failed instead of printing the
> function name twice.

What do you mean wrt. printing the function name twice?

> Cc: Christoph Hellwig <hch@lst.de>
> Fixes: 2650d71e244f ("target: move transport ID handling to the core")
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
> ---
>  drivers/target/target_core_fabric_lib.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/target/target_core_fabric_lib.c b/drivers/target/target_core_fabric_lib.c
> index 3c79411c4cd0..6b4b354c88aa 100644
> --- a/drivers/target/target_core_fabric_lib.c
> +++ b/drivers/target/target_core_fabric_lib.c
> @@ -118,7 +118,7 @@ static int srp_get_pr_transport_id(
>  	memset(buf + 8, 0, leading_zero_bytes);
>  	rc = hex2bin(buf + 8 + leading_zero_bytes, p, count);
>  	if (rc < 0) {
> -		pr_debug("hex2bin failed for %s: %d\n", __func__, rc);
> +		pr_debug("hex2bin failed for %s: %d\n", p, rc);
>  		return rc;
>  	}

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] target: Fix a pr_debug() argument
  2019-11-07 21:55 [PATCH] target: Fix a pr_debug() argument Bart Van Assche
  2019-11-19  5:32 ` Martin K. Petersen
@ 2019-11-19 16:30 ` Bart Van Assche
  2019-11-20  3:02 ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: Bart Van Assche @ 2019-11-19 16:30 UTC (permalink / raw)
  To: target-devel

On 11/18/19 9:32 PM, Martin K. Petersen wrote:
> 
> Hi Bart!
> 
>> Print the string for which conversion failed instead of printing the
>> function name twice.
> 
> What do you mean wrt. printing the function name twice?
> 
>> Cc: Christoph Hellwig <hch@lst.de>
>> Fixes: 2650d71e244f ("target: move transport ID handling to the core")
>> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
>> ---
>>   drivers/target/target_core_fabric_lib.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/target/target_core_fabric_lib.c b/drivers/target/target_core_fabric_lib.c
>> index 3c79411c4cd0..6b4b354c88aa 100644
>> --- a/drivers/target/target_core_fabric_lib.c
>> +++ b/drivers/target/target_core_fabric_lib.c
>> @@ -118,7 +118,7 @@ static int srp_get_pr_transport_id(
>>   	memset(buf + 8, 0, leading_zero_bytes);
>>   	rc = hex2bin(buf + 8 + leading_zero_bytes, p, count);
>>   	if (rc < 0) {
>> -		pr_debug("hex2bin failed for %s: %d\n", __func__, rc);
>> +		pr_debug("hex2bin failed for %s: %d\n", p, rc);
>>   		return rc;
>>   	}

Hi Martin,

With CONFIG_DYNAMIC_DEBUG=y, the output of pr_debug() statements is 
controlled by the settings in /sys/kernel/debug/dynamic_debug/control. 
 From Documentation/admin-guide/dynamic-debug-howto.rst:

  p    enables the pr_debug() callsite.
  f    Include the function name in the printed message
  l    Include line number in the printed message
  m    Include module name in the printed message
  t    Include thread ID in messages not generated from interrupt context
  _    No flags are set. (Or'd with others on input)

In other words, the dynamic debug infrastructure already supports 
printing the function name. I use the pmf flags when enabling pr_debug() 
statements. This is why I wrote that explicitly printing the function 
name causes the function name to be printed twice.

Please let me know if you need more information.

Bart.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] target: Fix a pr_debug() argument
  2019-11-07 21:55 [PATCH] target: Fix a pr_debug() argument Bart Van Assche
  2019-11-19  5:32 ` Martin K. Petersen
  2019-11-19 16:30 ` Bart Van Assche
@ 2019-11-20  3:02 ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2019-11-20  3:02 UTC (permalink / raw)
  To: target-devel


Bart,

> With CONFIG_DYNAMIC_DEBUG=y, the output of pr_debug() statements is
> controlled by the settings in
> /sys/kernel/debug/dynamic_debug/control.

OK.

Applied to 5.5/scsi-queue, thanks.

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-11-20  3:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-07 21:55 [PATCH] target: Fix a pr_debug() argument Bart Van Assche
2019-11-19  5:32 ` Martin K. Petersen
2019-11-19 16:30 ` Bart Van Assche
2019-11-20  3:02 ` Martin K. Petersen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.