From: Oliver Kurth Date: Fri, 2 Nov 2018 22:28:25 +0000 (-0700) Subject: VIGOR and RPCI definitions for the tools hang detector events. X-Git-Tag: stable-11.0.0~323 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=31aaa5cd048bbc6eeb4221df3f92b30c320b132d;p=thirdparty%2Fopen-vm-tools.git VIGOR and RPCI definitions for the tools hang detector events. Define an array of ToolsHealthEvent to record the last N tools hang events. By keeping a list of historical events since the power on, we help ourselves trouble shooting guest/toolsd issues. Use the first array element for the latest event. This simplifies implementation as the DynArray can be easily capped by setting the array count. This requires us to add a PushFront function to add new element to the front of the DynArray. Added the RPCI handler for the tools hang detector RPCI messages. Added feature switch Tools_Update_Health. --- diff --git a/open-vm-tools/lib/include/dynarray.h b/open-vm-tools/lib/include/dynarray.h index 56f787dc9..e73b95235 100644 --- a/open-vm-tools/lib/include/dynarray.h +++ b/open-vm-tools/lib/include/dynarray.h @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2004-2017 VMware, Inc. All rights reserved. + * Copyright (C) 2004-2018 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 @@ -317,6 +317,22 @@ DynArray_Copy(DynArray *src, // IN return TRUE; \ } \ \ + static INLINE Bool \ + T##Array_PushFront(T##Array *a, TYPE val) \ + { \ + unsigned int count = T##Array_Count(a); \ + if (!T##Array_SetCount(a, count + 1)) { \ + return FALSE; \ + } else { \ + unsigned int i; \ + for (i = count; i > 0; --i) { \ + *T##Array_AddressOf(a, i) = *T##Array_AddressOf(a, i-1); \ + } \ + *T##Array_AddressOf(a, 0) = val; \ + return TRUE; \ + } \ + } \ + \ static INLINE unsigned int \ T##Array_AllocCount(T##Array *a) \ { \ diff --git a/open-vm-tools/lib/include/vmware/guestrpc/tclodefs.h b/open-vm-tools/lib/include/vmware/guestrpc/tclodefs.h index c9288e0d9..560f438dc 100644 --- a/open-vm-tools/lib/include/vmware/guestrpc/tclodefs.h +++ b/open-vm-tools/lib/include/vmware/guestrpc/tclodefs.h @@ -95,6 +95,14 @@ #define GUEST_LOG_STATE_CMD "guest.log.state" #define GUEST_LOG_TEXT_CMD "guest.log.text" +/* + * Update tools health command. + */ +#define UPDATE_TOOLS_HEALTH_CMD "update.tools.health" +#define TOOLS_HEALTH_NORMAL_KEY "normal" +#define TOOLS_HEALTH_HUNG_KEY "hung" +#define TOOLS_HEALTH_GUEST_SLOW_KEY "guest_slow" + /* * The max selection buffer length has to be less than the * ipc msg max size b/c the selection is transferred from mks -> vmx