Project

General

Profile

Feature #2565 » probe_hacks.patch

hacking probes in to trunk - tenderlovemaking (Aaron Patterson), 06/30/2011 05:41 AM

View differences:

Makefile.in
@$(ECHO) preprocessing $<
$(Q) $(CPP) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -E $< > $@
probes.h:
@$(ECHO) translating probes $<
dtrace -o $@ -h -s probes.d
clean-local::
$(Q)$(RM) ext/extinit.c ext/extinit.$(OBJEXT) ext/ripper/y.output
-$(Q)$(RM) $(pkgconfig_DATA)
array.c
#include "ruby/util.h"
#include "ruby/st.h"
#include "ruby/encoding.h"
#include "probes.h"
#include "internal.h"
#ifndef ARRAY_DEBUG
......
FL_SET_EMBED((VALUE)ary);
ARY_SET_EMBED_LEN((VALUE)ary, 0);
if(RUBY_ARRAY_ALLOC_ENABLED()) {
RUBY_ARRAY_ALLOC(rb_sourcefile(), rb_sourceline());
}
return (VALUE)ary;
}
gc.c
#include "internal.h"
#include "gc.h"
#include "constant.h"
#include "probes.h"
#include <stdio.h>
#include <setjmp.h>
#include <sys/types.h>
......
}
}
if(RUBY_OBJECT_ALLOC_ENABLED()) RUBY_OBJECT_ALLOC();
obj = (VALUE)freelist;
freelist = freelist->as.free.next;
hash.c
#include "ruby/st.h"
#include "ruby/util.h"
#include "ruby/encoding.h"
#include "probes.h"
#include <errno.h>
#ifdef __APPLE__
......
OBJSETUP(hash, klass, T_HASH);
RHASH_IFNONE(hash) = Qnil;
if(RUBY_HASH_ALLOC_ENABLED()) {
RUBY_HASH_ALLOC(rb_sourcefile(), rb_sourceline());
}
return (VALUE)hash;
}
string.c
#include "ruby/re.h"
#include "ruby/encoding.h"
#include "internal.h"
#include "probes.h"
#include <assert.h>
#define BEG(no) (regs->beg[(no)])
......
str->as.heap.len = 0;
str->as.heap.aux.capa = 0;
if(RUBY_STRING_ALLOC_ENABLED()) {
RUBY_STRING_ALLOC(rb_sourcefile(), rb_sourceline());
}
return (VALUE)str;
}
vm_eval.c
**********************************************************************/
#include "probes.h"
static inline VALUE method_missing(VALUE obj, ID id, int argc, const VALUE *argv, int call_status);
static inline VALUE rb_vm_set_finish_env(rb_thread_t * th);
static inline VALUE vm_yield_with_cref(rb_thread_t *th, int argc, const VALUE *argv, const NODE *cref);
......
rb_call0(VALUE recv, ID mid, int argc, const VALUE *argv,
call_type scope, VALUE self)
{
if(RUBY_FUNCTION_ENTRY_ENABLED()) {
RUBY_FUNCTION_ENTRY(
rb_obj_classname(recv),
rb_id2name(mid),
argc,
rb_sourcefile(),
rb_sourceline());
}
rb_method_entry_t *me = rb_search_method_entry(recv, mid);
rb_thread_t *th = GET_THREAD();
int call_status = rb_method_call_status(th, me, scope, self);
(1-1/21)