1 /* 2 * Copyright (c) 2022 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 HKS_HISYSEVENT_WRAPPER_H 17 #define HKS_HISYSEVENT_WRAPPER_H 18 19 #include "hks_type_inner.h" 20 21 #ifdef __cplusplus 22 extern "C" { 23 #endif 24 25 struct EventValues { 26 uint32_t userId; 27 uint32_t processName; 28 uint32_t keyType; 29 int32_t errorCode; 30 }; 31 32 enum EventType { 33 FAULT, 34 STATISTIC, 35 SECURITY, 36 BEHAVIOR, 37 }; 38 39 enum EventPerformanceID { 40 HUKS_TRANSFER_KEY = 1 << 5, 41 }; 42 43 int WriteEvent(enum EventType eventType, const char *functionName, const struct EventValues *eventValues, 44 const char *extra); 45 46 int WritePerformanceEvent(enum EventPerformanceID performanceId); 47 #ifdef __cplusplus 48 } 49 #endif 50 51 #endif