pike.git / src / interpret.c

version» Context lines:

pike.git/src/interpret.c:1827:    fprintf(stderr, "- %s: %s\n", file, s);    }       if (filep) {    free_string(filep);    }    buffer_free(b);   }      ATTRIBUTE((noinline)) + static void do_dtrace_function_call(struct object *o, const struct identifier *function, INT32 args) { +  /* DTrace enter probe +  arg0: function name +  arg1: object +  */ +  struct byte_buffer obj_name = BUFFER_INIT(); +  struct svalue obj_sval; +  SET_SVAL(obj_sval, T_OBJECT, 0, object, o); +  safe_describe_svalue(&obj_name, &obj_sval, 0, NULL); +  PIKE_FN_START(function->name->size_shift == 0 ? +  function->name->str : "[widestring fn name]", +  buffer_get_string(s)); +  buffer_free(&obj_name); + } +  + ATTRIBUTE((noinline)) + static void do_dtrace_func_return(struct object *o, int fun) { +  /* 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); + } +  + ATTRIBUTE((noinline)) + static void do_dtrace_efun_call(const struct svalue *s, INT32 args) { +  /* 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]", +  ""); + } + ATTRIBUTE((noinline)) + static void do_dtrace_efun_return(const struct svalue *s, INT32 args) { +  /* DTrace leave probe +  arg0: function name +  */ +  PIKE_FN_DONE(s->u.efun->name->size_shift == 0 ? +  s->u.efun->name->str : "[widestring fn name]"); + } +  + ATTRIBUTE((noinline))   static void do_trace_function_call(const struct object *o, const struct identifier *function, INT32 args) {    struct byte_buffer buffer = BUFFER_INIT();    char buf[50];       sprintf(buf, "%lx->", (long) PTR_TO_INT (o));    buffer_add_str(&buffer, buf);    if (function->name->size_shift)    buffer_add_str (&buffer, "[widestring function name]");    else    buffer_add_str(&buffer, function->name->str);
pike.git/src/interpret.c:2160:    if(SUBTYPEOF(*s) == FUNCTION_BUILTIN)    {   #ifdef PIKE_DEBUG    struct svalue *expected_stack = Pike_sp-args;   #endif    if(Pike_interpreter.trace_level>1)    {    do_trace_efun_call(s, args);    }    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]", -  ""); +  do_dtrace_efun_call(s, args);    }    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]"); +  do_dtrace_efun_return(s, args);    }      #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.git/src/interpret.c:2324:    {    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]"; +  do_dtrace_func_return(o, fun);    } -  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"); \