Re: [dpdk-dev] [PATCH 01/13] eal/log: introduce log register macro
From: David Marchand <hidden>
Date: 2020-06-26 12:13:35
On Fri, Jun 26, 2020 at 2:06 PM Jerin Jacob [off-list ref] wrote:
On Fri, Jun 26, 2020 at 5:13 PM David Marchand [off-list ref] wrote:quoted
On Fri, Jun 26, 2020 at 1:16 PM Jerin Jacob [off-list ref] wrote:quoted
quoted
quoted
Alternative is to keep variable declaration outside, as David suggested, and I tend to agree that it is a bit better. Macro name says 'register'. It is not 'declare and register'. Also it avoids static-vs-extern problem completely. The solution allows to keep the variable declaration untouched and put constructor (macro) at the end of fine where constructors typically reside.My only concern with that approach is that, We can not save a lot of code duplication with that scheme. ie. it is [1] vs [2]. We can change the MACRO name accordingly if that is a concern. Any suggestions? Let me know your preference on [1] vs [2], I will stick with for the next version.If there are no other comments, I change RTE_LOG_REGISTER to static version and RTE_LOG_REGISTER_EXTERN for a non-static version and send the next version.- Having a macro that does more than what its name tells is inconvenient.I agree. What could be that name if we want to declare and register? RTE_LOG_DECLARE_AND_REGISTER_EXTERN?
No declaration in macro. -- David Marchand