在配置文件里指定了use epoll,也存到ngx_event_conf_t ecf的ecf->use域,那么是哪里使用这个配置,找到epoll的一系列回调函数的呢,
(gdb) bt
#0 ngx_epoll_init (cycle=0x72d530, timer=0) at src/event/modules/ngx_epoll_module.c:327
#1 0x0000000000441f71 in ngx_event_process_init (cycle=0x72d530) at src/event/ngx_event.c:620
#2 0x0000000000450bec in ngx_worker_process_init (cycle=0x72d530, worker=0) at src/os/unix/ngx_process_cycle.c:902
#3 0x00000000004503f1 in ngx_worker_process_cycle (cycle=0x72d530, data=0x0) at src/os/unix/ngx_process_cycle.c:734
#4 0x000000000044cca6 in ngx_spawn_process (cycle=0x72d530, proc=0x4503b0 <ngx_worker_process_cycle>, data=0x0,
name=0x4dcfcb "worker process", respawn=-3) at src/os/unix/ngx_process.c:198
#5 0x000000000044f2e1 in ngx_start_worker_processes (cycle=0x72d530, n=2, type=-3) at src/os/unix/ngx_process_cycle.c:358
#6 0x000000000044e894 in ngx_master_process_cycle (cycle=0x72d530) at src/os/unix/ngx_process_cycle.c:130
#7 0x000000000040ba95 in main (argc=5, argv=0x7fffffffe6c8) at src/core/nginx.c:367
在ngx_event_process_init调用module->actions.init(cycle, ngx_timer_resolution)之前,
for (m = 0; cycle->modules[m]; m++) {
if (cycle->modules[m]->type != NGX_EVENT_MODULE) {
continue;
}
if (cycle->modules[m]->ctx_index != ecf->use) {
continue;
}
而ecf->use正是epoll的ctx index