From: John Wolfe Date: Mon, 7 Feb 2022 17:40:00 +0000 (-0800) Subject: Common header file change not applicable to open-vm-tools. X-Git-Tag: stable-12.1.0~144 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=05943d86fbc47821c3036eaa3b11b7b7a1eb2780;p=thirdparty%2Fopen-vm-tools.git Common header file change 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 163a32381..1e9f8534c 100644 --- a/open-vm-tools/lib/include/log.h +++ b/open-vm-tools/lib/include/log.h @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2021 VMware, Inc. All rights reserved. + * Copyright (C) 1998-2022 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -716,6 +716,33 @@ Log_LoadModuleFilters(const char *appPrefix, long Log_OffsetUtc(void); +/* + * log throttling: + * + * throttleThreshold = start log throttling only after this many bytes have + * been logged (allows initial vmx startup spew). + * + * throttleBPS = start throttling if more than this many bytes per second are + * logged. Continue throttling until rate drops below this value. + * + * bytesLogged = total bytes logged. + * + * logging rate = (bytesLogged - lastBytesSample)/(curTime - lastSampleTime) + */ + +typedef struct { + Bool throttled; + uint32 throttleThreshold; + uint32 throttleBPS; + uint64 bytesLogged; + VmTimeType lastSampleTime; + uint64 lastBytesSample; +} LogThrottleInfo; + +Bool +Log_IsThrottled(LogThrottleInfo *info, + size_t msgLen); + #endif /* !VMM */ #if defined(__cplusplus)