]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Common header file change not applicable to open-vm-tools.
authorJohn Wolfe <jwolfe@vmware.com>
Mon, 7 Feb 2022 17:40:00 +0000 (09:40 -0800)
committerJohn Wolfe <jwolfe@vmware.com>
Mon, 7 Feb 2022 17:40:00 +0000 (09:40 -0800)
open-vm-tools/lib/include/log.h

index 163a32381e3b23907ec173c5845ab658cdaaa5ca..1e9f8534c6787c738bb56aa826aedd07389614ae 100644 (file)
@@ -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)