summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-22 10:19:27 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-22 10:19:27 +0000
commitfc5c62bef79c1d09606ba0e012d7a66e64d14270 (patch)
treed7ecdca8c6a2f3932405b9c1426ec31cff58e799 /ext
parentde1dbf48294c9d83049e8a398375001fd512bf81 (diff)
* ext/probeprofiler/: removed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/probeprofiler/extconf.rb4
-rw-r--r--ext/probeprofiler/lib/probeprofile.rb7
-rw-r--r--ext/probeprofiler/lib/probeprofiler.rb14
-rw-r--r--ext/probeprofiler/probeprofiler.c61
4 files changed, 0 insertions, 86 deletions
diff --git a/ext/probeprofiler/extconf.rb b/ext/probeprofiler/extconf.rb
deleted file mode 100644
index da94e654d9..0000000000
--- a/ext/probeprofiler/extconf.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-require 'mkmf'
-$VPATH << "$(top_srcdir)"
-$INCFLAGS << " -I$(top_srcdir)"
-create_makefile("probeprofiler")
diff --git a/ext/probeprofiler/lib/probeprofile.rb b/ext/probeprofiler/lib/probeprofile.rb
deleted file mode 100644
index ef722b59da..0000000000
--- a/ext/probeprofiler/lib/probeprofile.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-require 'probeprofiler'
-END{
- ProbeProfiler.stop_profile
- ProbeProfiler.print_profile
-}
-
-ProbeProfiler.start_profile
diff --git a/ext/probeprofiler/lib/probeprofiler.rb b/ext/probeprofiler/lib/probeprofiler.rb
deleted file mode 100644
index a00b6df653..0000000000
--- a/ext/probeprofiler/lib/probeprofiler.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-
-require 'probeprofiler.so'
-
-def ProbeProfiler.print_profile
- data = ProbeProfiler.profile_data
- total = 0.0
- printf("%-60s %-8s %-7s\n", "ProbeProfile Result: Method signature", "count", "ratio")
- data.map{|k, n| total += n; [n, k]}.sort.reverse.each{|n, sig|
- #
- printf("%-60s %8d %7.2f%%\n", sig, n, 100 * n / total)
- }
- printf("%60s %8d\n", "total:", total)
-end
-
diff --git a/ext/probeprofiler/probeprofiler.c b/ext/probeprofiler/probeprofiler.c
deleted file mode 100644
index 473844c0a1..0000000000
--- a/ext/probeprofiler/probeprofiler.c
+++ /dev/null
@@ -1,61 +0,0 @@
-#include <ruby/ruby.h>
-#include <vm_core.h>
-
-VALUE rb_thread_current_status(rb_thread_t *);
-void rb_add_event_hook(rb_event_hook_func_t, rb_event_flag_t, VALUE);
-int rb_remove_event_hook(rb_event_hook_func_t);
-
-static void
-hash_inc(VALUE data, VALUE key)
-{
- VALUE num = INT2FIX(0);
-
- if (RTEST(num = rb_hash_aref(data, key))) {
- num = INT2FIX(FIX2INT(num) + 1);
- }
-
- rb_hash_aset(data, key, num);
-}
-
-static void
-pprof_hook(rb_event_flag_t flag, VALUE data,
- VALUE self, ID dmyid, VALUE dmyklass)
-{
- rb_thread_t *th = GET_THREAD();
- VALUE sig = rb_thread_current_status(th);
- hash_inc(data, sig);
-}
-
-static VALUE
-pprof_data(VALUE mod)
-{
- return rb_const_get_at(mod, rb_intern("#pprof_data"));
-}
-
-static VALUE
-pprof_start(VALUE self)
-{
- VALUE data = pprof_data(self);
- rb_add_event_hook(pprof_hook, RUBY_EVENT_SWITCH, data);
- return Qnil;
-}
-
-static VALUE
-pprof_stop(VALUE self)
-{
- rb_remove_event_hook(pprof_hook);
- return Qnil;
-}
-
-void
-Init_probeprofiler(void)
-{
- VALUE mPProf;
-
- mPProf = rb_define_module("ProbeProfiler");
- rb_const_set(mPProf, rb_intern("#pprof_data"), rb_hash_new());
- rb_define_module_function(mPProf, "start_profile", pprof_start, 0);
- rb_define_module_function(mPProf, "stop_profile", pprof_stop, 0);
- rb_define_module_function(mPProf, "profile_data", pprof_data, 0);
-}
-