X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?p=o-du%2Fphy.git;a=blobdiff_plain;f=fapi_5g%2Fsource%2Finclude%2Fnr5g_fapi_log.h;fp=fapi_5g%2Fsource%2Finclude%2Fnr5g_fapi_log.h;h=678648d29a128a15d000b58919e99f24599300ec;hp=8c0a03715221b629d90e222f21c85c68e4747e32;hb=70d9d920dd4e575f085f1f1a9050fefd1c10e127;hpb=331df2273a6667941167c9bcc141a517369bdf43 diff --git a/fapi_5g/source/include/nr5g_fapi_log.h b/fapi_5g/source/include/nr5g_fapi_log.h index 8c0a037..678648d 100644 --- a/fapi_5g/source/include/nr5g_fapi_log.h +++ b/fapi_5g/source/include/nr5g_fapi_log.h @@ -27,12 +27,11 @@ #define NR5G_FAPI_STATS_FNAME "FapiStats.txt" typedef enum _nr5g_fapi_log_types_t { - INFO_LOG = 0, + NONE_LOG = 0, + INFO_LOG, // default DEBUG_LOG, ERROR_LOG, TRACE_LOG, - HEXDUMP_LOG, - NONE_LOG // default } nr5g_fapi_log_types_t; extern nr5g_fapi_log_types_t nr5g_fapi_log_level_g; @@ -49,31 +48,53 @@ nr5g_fapi_log_types_t nr5g_fapi_get_log_level( // NR5G_FAPI__LOG utility Macro for logging. #define NR5G_FAPI_LOG(TYPE, MSG) do { \ if(TYPE == ERROR_LOG) { \ - printf("[NR5G_FAPI][%s]", get_logger_type_str(TYPE)); \ + printf("[%s]", get_logger_type_str(TYPE)); \ printf MSG ;\ printf("\n");\ } \ else \ { \ - if(nr5g_fapi_log_level_g == NONE_LOG) { \ - } \ - else if(TYPE <= nr5g_fapi_log_level_g) { \ - printf("[NR5G_FAPI][%s]", get_logger_type_str(TYPE)); \ - printf MSG ;\ - printf("\n");\ - } \ - else if(TYPE <= nr5g_fapi_log_level_g && TYPE == DEBUG_LOG) { \ - printf("[NR5G_FAPI][%s]", get_logger_type_str(TYPE)); \ + if((nr5g_fapi_log_level_g > NONE_LOG) && (TYPE <= nr5g_fapi_log_level_g)) { \ + printf("[%s]", get_logger_type_str(TYPE)); \ printf MSG ;\ printf("\n");\ } \ - else if(TYPE == nr5g_fapi_log_level_g && TYPE == TRACE_LOG) { \ - printf("[NR5G_FAPI][%s]", get_logger_type_str(TYPE)); \ - printf MSG ;\ - printf("\n");\ - } \ - else {}\ } \ } while(0) +typedef struct _nr5g_fapi_performance_statistic { + uint64_t min_cycle; + uint64_t max_cycle; + uint64_t avg_cycle; + uint32_t count; +} nr5g_fapi_performance_statistic_t; + +extern nr5g_fapi_log_types_t nr5g_fapi_log_level_g; +extern nr5g_fapi_performance_statistic_t fapi_statis_info_wls_get_dl; +extern nr5g_fapi_performance_statistic_t fapi_statis_info_parse_dl; +extern nr5g_fapi_performance_statistic_t fapi_statis_info_wls_send_dl; +extern nr5g_fapi_performance_statistic_t fapi_statis_info_wls_get_ul; +extern nr5g_fapi_performance_statistic_t fapi_statis_info_parse_ul; +extern nr5g_fapi_performance_statistic_t fapi_statis_info_wls_send_ul; +extern uint64_t tick_total_wls_get_per_tti_dl; +extern uint64_t tick_total_parse_per_tti_dl; +extern uint64_t tick_total_wls_send_per_tti_dl; +extern uint64_t tick_total_wls_get_per_tti_ul; +extern uint64_t tick_total_parse_per_tti_ul; +extern uint64_t tick_total_wls_send_per_tti_ul; +extern uint16_t g_statistic_start_flag; + +uint16_t nr5g_fapi_statistic_info_set( + nr5g_fapi_performance_statistic_t * fapi_statis_info, + uint64_t * tick_val_in, + uint16_t start_flag); + +uint16_t nr5g_fapi_statistic_info_init( + ); + +uint16_t nr5g_fapi_statistic_info_print( + ); +uint16_t nr5g_fapi_statistic_info_set_all( + ); + #endif // NR5G_FAPI_LOG_H_