2 * Copyright (C) 1996-2014 The Squid Software Foundation and contributors
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
16 // NP: CPU support for get_tick() determines whether we can profile.
17 // always include get_tick.h first since it may undefine USE_XPROF_STATS
19 #include "profiler/get_tick.h"
20 #include "profiler/xprof_type.h"
24 #define PROF_start(probename) ((void)0)
25 #define PROF_stop(probename) ((void)0)
27 #else /* USE_XPROF_STATS */
29 #define XP_NOBEST (hrtime_t)-1
31 typedef struct _xprof_stats_node xprof_stats_node
;
33 typedef struct _xprof_stats_data xprof_stats_data
;
35 struct _xprof_stats_data
{
46 struct _xprof_stats_node
{
48 xprof_stats_data accu
;
49 xprof_stats_data hist
;
52 typedef xprof_stats_node TimersArray
[1];
55 extern TimersArray
*xprof_Timers
;
57 /* Exported functions */
58 extern void xprof_start(xprof_type type
, const char *timer
);
59 extern void xprof_stop(xprof_type type
, const char *timer
);
60 extern void xprof_event(void *data
);
62 #define PROF_start(probename) xprof_start(XPROF_##probename, #probename)
63 #define PROF_stop(probename) xprof_stop(XPROF_##probename, #probename)
65 #endif /* USE_XPROF_STATS */
70 #endif /* _PROFILING_H_ */