very quick hack to httpd to show hook usage using APR_HOOK_PROBE_foo macros 24330 -> create_connection 24330 -> core.c 24330 <- core.c 24330 <- create_connection 24330 -> pre_connection 24330 -> mod_reqtimeout.c 24330 <- mod_reqtimeout.c 24330 -> core.c 24330 <- core.c 24330 <- pre_connection 24330 -> process_connection 24330 -> mod_echo.c 24330 <- mod_echo.c 24330 -> http_core.c 24330 -> create_request 24330 -> core.c 24330 <- core.c 24330 -> http_core.c 24330 <- http_core.c 24330 <- create_request 24330 -> post_read_request 24330 -> mod_headers.c 24330 <- mod_headers.c 24330 -> mod_proxy.c 24330 <- mod_proxy.c 24330 -> mod_auth_digest.c 24330 <- mod_auth_digest.c 24330 -> mod_reqtimeout.c 24330 <- mod_reqtimeout.c 24330 -> mod_setenvif.c 24330 <- mod_setenvif.c 24330 <- post_read_request 24330 -> quick_handler 24330 -> mod_cache.c 24330 <- mod_cache.c 24330 -> mod_backdoor.c 24330 <- mod_backdoor.c 24330 <- quick_handler 24330 -> translate_name 24330 -> mod_rewrite.c 24330 <- mod_rewrite.c 24330 -> mod_proxy.c 24330 <- mod_proxy.c 24330 -> mod_alias.c 24330 <- mod_alias.c 24330 -> mod_userdir.c 24330 <- mod_userdir.c 24330 -> mod_vhost_alias.c 24330 <- mod_vhost_alias.c 24330 -> core.c 24330 <- core.c 24330 <- translate_name 24330 -> map_to_storage 24330 -> mod_proxy.c 24330 <- mod_proxy.c 24330 -> http_core.c 24330 <- http_core.c 24330 -> http_core.c 24330 <- http_core.c 24330 -> core.c 24330 <- core.c 24330 <- map_to_storage 24330 -> header_parser 24330 -> mod_setenvif.c 24330 <- mod_setenvif.c 24330 <- header_parser 24330 -> access_checker 24330 -> mod_access_compat.c 24330 <- mod_access_compat.c 24330 -> mod_fcgid.c 24330 <- mod_fcgid.c 24330 <- access_checker 24330 -> check_user_id 24330 -> mod_auth_basic.c 24330 <- mod_auth_basic.c 24330 -> mod_auth_form.c 24330 <- mod_auth_form.c 24330 -> mod_auth_digest.c 24330 <- mod_auth_digest.c 24330 -> mod_fcgid.c 24330 <- mod_fcgid.c 24330 -> mod_authn_core.c 24330 <- mod_authn_core.c 24330 <- check_user_id 24330 -> auth_checker 24330 -> mod_fcgid.c 24330 <- mod_fcgid.c 24330 -> mod_authz_core.c [Mon Dec 14 14:58:39 2009] [debug] mod_authz_core.c(717): [client 127.0.0.1] authorization result of Require all granted: granted 24330 -> error_log 24330 <- error_log [Mon Dec 14 14:58:39 2009] [debug] mod_authz_core.c(717): [client 127.0.0.1] authorization result of : granted 24330 -> error_log 24330 <- error_log 24330 <- mod_authz_core.c 24330 <- auth_checker 24330 -> type_checker 24330 -> mod_negotiation.c 24330 <- mod_negotiation.c 24330 -> mod_mime.c 24330 <- mod_mime.c 24330 -> core.c 24330 <- core.c 24330 <- type_checker 24330 -> fixups 24330 -> core.c 24330 <- core.c 24330 -> mod_proxy.c 24330 <- mod_proxy.c 24330 -> mod_rewrite.c 24330 <- mod_rewrite.c 24330 -> mod_auth_digest.c 24330 <- mod_auth_digest.c 24330 -> mod_env.c 24330 <- mod_env.c 24330 -> mod_dav.c 24330 <- mod_dav.c 24330 -> mod_negotiation.c 24330 <- mod_negotiation.c 24330 -> mod_alias.c 24330 <- mod_alias.c 24330 -> mod_include.c 24330 <- mod_include.c 24330 -> mod_headers.c 24330 <- mod_headers.c 24330 -> mod_dir.c 24330 <- mod_dir.c 24330 -> mod_dir.c 24330 <- mod_dir.c 24330 -> mod_rewrite.c 24330 <- mod_rewrite.c 24330 <- fixups 24330 -> insert_filter 24330 -> core.c 24330 <- core.c 24330 -> mod_case_filter.c 24330 <- mod_case_filter.c 24330 -> mod_case_filter_in.c 24330 <- mod_case_filter_in.c 24330 -> mod_filter.c 24330 <- mod_filter.c 24330 -> mod_expires.c 24330 <- mod_expires.c 24330 -> mod_request.c 24330 <- mod_request.c 24330 -> mod_headers.c 24330 <- mod_headers.c 24330 <- insert_filter 24330 -> handler 24330 -> mod_cache.c 24330 <- mod_cache.c 24330 -> mod_heartmonitor.c 24330 <- mod_heartmonitor.c 24330 -> mod_proxy.c 24330 <- mod_proxy.c 24330 -> mod_proxy_balancer.c 24330 <- mod_proxy_balancer.c 24330 -> mod_auth_form.c 24330 <- mod_auth_form.c 24330 -> mod_auth_form.c 24330 <- mod_auth_form.c 24330 -> mod_auth_form.c 24330 <- mod_auth_form.c 24330 -> util_ldap.c 24330 <- util_ldap.c 24330 -> mod_dav.c 24330 <- mod_dav.c 24330 -> mod_status.c 24330 <- mod_status.c 24330 -> mod_autoindex.c 24330 <- mod_autoindex.c 24330 -> mod_asis.c 24330 <- mod_asis.c 24330 -> mod_info.c 24330 <- mod_info.c 24330 -> mod_cgid.c 24330 <- mod_cgid.c 24330 -> mod_negotiation.c 24330 <- mod_negotiation.c 24330 -> mod_imagemap.c 24330 <- mod_imagemap.c 24330 -> mod_rewrite.c 24330 <- mod_rewrite.c 24330 -> mod_fcgid.c 24330 <- mod_fcgid.c 24330 -> mod_actions.c 24330 <- mod_actions.c 24330 -> mod_dialup.c 24330 <- mod_dialup.c 24330 -> core.c [Mon Dec 14 14:58:39 2009] [error] [client 127.0.0.1] File does not exist: /home/trawick/inst/23/htdocs/foo 24330 -> error_log 24330 <- error_log 24330 <- core.c 24330 <- handler 24330 -> insert_error_filter 24330 -> mod_expires.c 24330 <- mod_expires.c 24330 -> mod_headers.c 24330 <- mod_headers.c 24330 <- insert_error_filter 24330 -> mpm_query 24330 -> mod_backdoor.c 24330 <- mod_backdoor.c 24330 -> worker.c 24330 <- worker.c 24330 <- mpm_query 24330 -> log_transaction 24330 -> mod_reqtimeout.c 24330 <- mod_reqtimeout.c 24330 -> mod_log_config.c 24330 <- mod_log_config.c 24330 <- log_transaction Index: server/log.c =================================================================== --- server/log.c (revision 890428) +++ server/log.c (working copy) @@ -1127,6 +1127,40 @@ apr_pool_cleanup_run(pl->p, pl, piped_log_cleanup); } +void *ap_hook_probe_entry(const char *name) +{ + if (getenv("HOOK_TRACE")) { + fprintf(stderr, "% 8" APR_PID_T_FMT " -> %s\n", getpid(), name); + fflush(stderr); + return (void *)1; + } + return NULL; +} + +void ap_hook_probe_return(void *ud, const char *name) +{ + if (ud) { + fprintf(stderr, "% 8" APR_PID_T_FMT " <- %s\n", getpid(), name); + fflush(stderr); + } +} + +void ap_hook_probe_invoke(void *ud, const char *name, const char *src) +{ + if (ud) { + fprintf(stderr, "% 8" APR_PID_T_FMT " -> %s\n", getpid(), src); + fflush(stderr); + } +} + +void ap_hook_probe_complete(void *ud, const char *name, const char *src) +{ + if (ud) { + fprintf(stderr, "% 8" APR_PID_T_FMT " <- %s\n", getpid(), src); + fflush(stderr); + } +} + AP_IMPLEMENT_HOOK_VOID(error_log, (const char *file, int line, int level, apr_status_t status, const server_rec *s, Index: include/http_connection.h =================================================================== --- include/http_connection.h (revision 890428) +++ include/http_connection.h (working copy) @@ -26,7 +26,7 @@ #ifndef APACHE_HTTP_CONNECTION_H #define APACHE_HTTP_CONNECTION_H -#include "apr_hooks.h" +#include "ap_hooks.h" #include "apr_network_io.h" #include "apr_buckets.h" Index: include/http_protocol.h =================================================================== --- include/http_protocol.h (revision 890428) +++ include/http_protocol.h (working copy) @@ -27,7 +27,7 @@ #define APACHE_HTTP_PROTOCOL_H #include "httpd.h" -#include "apr_hooks.h" +#include "ap_hooks.h" #include "apr_portable.h" #include "apr_mmap.h" #include "apr_buckets.h" Index: include/ap_hooks.h =================================================================== --- include/ap_hooks.h (revision 0) +++ include/ap_hooks.h (revision 0) @@ -0,0 +1,32 @@ +#ifndef AP_HOOKS_H +#define AP_HOOKS_H + +#define APR_HOOK_PROBES_ENABLED + +#ifdef APR_HOOK_PROBE_ENTRY /* apr_hooks.h included before this? */ +#undef APR_HOOK_PROBE_ENTRY +#undef APR_HOOK_PROBE_RETURN +#undef APR_HOOK_PROBE_INVOKE +#undef APR_HOOK_PROBE_COMPLETE +#endif + +#define APR_HOOK_PROBE_ENTRY(ud,ns,name) \ + ud = ap_hook_probe_entry(#name) + +#define APR_HOOK_PROBE_RETURN(ud,ns,name,rv) \ + ap_hook_probe_return(ud, #name) + +#define APR_HOOK_PROBE_INVOKE(ud,ns,name,src) \ + ap_hook_probe_invoke(ud, #name, src) + +#define APR_HOOK_PROBE_COMPLETE(ud,ns,name,src,rv) \ + ap_hook_probe_complete(ud, #name, src) + +#include "apr_hooks.h" + +void *ap_hook_probe_entry(const char *name); +void ap_hook_probe_return(void *ud, const char *name); +void ap_hook_probe_invoke(void *ud, const char *name, const char *src); +void ap_hook_probe_complete(void *ud, const char *name, const char *src); + +#endif Index: include/http_config.h =================================================================== --- include/http_config.h (revision 890428) +++ include/http_config.h (working copy) @@ -26,7 +26,7 @@ #ifndef APACHE_HTTP_CONFIG_H #define APACHE_HTTP_CONFIG_H -#include "apr_hooks.h" +#include "ap_hooks.h" #include "util_cfgtree.h" #ifdef __cplusplus Index: include/scoreboard.h =================================================================== --- include/scoreboard.h (revision 890428) +++ include/scoreboard.h (working copy) @@ -32,7 +32,7 @@ #endif #include "ap_config.h" -#include "apr_hooks.h" +#include "ap_hooks.h" #include "apr_thread_proc.h" #include "apr_portable.h" #include "apr_shm.h" Index: include/ap_config.h =================================================================== --- include/ap_config.h (revision 890428) +++ include/ap_config.h (working copy) @@ -23,7 +23,7 @@ #define AP_CONFIG_H #include "apr.h" -#include "apr_hooks.h" +#include "ap_hooks.h" #include "apr_optional_hooks.h" /* Although this file doesn't declare any hooks, declare the hook group here */ Index: include/http_request.h =================================================================== --- include/http_request.h (revision 890428) +++ include/http_request.h (working copy) @@ -47,7 +47,7 @@ #ifndef APACHE_HTTP_REQUEST_H #define APACHE_HTTP_REQUEST_H -#include "apr_hooks.h" +#include "ap_hooks.h" #include "apr_optional.h" #include "util_filter.h"