]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Maintenance: auto-sync XPROF counter types with sources
authorAmos Jeffries <squid3@treenet.co.nz>
Mon, 10 Jan 2011 11:01:26 +0000 (04:01 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 10 Jan 2011 11:01:26 +0000 (04:01 -0700)
lib/profiler/xprof_type.h
scripts/source-maintenance.sh

index 9315aafe6b7498f4ac16676c574c0ad5721cb030..49dd19b016ac4dfc501c5f0b907ee3528525234c 100644 (file)
 #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
index 65c3d496ba1598ca9806a75c6deaca7fe06fc2ba..3acebeb710d543a29c596893d597bbc4f4cd51b6 100755 (executable)
@@ -114,6 +114,20 @@ for FILENAME in `ls -1`; do
 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