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 PROFILER* profiler_create(
const char* name);
 
   34  FREERDP_API 
void profiler_free(PROFILER* profiler);
 
   36  FREERDP_API 
void profiler_enter(PROFILER* profiler);
 
   37  FREERDP_API 
void profiler_exit(PROFILER* profiler);
 
   39  FREERDP_API 
void profiler_print_header(
void);
 
   40  FREERDP_API 
void profiler_print(PROFILER* profiler);
 
   41  FREERDP_API 
void profiler_print_footer(
void);
 
   44#define PROFILER_RENAME(prof, name)   \ 
   47    profiler_free(prof);          \ 
   48    prof = profiler_create(name); \ 
   50#define PROFILER_DEFINE(prof) PROFILER* prof; 
   51#define PROFILER_CREATE(prof, name) prof = profiler_create(name); 
   52#define PROFILER_FREE(prof) profiler_free(prof); 
   53#define PROFILER_ENTER(prof) profiler_enter(prof); 
   54#define PROFILER_EXIT(prof) profiler_exit(prof); 
   55#define PROFILER_PRINT_HEADER profiler_print_header(); 
   56#define PROFILER_PRINT(prof) profiler_print(prof); 
   57#define PROFILER_PRINT_FOOTER profiler_print_footer(); 
   59#define PROFILER_RENAME(prof, name) \ 
   64#define PROFILER_DEFINE(prof) 
   65#define PROFILER_CREATE(prof, name) \ 
   69#define PROFILER_FREE(prof) \ 
   73#define PROFILER_ENTER(prof) \ 
   77#define PROFILER_EXIT(prof) \ 
   81#define PROFILER_PRINT_HEADER \ 
   85#define PROFILER_PRINT(prof) \ 
   89#define PROFILER_PRINT_FOOTER \