• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 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 char ERR_MSG_LEVEL0[][32] = {
31     "invalid domain name",
32     "invalid event name",
33     "socket init error",
34     "over size",
35     "send data failed",
36     "write too frequently",
37     "domain has been masked"
38 };
39 
40 static constexpr int ERR_KEY_NAME_INVALID = 1;
41 static constexpr int ERR_VALUE_LENGTH_TOO_LONG = 2;
42 static constexpr int ERR_KEY_NUMBER_TOO_MUCH = 3;
43 static constexpr int ERR_ARRAY_TOO_MUCH = 4;
44 static constexpr int ERR_VALUE_INVALID = 5;
45 static constexpr char ERR_MSG_LEVEL1[][32] = {
46     "invalid key name",
47     "string value too long",
48     "too many keys (>128)",
49     "too many array items (>100)",
50     "invalid value"
51 };
52 
53 static constexpr unsigned int MAX_DOMAIN_LENGTH = 16;
54 static constexpr unsigned int MAX_EVENT_NAME_LENGTH = 32;
55 static constexpr unsigned int MAX_PARAM_NAME_LENGTH = 48;
56 static constexpr unsigned int MAX_ARRAY_SIZE = 100;
57 static constexpr unsigned int MAX_PARAM_NUMBER = 128;
58 static constexpr unsigned int MAX_STRING_LENGTH = 256 * 1024;
59 static constexpr unsigned int MAX_DATA_SIZE = 384 * 1024;
60 } // namespace HiviewDFX
61 } // namespace OHOS
62 
63 #endif // HISYSEVENT_DEF_H
64 
65