修改静态告警指标

Signed-off-by: liutuantuan <liutuantuan1@huawei.com>
This commit is contained in:
liutuantuan
2024-05-28 21:26:03 +08:00
parent cf497c649c
commit 16deb2be02
2 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -32,7 +32,7 @@ int32_t PCIDEncode(char *inputFile, char *outputPath);
/* in: inputFile, file name format: <product>.sc, out: outputPath/<product>.json */
int32_t PCIDDecode(char *inputFile, char *outputPath);
/* in: inputFile, out: outputPath/rpcid.sc */
int32_t RPCIDEncode(char *inputFile, char *outputPath);
static int32_t RPCIDEncode(char *inputFile, char *outputPath);
/* in: inputFile, out: outputPath/rpcid.json */
int32_t RPCIDDecode(char *inputFile, char *outputPath);
/* in: inputFile, out: outputPath/rpcid.json */
+4 -2
View File
@@ -36,6 +36,7 @@
#define SYSCAP_PREFIX_LEN 17
#define SINGLE_FEAT_LEN (SINGLE_SYSCAP_LEN - SYSCAP_PREFIX_LEN)
#define DOUBLE_SPACE 2
#define UINT8_BIT 8
#define INT_BIT 32
#define RPCID_OUT_BUFFER 32
@@ -132,7 +133,8 @@ static int32_t FreeAfterRPCIDEncode(
return ret;
}
int32_t RPCIDEncode(char *inputFile, char *outputPath) {
static int32_t RPCIDEncode(char *inputFile, char *outputPath)
{
char *contextBuffer = NULL;
uint32_t bufferLen, sysCapSize;
struct JsonObjectSysCap gJsonObjectSysCap;
@@ -168,7 +170,7 @@ int32_t RPCIDEncode(char *inputFile, char *outputPath) {
// 2, to save SysCaptype & SysCapLength
sysCapSize = (uint32_t) ret;
uint32_t convertedBufLen = sizeof(RPCIDHead);
convertedBufLen += (2 * sizeof(uint16_t) + sysCapSize * SINGLE_FEAT_LEN);
convertedBufLen += (DOUBLE_SPACE * sizeof(uint16_t) + sysCapSize * SINGLE_FEAT_LEN);
char *convertedBuffer = (char *) malloc(convertedBufLen);
if (convertedBuffer == NULL) {
PRINT_ERR("malloc failed\n");