Changeset f760d4895a5e1b4ab500749f7274fc84c215cfa7

Show
Ignore:
Timestamp:
11/17/11 22:52:04 (3 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1321570324 -0500
git-parent:

[69739f12f01572a70dba9670fdeb6952668ea0f5]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1321570324 -0500
Message:

dtrace probes in the eventer

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • .gitignore

    r69739f1 rf760d48  
    1414src/*.dSYM 
    1515src/dtrace_probes.h 
     16src/eventer/dtrace_probes.h 
    1617src/lua/src/lua 
    1718src/modules/*.dSYM 
  • src/eventer/Makefile.in

    r06601a4 rf760d48  
    1919all:    libeventer.a 
    2020 
    21 libeventer.a:   $(OBJS) 
     21@DTRACEOBJ@:    $(OBJS) 
     22        @-test -n "@DTRACE@" && \ 
     23                @DTRACE@ @DTRACEFLAGS@ -G -s dtrace_probes.d -o @DTRACEOBJ@ $(OBJS) 
     24 
     25noit_log.o:     @DTRACEHDR@ 
     26 
     27@DTRACEHDR@:    dtrace_probes.d 
     28        @-test -z "@DTRACE@" && cp ./@DTRACEHDR@.stock ./@DTRACEHDR@ 
     29        @-test -n "@DTRACE@" && @DTRACE@ -h -s dtrace_probes.d 
     30 
     31libeventer.a:   $(OBJS) @DTRACEOBJ@ 
    2232        @rm -f $@ 
    23         @$(AR) cq $@ $(OBJS) 
     33        @$(AR) cq $@ $(OBJS) @DTRACEOBJ@ 
    2434        @echo "- archiving $@" 
    2535        @$(RANLIB) $@ 
     36 
     37$(OBJS):        @DTRACEHDR@ 
    2638 
    2739.c.o: 
  • src/eventer/eventer_epoll_impl.c

    rcd97caa rf760d48  
    3636#include "utils/noit_skiplist.h" 
    3737#include "utils/noit_log.h" 
     38#include "eventer/dtrace_probes.h" 
    3839 
    3940#include <errno.h> 
     
    199200  noitLT(eventer_deb, &__now, "epoll: fire on %d/%x to %s(%p)\n", 
    200201         fd, mask, cbname?cbname:"???", e->callback); 
     202  EVENTER_CALLBACK_ENTRY(e->callback, cbname, fd, e->mask, mask); 
    201203  newmask = e->callback(e, mask, e->closure, &__now); 
     204  EVENTER_CALLBACK_RETURN(e->callback, cbname, newmask); 
    202205 
    203206  if(newmask) { 
  • src/eventer/eventer_impl.c

    ra335d72 rf760d48  
    3535#include "utils/noit_log.h" 
    3636#include "utils/noit_skiplist.h" 
     37#include "eventer/dtrace_probes.h" 
    3738#include <pthread.h> 
    3839#include <errno.h> 
     
    248249  while(max_timed_events_to_process-- > 0) { 
    249250    int newmask; 
     251    const char *cbname = NULL; 
    250252    eventer_t timed_event; 
    251253 
     
    267269    pthread_mutex_unlock(&te_lock); 
    268270    if(timed_event == NULL) break; 
    269     if(EVENTER_DEBUGGING) { 
    270       const char *cbname; 
     271    if(EVENTER_DEBUGGING || 
     272       EVENTER_CALLBACK_ENTRY_ENABLED() || 
     273       EVENTER_CALLBACK_RETURN_ENABLED()) { 
    271274      cbname = eventer_name_for_callback(timed_event->callback); 
    272275      noitLT(eventer_deb, now, "debug: timed dispatch(%s)\n", 
     
    274277    } 
    275278    /* Make our call */ 
     279    EVENTER_CALLBACK_ENTRY(timed_event->callback, cbname, -1, 
     280                           timed_event->mask, EVENTER_TIMER); 
    276281    newmask = timed_event->callback(timed_event, EVENTER_TIMER, 
    277282                                    timed_event->closure, now); 
     283    EVENTER_CALLBACK_RETURN(timed_event->callback, cbname, newmask); 
    278284    if(newmask) 
    279285      eventer_add_timed(timed_event); 
  • src/eventer/eventer_jobq.c

    r1593acf rf760d48  
    3535#include "utils/noit_atomic.h" 
    3636#include "eventer/eventer.h" 
     37#include "eventer/dtrace_probes.h" 
    3738#include <errno.h> 
    3839#include <setjmp.h> 
     
    263264         * one's soul out. 
    264265         */ 
    265         if(my_precious) 
     266        if(my_precious) { 
     267          EVENTER_CALLBACK_ENTRY(my_precious->callback, NULL, 
     268                                 my_precious->fd, my_precious->mask, 
     269                                 EVENTER_ASYNCH_CLEANUP); 
    266270          my_precious->callback(my_precious, EVENTER_ASYNCH_CLEANUP, 
    267271                                my_precious->closure, &job->finish_time); 
     272          EVENTER_CALLBACK_RETURN(my_precious->callback, NULL, -1); 
     273        } 
    268274      } 
    269275      jobcopy = malloc(sizeof(*jobcopy)); 
     
    290296  while((job = eventer_jobq_dequeue_nowait(jobq)) != NULL) { 
    291297    int newmask; 
     298    EVENTER_CALLBACK_ENTRY(job->fd_event->callback, NULL, 
     299                           job->fd_event->fd, job->fd_event->mask, 
     300                           job->fd_event->mask); 
    292301    newmask = job->fd_event->callback(job->fd_event, job->fd_event->mask, 
    293302                                      job->fd_event->closure, now); 
     303    EVENTER_CALLBACK_RETURN(job->fd_event->callback, NULL, newmask); 
    294304    if(!newmask) eventer_free(job->fd_event); 
    295305    else { 
     
    362372            (float)diff2.tv_sec + (float)diff2.tv_usec/1000000.0); 
    363373      pthread_mutex_unlock(&job->lock); 
     374      EVENTER_CALLBACK_ENTRY(job->fd_event->callback, NULL, 
     375                             job->fd_event->fd, job->fd_event->mask, 
     376                             EVENTER_ASYNCH_CLEANUP); 
    364377      job->fd_event->callback(job->fd_event, EVENTER_ASYNCH_CLEANUP, 
    365378                              job->fd_event->closure, &job->finish_time); 
     379      EVENTER_CALLBACK_RETURN(job->fd_event->callback, NULL, -1); 
    366380      eventer_jobq_enqueue(jobq->backq, job); 
    367381      continue; 
  • src/eventer/eventer_kqueue_impl.c

    rcd97caa rf760d48  
    3636#include "utils/noit_skiplist.h" 
    3737#include "utils/noit_log.h" 
     38#include "eventer/dtrace_probes.h" 
    3839 
    3940#include <errno.h> 
     
    266267  noitLT(eventer_deb, &__now, "kqueue: fire on %d/%x to %s(%p)\n", 
    267268         fd, masks[fd], cbname?cbname:"???", e->callback); 
     269  EVENTER_CALLBACK_ENTRY(e->callback, cbname, fd, e->mask, mask); 
    268270  newmask = e->callback(e, mask, e->closure, &__now); 
     271  EVENTER_CALLBACK_RETURN(e->callback, cbname, newmask); 
    269272 
    270273  if(newmask) { 
  • src/eventer/eventer_ports_impl.c

    r672bbf3 rf760d48  
    3636#include "utils/noit_skiplist.h" 
    3737#include "utils/noit_log.h" 
     38#include "eventer/dtrace_probes.h" 
    3839 
    3940#include <errno.h> 
     
    204205  noitLT(eventer_deb, &__now, "ports: fire on %d/%x to %s(%p)\n", 
    205206         fd, mask, cbname?cbname:"???", e->callback); 
     207  EVENTER_CALLBACK_ENTRY(e->callback, cbname, fd, e->mask, mask); 
    206208  newmask = e->callback(e, mask, e->closure, &__now); 
     209  EVENTER_CALLBACK_RETURN(e->callback, cbname, newmask); 
    207210 
    208211  if(newmask) {