20#ifndef FREERDP_UTILS_PROFILER_H
21#define FREERDP_UTILS_PROFILER_H
23#include <freerdp/api.h>
24#include <freerdp/utils/stopwatch.h>
31 typedef struct S_PROFILER PROFILER;
33 FREERDP_API
void profiler_free(PROFILER* profiler);
35 WINPR_ATTR_MALLOC(profiler_free, 1)
37 FREERDP_API PROFILER* profiler_create(const
char* name);
39 FREERDP_API
void profiler_enter(PROFILER* profiler);
40 FREERDP_API
void profiler_exit(PROFILER* profiler);
42 FREERDP_API
void profiler_print_header(
void);
43 FREERDP_API
void profiler_print(PROFILER* profiler);
44 FREERDP_API
void profiler_print_footer(
void);
47#define PROFILER_RENAME(prof, name) \
50 profiler_free(prof); \
51 prof = profiler_create(name); \
53#define PROFILER_DEFINE(prof) PROFILER* prof;
54#define PROFILER_CREATE(prof, name) prof = profiler_create(name);
55#define PROFILER_FREE(prof) profiler_free(prof);
56#define PROFILER_ENTER(prof) profiler_enter(prof);
57#define PROFILER_EXIT(prof) profiler_exit(prof);
58#define PROFILER_PRINT_HEADER profiler_print_header();
59#define PROFILER_PRINT(prof) profiler_print(prof);
60#define PROFILER_PRINT_FOOTER profiler_print_footer();
62#define PROFILER_RENAME(prof, name) \
67#define PROFILER_DEFINE(prof)
68#define PROFILER_CREATE(prof, name) \
72#define PROFILER_FREE(prof) \
76#define PROFILER_ENTER(prof) \
80#define PROFILER_EXIT(prof) \
84#define PROFILER_PRINT_HEADER \
88#define PROFILER_PRINT(prof) \
92#define PROFILER_PRINT_FOOTER \