diff mbox series

[V3,6/6] f2fs: get rid of duplicate code for in tracing

Message ID 20190618054224.25985-7-chaitanya.kulkarni@wdc.com (mailing list archive)
State New, archived
Headers show
Series block: improve print_req_error | expand

Commit Message

Chaitanya Kulkarni June 18, 2019, 5:42 a.m. UTC
Now that we have used the blk_op_str(), get rid of show_bio_type() and
show_bio_op() to eliminate the duplicate code.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
---
 include/trace/events/f2fs.h | 14 --------------
 1 file changed, 14 deletions(-)

Comments

Chao Yu June 18, 2019, 7:19 a.m. UTC | #1
Hi Chaitanya,

On 2019/6/18 13:42, Chaitanya Kulkarni wrote:
> Now that we have used the blk_op_str(), get rid of show_bio_type() and
> show_bio_op() to eliminate the duplicate code.

I think we can merge 5/6 and 6/6 into one patch.

> 
> Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
> ---
>  include/trace/events/f2fs.h | 14 --------------
>  1 file changed, 14 deletions(-)
> 
> diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h
> index ec4dba5a4c30..a8e4fe053e7c 100644
> --- a/include/trace/events/f2fs.h
> +++ b/include/trace/events/f2fs.h
> @@ -73,20 +73,6 @@ TRACE_DEFINE_ENUM(CP_TRIMMED);
>  			REQ_PREFLUSH | REQ_FUA)
>  #define F2FS_BIO_FLAG_MASK(t)	(t & F2FS_OP_FLAGS)
>  
> -#define show_bio_type(op,op_flags)	show_bio_op(op),		\

Could you just replace show_bio_op() with blk_op_str()? it's minor though.

Thanks,

> -						show_bio_op_flags(op_flags)
> -
> -#define show_bio_op(op)							\
> -	__print_symbolic(op,						\
> -		{ REQ_OP_READ,			"READ" },		\
> -		{ REQ_OP_WRITE,			"WRITE" },		\
> -		{ REQ_OP_FLUSH,			"FLUSH" },		\
> -		{ REQ_OP_DISCARD,		"DISCARD" },		\
> -		{ REQ_OP_SECURE_ERASE,		"SECURE_ERASE" },	\
> -		{ REQ_OP_ZONE_RESET,		"ZONE_RESET" },		\
> -		{ REQ_OP_WRITE_SAME,		"WRITE_SAME" },		\
> -		{ REQ_OP_WRITE_ZEROES,		"WRITE_ZEROES" })
> -
>  #define show_bio_op_flags(flags)					\
>  	__print_flags(F2FS_BIO_FLAG_MASK(flags), "|",			\
>  		{ REQ_RAHEAD,		"R" },				\
>
Bart Van Assche June 18, 2019, 3:29 p.m. UTC | #2
On 6/18/19 12:19 AM, Chao Yu wrote:
> Hi Chaitanya,
> 
> On 2019/6/18 13:42, Chaitanya Kulkarni wrote:
>> Now that we have used the blk_op_str(), get rid of show_bio_type() and
>> show_bio_op() to eliminate the duplicate code.
> 
> I think we can merge 5/6 and 6/6 into one patch.

Yes please.

Bart.
Chaitanya Kulkarni June 18, 2019, 4:07 p.m. UTC | #3
Thanks for the comments Chao.

On 6/18/19 12:19 AM, Chao Yu wrote:
> Hi Chaitanya,
> 
> On 2019/6/18 13:42, Chaitanya Kulkarni wrote:
>> Now that we have used the blk_op_str(), get rid of show_bio_type() and
>> show_bio_op() to eliminate the duplicate code.
> 
> I think we can merge 5/6 and 6/6 into one patch.
> 
>>
Will do it in a next version.
>> Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
>> ---
>>   include/trace/events/f2fs.h | 14 --------------
>>   1 file changed, 14 deletions(-)
>>
>> diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h
>> index ec4dba5a4c30..a8e4fe053e7c 100644
>> --- a/include/trace/events/f2fs.h
>> +++ b/include/trace/events/f2fs.h
>> @@ -73,20 +73,6 @@ TRACE_DEFINE_ENUM(CP_TRIMMED);
>>   			REQ_PREFLUSH | REQ_FUA)
>>   #define F2FS_BIO_FLAG_MASK(t)	(t & F2FS_OP_FLAGS)
>>   
>> -#define show_bio_type(op,op_flags)	show_bio_op(op),		\
> 
> Could you just replace show_bio_op() with blk_op_str()? it's minor though.
> 
Okay, that also can be done. Will replace it in a next version.

> Thanks,
> 
>> -						show_bio_op_flags(op_flags)
>> -
>> -#define show_bio_op(op)							\
>> -	__print_symbolic(op,						\
>> -		{ REQ_OP_READ,			"READ" },		\
>> -		{ REQ_OP_WRITE,			"WRITE" },		\
>> -		{ REQ_OP_FLUSH,			"FLUSH" },		\
>> -		{ REQ_OP_DISCARD,		"DISCARD" },		\
>> -		{ REQ_OP_SECURE_ERASE,		"SECURE_ERASE" },	\
>> -		{ REQ_OP_ZONE_RESET,		"ZONE_RESET" },		\
>> -		{ REQ_OP_WRITE_SAME,		"WRITE_SAME" },		\
>> -		{ REQ_OP_WRITE_ZEROES,		"WRITE_ZEROES" })
>> -
>>   #define show_bio_op_flags(flags)					\
>>   	__print_flags(F2FS_BIO_FLAG_MASK(flags), "|",			\
>>   		{ REQ_RAHEAD,		"R" },				\
>>
>
diff mbox series

Patch

diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h
index ec4dba5a4c30..a8e4fe053e7c 100644
--- a/include/trace/events/f2fs.h
+++ b/include/trace/events/f2fs.h
@@ -73,20 +73,6 @@  TRACE_DEFINE_ENUM(CP_TRIMMED);
 			REQ_PREFLUSH | REQ_FUA)
 #define F2FS_BIO_FLAG_MASK(t)	(t & F2FS_OP_FLAGS)
 
-#define show_bio_type(op,op_flags)	show_bio_op(op),		\
-						show_bio_op_flags(op_flags)
-
-#define show_bio_op(op)							\
-	__print_symbolic(op,						\
-		{ REQ_OP_READ,			"READ" },		\
-		{ REQ_OP_WRITE,			"WRITE" },		\
-		{ REQ_OP_FLUSH,			"FLUSH" },		\
-		{ REQ_OP_DISCARD,		"DISCARD" },		\
-		{ REQ_OP_SECURE_ERASE,		"SECURE_ERASE" },	\
-		{ REQ_OP_ZONE_RESET,		"ZONE_RESET" },		\
-		{ REQ_OP_WRITE_SAME,		"WRITE_SAME" },		\
-		{ REQ_OP_WRITE_ZEROES,		"WRITE_ZEROES" })
-
 #define show_bio_op_flags(flags)					\
 	__print_flags(F2FS_BIO_FLAG_MASK(flags), "|",			\
 		{ REQ_RAHEAD,		"R" },				\