From: John Wolfe Date: Fri, 11 Sep 2020 19:11:04 +0000 (-0700) Subject: Changes to common header files not applicable to open-vm-tools. X-Git-Tag: stable-11.2.0~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=27ef6c9deabdc9fe31de7b4f5da02a4408463410;p=thirdparty%2Fopen-vm-tools.git Changes to common header files not applicable to open-vm-tools. --- diff --git a/open-vm-tools/lib/include/log.h b/open-vm-tools/lib/include/log.h index 7381ba883..55e71ab81 100644 --- a/open-vm-tools/lib/include/log.h +++ b/open-vm-tools/lib/include/log.h @@ -94,34 +94,6 @@ 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); @@ -489,6 +461,8 @@ typedef Bool (GetOpId)(size_t maxStringLen, void Log_RegisterOpIdFunction(GetOpId *getOpIdFunc); +void Log_LoadModuleFilters(struct CfgInterface *cfgIf); + #endif /* !VMM */ #if defined(__cplusplus) @@ -496,3 +470,39 @@ void Log_RegisterOpIdFunction(GetOpId *getOpIdFunc); #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 f94faa0da..1ea485bad 100644 --- a/open-vm-tools/lib/include/loglevel_userVars.h +++ b/open-vm-tools/lib/include/loglevel_userVars.h @@ -27,8 +27,6 @@ /* 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), \ @@ -139,6 +137,7 @@ LOGLEVEL_VAR(macfilter), \ LOGLEVEL_VAR(machPoll), \ LOGLEVEL_VAR(maclatency), \ + LOGLEVEL_VAR(main), \ LOGLEVEL_VAR(mainMem), \ LOGLEVEL_VAR(mainMemReplayCheck), \ LOGLEVEL_VAR(masReceipt), /* lib/masReceipt */ \