49 lines
1.4 KiB
C
49 lines
1.4 KiB
C
/*******************************************************************************************
|
|
# Copyright (c) 2025 Quaming Intelligent Technology Co., Ltd.
|
|
# All Rights Reserved.
|
|
# Confidential and Proprietary - Quaming Intelligent Technology Co., Ltd.
|
|
#*******************************************************************************************/
|
|
#ifndef __QUA_DEBUG_UTILS_H__
|
|
#define __QUA_DEBUG_UTILS_H__
|
|
|
|
#include "common/qua_type.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef struct qua_debug_fps {
|
|
QUA_S64 start_time_ms;
|
|
QUA_U64 start_count;
|
|
QUA_U64 instant_count;
|
|
} qua_debug_fps_t;
|
|
|
|
/**
|
|
* clock can be:
|
|
* CLOCK_REALTIME,
|
|
* CLOCK_MONOTONIC,
|
|
* CLOCK_PROCESS_CPUTIME_ID,
|
|
* CLOCK_THREAD_CPUTIME_ID,
|
|
* CLOCK_BOOTTIME
|
|
**/
|
|
QUA_S64 system_time(QUA_S32 clock);
|
|
|
|
/**
|
|
* print_interval can be used to control print frequency
|
|
**/
|
|
QUA_VOID qua_print_fps(QUA_CONST_CHAR *tag, qua_debug_fps_t *debug_fps, QUA_U32 print_interval);
|
|
/**
|
|
* This function is used to print time consumption from the time recorded by start_time_ns returned by system_time()
|
|
**/
|
|
QUA_VOID qua_print_elapsed_time(QUA_CONST_CHAR *tag, QUA_S64 clock, QUA_S64 start_time_ns);
|
|
/**
|
|
* max_frames can be used to control printing the first number of frames
|
|
**/
|
|
QUA_VOID qua_dump_frame(QUA_CONST_CHAR *path, QUA_CONST_CHAR *name, QUA_VOID *data, QUA_U32 size, QUA_U32 max_frames);
|
|
|
|
#ifdef __cplusplus
|
|
} /* extern "C" */
|
|
#endif
|
|
|
|
#endif
|