pike.git / src / interpret.c

version» Context lines:

pike.git/src/interpret.c:46: Inside #if defined(HAVE_SYS_MMAN_H)
     #ifdef HAVE_SYS_MMAN_H   #include <sys/mman.h>   #endif      #ifdef MAP_NORESERVE   #define USE_MMAP_FOR_STACK   #endif   #endif    + #ifdef USE_DTRACE + #include "dtrace_probes.h" + #else + #include "dtrace/dtrace_probes_disabled.h" + #endif +    /*    * Define the default evaluator stack size, used for just about everything.    */   #define EVALUATOR_STACK_SIZE 100000      #define TRACE_LEN (100 + Pike_interpreter.trace_level * 10)      /* Keep some margin on the stack space checks. They're lifted when    * handle_error runs to give it some room. */   /* Observed in 7.1: 40 was enough, 30 wasn't. */
pike.git/src/interpret.c:2008:    if(Pike_interpreter.trace_level>1)    {    dynamic_buffer save_buf;    init_buf(&save_buf);    if (s->u.efun->name->size_shift)    my_strcat ("[widestring function name]");    else    my_strcat (s->u.efun->name->str);    do_trace_call(args, &save_buf);    } +  if (PIKE_FN_START_ENABLED()) { +  /* DTrace enter probe +  arg0: function name +  arg1: object +  */ +  PIKE_FN_START(s->u.efun->name->size_shift == 0 ? +  s->u.efun->name->str : "[widestring fn name]", +  ""); +  }    FAST_CHECK_THREADS_ON_CALL();    (*(s->u.efun->function))(args); -  +  if (PIKE_FN_DONE_ENABLED()) { +  /* DTrace leave probe +  arg0: function name +  */ +  PIKE_FN_DONE(s->u.efun->name->size_shift == 0 ? +  s->u.efun->name->str : "[widestring fn name]"); +  }      #ifdef PIKE_DEBUG    s->u.efun->runs++;    if(Pike_sp != expected_stack + !s->u.efun->may_return_void)    {    if(Pike_sp < expected_stack)    Pike_fatal("Function popped too many arguments: %S\n",    s->u.efun->name);    if(Pike_sp>expected_stack+1)    Pike_fatal("Function left droppings on stack: %S\n",
pike.git/src/interpret.c:2055:    break;       case T_ARRAY:    if(Pike_interpreter.trace_level)    {    dynamic_buffer save_buf;    init_buf(&save_buf);    safe_describe_svalue(s,0,0);    do_trace_call(args, &save_buf);    } +  if (PIKE_FN_START_ENABLED()) { +  /* DTrace enter probe +  arg0: function name +  arg1: object +  */ +  PIKE_FN_START("[array]", ""); +  }    apply_array(s->u.array, args, (type == APPLY_STACK));    break;       case PIKE_T_TYPE:    if (args != 1) {    /* FIXME: Casts to object ought to propagate to apply program below. */    SIMPLE_WRONG_NUM_ARGS_ERROR("cast", 1);    }    o_cast(s->u.type, compile_type_to_runtime_type(s->u.type));    break;       case T_PROGRAM:    if(Pike_interpreter.trace_level)    {    dynamic_buffer save_buf;    init_buf(&save_buf);    safe_describe_svalue(s,0,0);    do_trace_call(args, &save_buf);    } -  +  if (PIKE_FN_START_ENABLED()) { +  /* DTrace enter probe +  arg0: function name +  arg1: object +  */ +  dynamic_buffer save_buf; +  dynbuf_string prog_name; +  init_buf(&save_buf); +  safe_describe_svalue(s,0,0); +  prog_name = complex_free_buf(&save_buf); +  PIKE_FN_START("[program]", prog_name.str); +  }    push_object(clone_object(s->u.program,args));    break;       case T_OBJECT:    /* FIXME: Object subtypes! */    o=s->u.object;    if(o->prog == pike_trampoline_program)    {    fun=((struct pike_trampoline *)(o->storage))->func;    scope=((struct pike_trampoline *)(o->storage))->frame;
pike.git/src/interpret.c:2153:    if(save_sp+1 < Pike_sp)    {    assign_svalue(save_sp,Pike_sp-1);    pop_n_elems(Pike_sp-save_sp-1);    low_destruct_objects_to_destruct(); /* consider using a flag for immediate destruct instead... */       }    if(Pike_interpreter.trace_level>1)    do_trace_func_return (1, o, fun);    } +  +  if (PIKE_FN_DONE_ENABLED()) { +  /* DTrace leave probe +  arg0: function name +  */ +  char *fn = "(unknown)"; +  if (o && o->prog) { +  struct identifier *id = ID_FROM_INT(o->prog, fun); +  fn = id->name->size_shift == 0 ? id->name->str : "[widestring fn name]"; +  } +  PIKE_FN_DONE(fn); +  } +     return 0;   }            #define basic_low_return(save_sp) \    DO_IF_DEBUG( \    if(Pike_mark_sp < Pike_fp->save_mark_sp) \    Pike_fatal("Popped below save_mark_sp!\n"); \    if(Pike_sp<Pike_interpreter.evaluator_stack) \
pike.git/src/interpret.c:2183:    struct svalue *save_sp = Pike_fp->save_sp;    int trace_level = Pike_interpreter.trace_level;    struct object *o; /* Got bogus gcc warning here. */    int fun; /* Got bogus gcc warning here. */       if (trace_level > 1) {    o = Pike_fp->current_object;    fun = Pike_fp->fun;    }    +  if (PIKE_FN_DONE_ENABLED()) { +  /* DTrace leave probe +  arg0: function name +  */ +  char *fn = "(unknown)"; +  o = Pike_fp->current_object; +  fun = Pike_fp->fun; +  if (o && o->prog) { +  struct identifier *id = ID_FROM_INT(o->prog, fun); +  fn = id->name->size_shift == 0 ? id->name->str : "[widestring fn name]"; +  } +  PIKE_FN_DONE(fn); +  } +    #if defined (PIKE_USE_MACHINE_CODE) && defined (OPCODE_RETURN_JUMPADDR)    /* If the function that returns is the only ref to the current    * object and its program then the program would be freed in    * destruct_objects_to_destruct below. However, we're still    * executing in an opcode in its code so we need prog->program to    * stick around for a little while more to handle the returned    * address. We therefore add a ref to the current object so that    * it'll live through this function. */    o = Pike_fp->current_object;    add_ref (o);
pike.git/src/interpret.c:2226:      void low_return_pop(void)   {    struct svalue *save_sp = Pike_fp->save_sp;   #if defined (PIKE_USE_MACHINE_CODE) && defined (OPCODE_RETURN_JUMPADDR)    /* See note above. */    struct object *o = Pike_fp->current_object;    add_ref (o);   #endif    +  if (PIKE_FN_DONE_ENABLED()) { +  /* DTrace leave probe +  arg0: function name +  */ +  char *fn = "(unknown)"; +  struct object *o = Pike_fp->current_object; +  int fun = Pike_fp->fun; +  if (o && o->prog) { +  struct identifier *id = ID_FROM_INT(o->prog, fun); +  fn = id->name->size_shift == 0 ? id->name->str : "[widestring fn name]"; +  } +  PIKE_FN_DONE(fn); +  } +     basic_low_return (save_sp);       if(save_sp < Pike_sp)    {    pop_n_elems(Pike_sp-save_sp);    /* consider using a flag for immediate destruct instead... */    destruct_objects_to_destruct();    }      #if defined (PIKE_USE_MACHINE_CODE) && defined (OPCODE_RETURN_JUMPADDR)