4#if MOS_CONFIG(MOS_PROFILING)
17#if MOS_CONFIG(MOS_PROFILING)
18#define PROFILER_HEADER "\nname,start_time,end_time,total_time\n"
19#define PROFILER_LINE "%s,%llu,%llu,%llu"
21static console *profile_console =
NULL;
25static bool profile_output_console(
const char *console)
29 console_write(profile_console, PROFILER_HEADER,
strlen(PROFILER_HEADER));
33MOS_SETUP(
"profile_console", profile_output_console);
42 const u64 total = end - start;
50 const size_t len =
snprintf(profile_buffer,
sizeof(profile_buffer), PROFILER_LINE
"\n", name_buffer, start, end, total);
51 console_write(profile_console, profile_buffer, len);
#define MOS_PRINTK_BUFFER_SIZE
Console * console_get(const char *name)
MOSAPI int vsnprintf(char *__restrict buf, size_t size, const char *__restrict format, va_list args)
int snprintf(char *__restrict str, size_t size, const char *__restrict format,...)
static size_t strlen(const char *s)
#define profile_leave(p,...)
#define MOS_SETUP(_param, _fn)
#define spinlock_acquire(lock)
#define spinlock_release(lock)