1 /******************************************************************************
3 * Copyright (c) 2019 Intel.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 *******************************************************************************/
20 * @file This file consist of fapi logging macro.
24 #ifndef NR5G_FAPI_LOG_H_
25 #define NR5G_FAPI_LOG_H_
27 #define NR5G_FAPI_STATS_FNAME "FapiStats.txt"
29 typedef enum _nr5g_fapi_log_types_t {
35 } nr5g_fapi_log_types_t;
37 extern nr5g_fapi_log_types_t nr5g_fapi_log_level_g;
38 // get_logger_type_str is utility function, returns logging lever string.
39 char *get_logger_type_str(
40 nr5g_fapi_log_types_t e);
42 void nr5g_fapi_set_log_level(
43 nr5g_fapi_log_types_t new_level);
45 nr5g_fapi_log_types_t nr5g_fapi_get_log_level(
48 // NR5G_FAPI__LOG utility Macro for logging.
49 #define NR5G_FAPI_LOG(TYPE, MSG) do { \
50 if(TYPE == ERROR_LOG) { \
51 printf("[%s]", get_logger_type_str(TYPE)); \
57 if((nr5g_fapi_log_level_g > NONE_LOG) && (TYPE <= nr5g_fapi_log_level_g)) { \
58 printf("[%s]", get_logger_type_str(TYPE)); \
65 typedef struct _nr5g_fapi_performance_statistic {
70 } nr5g_fapi_performance_statistic_t;
72 extern nr5g_fapi_log_types_t nr5g_fapi_log_level_g;
73 extern nr5g_fapi_performance_statistic_t fapi_statis_info_wls_get_dl;
74 extern nr5g_fapi_performance_statistic_t fapi_statis_info_parse_dl;
75 extern nr5g_fapi_performance_statistic_t fapi_statis_info_wls_send_dl;
76 extern nr5g_fapi_performance_statistic_t fapi_statis_info_wls_get_ul;
77 extern nr5g_fapi_performance_statistic_t fapi_statis_info_parse_ul;
78 extern nr5g_fapi_performance_statistic_t fapi_statis_info_wls_send_ul;
79 extern uint64_t tick_total_wls_get_per_tti_dl;
80 extern uint64_t tick_total_parse_per_tti_dl;
81 extern uint64_t tick_total_wls_send_per_tti_dl;
82 extern uint64_t tick_total_wls_get_per_tti_ul;
83 extern uint64_t tick_total_parse_per_tti_ul;
84 extern uint64_t tick_total_wls_send_per_tti_ul;
85 extern uint16_t g_statistic_start_flag;
87 uint16_t nr5g_fapi_statistic_info_set(
88 nr5g_fapi_performance_statistic_t * fapi_statis_info,
89 uint64_t * tick_val_in,
92 uint16_t nr5g_fapi_statistic_info_init(
95 uint16_t nr5g_fapi_statistic_info_print(
97 uint16_t nr5g_fapi_statistic_info_set_all(
100 #endif // NR5G_FAPI_LOG_H_