From: John Wolfe Date: Fri, 11 Sep 2020 19:11:04 +0000 (-0700) Subject: Back out earlier common header file changes. X-Git-Tag: stable-11.2.0~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4da428cb1bbea7a5e1e9da2df40d410ca557f63f;p=thirdparty%2Fopen-vm-tools.git Back out earlier common header file changes. --- diff --git a/open-vm-tools/lib/include/log.h b/open-vm-tools/lib/include/log.h index 55e71ab81..7381ba883 100644 --- a/open-vm-tools/lib/include/log.h +++ b/open-vm-tools/lib/include/log.h @@ -94,6 +94,34 @@ typedef enum { #define VMW_LOG_LEVEL(routing) ((routing) & VMW_LOG_LEVEL_MASK) #define VMW_LOG_MODULE(routing) (((routing) >> VMW_LOG_LEVEL_BITS)) +/* + * To use the Log Facility module specific filters: + * + * 1) Use LogV or Log_Level and use the LOG_ROUTING_BITS macro. + * + * 2) Have LOGLEVEL_MODULE defined before the include of "log.h". + * + * For many files, this involves moving the include "log.h" after + * the include of "loglevel_user.h". + */ + +#if defined(LOGLEVEL_MODULE) + #include "loglevel_userVars.h" + #include "vm_basic_defs.h" + + #define LOGFACILITY_MODULEVAR(mod) XCONC(_logFacilityModule_, mod) + + enum LogFacilityModuleValue { + LOGLEVEL_USER(LOGFACILITY_MODULEVAR) + }; + + /* Module bits of zero (0) indicate no module has been specified */ + #define LOG_ROUTING_BITS(level) \ + (((LOGFACILITY_MODULEVAR(LOGLEVEL_MODULE) + 1) << VMW_LOG_LEVEL_BITS) | level) +#else + #define LOG_ROUTING_BITS(level) (level) +#endif + void LogV(uint32 routing, const char *fmt, va_list args); @@ -461,8 +489,6 @@ typedef Bool (GetOpId)(size_t maxStringLen, void Log_RegisterOpIdFunction(GetOpId *getOpIdFunc); -void Log_LoadModuleFilters(struct CfgInterface *cfgIf); - #endif /* !VMM */ #if defined(__cplusplus) @@ -470,39 +496,3 @@ void Log_LoadModuleFilters(struct CfgInterface *cfgIf); #endif #endif /* VMWARE_LOG_H */ - -/* - * To use the Log Facility module specific filters: - * - * 1) Use LogV or Log_Level and use the LOG_ROUTING_BITS macro. - * - * 2) Have LOGLEVEL_MODULE defined before the include of "log.h". - * - * For many files, this involves moving the include "log.h" after - * the include of "loglevel_user.h". - */ - -#if !defined(VMW_LOG_MODULE_LEVELS) - #include "vm_basic_defs.h" - #include "loglevel_userVars.h" - - #define LOGFACILITY_MODULEVAR(mod) XCONC(_logFacilityModule_, mod) - - enum LogFacilityModuleValue { - LOGLEVEL_USER(LOGFACILITY_MODULEVAR) - }; - - #define VMW_LOG_MODULE_LEVELS -#endif - -#if defined(LOG_ROUTING_BITS) - #undef LOG_ROUTING_BITS -#endif - -#if defined(LOGLEVEL_MODULE) - /* Module bits of zero (0) indicate no module has been specified */ - #define LOG_ROUTING_BITS(level) \ - (((LOGFACILITY_MODULEVAR(LOGLEVEL_MODULE) + 1) << VMW_LOG_LEVEL_BITS) | level) -#else - #define LOG_ROUTING_BITS(level) (level) -#endif diff --git a/open-vm-tools/lib/include/loglevel_userVars.h b/open-vm-tools/lib/include/loglevel_userVars.h index 1ea485bad..f94faa0da 100644 --- a/open-vm-tools/lib/include/loglevel_userVars.h +++ b/open-vm-tools/lib/include/loglevel_userVars.h @@ -27,6 +27,8 @@ /* KEEP IN SORTED ORDER! */ #define LOGLEVEL_USER(LOGLEVEL_VAR) \ + /* main has to be first. */ \ + LOGLEVEL_VAR(main), \ LOGLEVEL_VAR(acpi), \ LOGLEVEL_VAR(acpiGPE), \ LOGLEVEL_VAR(ahci), \ @@ -137,7 +139,6 @@ LOGLEVEL_VAR(macfilter), \ LOGLEVEL_VAR(machPoll), \ LOGLEVEL_VAR(maclatency), \ - LOGLEVEL_VAR(main), \ LOGLEVEL_VAR(mainMem), \ LOGLEVEL_VAR(mainMemReplayCheck), \ LOGLEVEL_VAR(masReceipt), /* lib/masReceipt */ \