1 /* 2 * Copyright (c) 2021-2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef HISYSEVENT_DEF_H 17 #define HISYSEVENT_DEF_H 18 19 namespace OHOS { 20 namespace HiviewDFX { 21 static constexpr int SUCCESS = 0; 22 23 static constexpr int ERR_DOMAIN_NAME_INVALID = -1; 24 static constexpr int ERR_EVENT_NAME_INVALID = -2; 25 static constexpr int ERR_DOES_NOT_INIT = -3; 26 static constexpr int ERR_OVER_SIZE = -4; 27 static constexpr int ERR_SEND_FAIL = -5; 28 static constexpr int ERR_WRITE_IN_HIGH_FREQ = -6; 29 static constexpr int ERR_DOMAIN_MASKED = -7; 30 static constexpr int ERR_EMPTY_EVENT = -8; 31 static constexpr char ERR_MSG_LEVEL0[][32] = { 32 "invalid domain name", 33 "invalid event name", 34 "socket init error", 35 "over size", 36 "send data failed", 37 "write too frequently", 38 "domain has been masked", 39 "empty event" 40 }; 41 42 static constexpr int ERR_KEY_NAME_INVALID = 1; 43 static constexpr int ERR_VALUE_LENGTH_TOO_LONG = 2; 44 static constexpr int ERR_KEY_NUMBER_TOO_MUCH = 3; 45 static constexpr int ERR_ARRAY_TOO_MUCH = 4; 46 static constexpr int ERR_VALUE_INVALID = 5; 47 static constexpr char ERR_MSG_LEVEL1[][32] = { 48 "invalid key name", 49 "string value too long", 50 "too many keys (>128)", 51 "too many array items (>100)", 52 "invalid value" 53 }; 54 55 static constexpr unsigned int MAX_DOMAIN_LENGTH = 16; 56 static constexpr unsigned int MAX_EVENT_NAME_LENGTH = 32; 57 static constexpr unsigned int MAX_PARAM_NAME_LENGTH = 48; 58 static constexpr unsigned int MAX_ARRAY_SIZE = 100; 59 static constexpr unsigned int MAX_PARAM_NUMBER = 128; 60 static constexpr unsigned int MAX_STRING_LENGTH = 256 * 1024; 61 static constexpr unsigned int MAX_DATA_SIZE = 384 * 1024; 62 } // namespace HiviewDFX 63 } // namespace OHOS 64 65 #endif // HISYSEVENT_DEF_H 66 67