#ifndef _PROFILER_XPROF_TYPE_H_
#define _PROFILER_XPROF_TYPE_H_
-
+/* AUTO-GENERATED FILE */
#if USE_XPROF_STATS
-
-// TODO: auto-generate this list from a scan of the source code.
-
-// This list MUST be kept in sync with the PROF_start()/PROF_stop() macros
-// used throughout the rest of the sources.
-
typedef enum {
XPROF_PROF_UNACCOUNTED,
+ XPROF_HttpHeaderClean,
+ XPROF_HttpHeaderParse,
+ XPROF_HttpHeader_getCc,
+ XPROF_HttpMsg_httpMsgParseStep,
+ XPROF_HttpParserParseReqLine,
+ XPROF_HttpStateData_processReplyBody,
+ XPROF_HttpStateData_processReplyHeader,
+ XPROF_HttpStateData_readReply,
+ XPROF_InvokeHandlers,
+ XPROF_MemBuf_append,
+ XPROF_MemBuf_consume,
+ XPROF_MemBuf_grow,
+ XPROF_MemObject_write,
XPROF_PROF_OVERHEAD,
- XPROF_hash_lookup,
- XPROF_splay_splay,
- XPROF_xmalloc,
- XPROF_malloc,
- XPROF_free,
- XPROF_free_const,
- XPROF_xrealloc,
- XPROF_realloc,
- XPROF_xcalloc,
- XPROF_calloc,
- XPROF_xstrdup,
- XPROF_xstrndup,
- XPROF_xstrncpy,
- XPROF_xcountws,
- XPROF_socket,
- XPROF_read,
- XPROF_write,
- XPROF_send,
- XPROF_recv,
- XPROF_sendto,
- XPROF_recvfrom,
- XPROF_accept,
- XPROF_connect,
- XPROF_memPoolChunkNew,
- XPROF_memPoolAlloc,
- XPROF_memPoolFree,
- XPROF_memPoolClean,
- XPROF_aclMatchAclList,
+ XPROF_SignalEngine_checkEvents,
+ XPROF_StoreEntry_write,
+ XPROF_StringAllocAndFill,
+ XPROF_StringAppend,
+ XPROF_StringClean,
+ XPROF_StringInitBuf,
+ XPROF_StringReset,
XPROF_aclCheckFast,
- XPROF_comm_open,
- XPROF_comm_connect_addr,
- XPROF_comm_accept,
- XPROF_comm_close,
- XPROF_comm_udp_sendto,
+ XPROF_aclMatchAclList,
+ XPROF_clientSocketRecipient,
XPROF_commHandleWrite,
+ XPROF_comm_accept,
XPROF_comm_check_incoming,
- XPROF_comm_poll_prep_pfds,
- XPROF_comm_poll_normal,
+ XPROF_comm_close,
+ XPROF_comm_connect_addr,
XPROF_comm_handle_ready_fd,
+ XPROF_comm_open,
+ XPROF_comm_poll_normal,
+ XPROF_comm_poll_prep_pfds,
XPROF_comm_read_handler,
+ XPROF_comm_udp_sendto,
XPROF_comm_write_handler,
- XPROF_storeGet,
- XPROF_storeMaintainSwapSpace,
- XPROF_storeRelease,
- XPROF_diskHandleWrite,
XPROF_diskHandleRead,
+ XPROF_diskHandleWrite,
+ XPROF_esiExpressionEval,
+ XPROF_esiParsing,
+ XPROF_esiProcessing,
+ XPROF_eventRun,
+ XPROF_file_close,
XPROF_file_open,
XPROF_file_read,
XPROF_file_write,
- XPROF_file_close,
- XPROF_esiExpressionEval,
- XPROF_esiProcessing,
- XPROF_esiParsing,
+ XPROF_headersEnd,
+ XPROF_httpRequestFree,
+ XPROF_httpStart,
+ XPROF_mem_hdr_write,
+ XPROF_parseHttpRequest,
+ XPROF_read,
+ XPROF_recv,
+ XPROF_send,
XPROF_storeClient_kickReads,
- XPROF_eventRun,
XPROF_storeDirCallback,
- XPROF_comm_calliocallback,
- XPROF_CommReadCallbackData_callCallback,
- XPROF_CommAcceptCallbackData_callCallback,
- XPROF_CommWriteCallbackData_callCallback,
- XPROF_CommFillCallbackData_callCallback,
- XPROF_HttpStateData_readReply,
- XPROF_HttpStateData_processReplyBody,
- XPROF_StoreEntry_write,
+ XPROF_storeGet,
XPROF_storeGetMemSpace,
- XPROF_MemObject_write,
+ XPROF_storeMaintainSwapSpace,
+ XPROF_storeRelease,
XPROF_storeWriteComplete,
- XPROF_mem_hdr_write,
- XPROF_headersEnd,
- XPROF_parseHttpRequest,
- XPROF_HttpStateData_processReplyHeader,
- XPROF_MemBuf_consume,
- XPROF_MemBuf_append,
- XPROF_MemBuf_grow,
- XPROF_InvokeHandlers,
- XPROF_HttpMsg_httpMsgParseStep,
- XPROF_EventDispatcher_dispatch,
- XPROF_SignalEngine_checkEvents,
- XPROF_Temp1,
- XPROF_Temp2,
- XPROF_Temp3,
- XPROF_clientSocketRecipient,
- XPROF_httpStart,
- XPROF_HttpParserParseReqLine,
- XPROF_httpRequestFree,
- XPROF_HttpHeaderParse,
- XPROF_HttpHeaderClean,
- XPROF_StringInitBuf,
- XPROF_StringAllocAndFill,
- XPROF_StringClean,
- XPROF_StringReset,
- XPROF_StringAppend,
- XPROF_HttpHeader_findEntry,
- XPROF_HttpHeader_getCc,
- XPROF_HttpHeader_getRange,
- XPROF_checkTimeouts,
- XPROF_CommSelect,
+ XPROF_write,
XPROF_LAST
} xprof_type;
-
-#endif /* USE_XPROF_STATS */
-#endif /* _PROFILING_H_ */
+#endif
+#endif
done
}
+# Build XPROF types file from current sources
+echo "#ifndef _PROFILER_XPROF_TYPE_H_" >${ROOT}/lib/profiler/list
+echo "#define _PROFILER_XPROF_TYPE_H_" >>${ROOT}/lib/profiler/list
+echo "/* AUTO-GENERATED FILE */" >>${ROOT}/lib/profiler/list
+echo "#if USE_XPROF_STATS" >>${ROOT}/lib/profiler/list
+echo "typedef enum {" >>${ROOT}/lib/profiler/list
+echo "XPROF_PROF_UNACCOUNTED," >>${ROOT}/lib/profiler/list
+grep -R -h "PROF_start.*" ./* | sed -e 's/ //g; s/PROF_start(/XPROF_/; s/);/,/' | sort -u >>${ROOT}/lib/profiler/list
+echo " XPROF_LAST } xprof_type;" >>${ROOT}/lib/profiler/list
+echo "#endif" >>${ROOT}/lib/profiler/list
+echo "#endif" >>${ROOT}/lib/profiler/list
+mv ${ROOT}/lib/profiler/list ${ROOT}/lib/profiler/xprof_type.h
+
+# Run formating
echo "" >${ROOT}/doc/debug-sections.tmp
srcformat || exit 1
sort -u <${ROOT}/doc/debug-sections.tmp | sort -n >${ROOT}/doc/debug-sections.txt