[#27380] [Bug #2553] Fix pthreads slowness by eliminating unnecessary sigprocmask calls — Dan Peterson <redmine@...>
Bug #2553: Fix pthreads slowness by eliminating unnecessary sigprocmask calls
Issue #2553 has been updated by Andre Nathan.
2010/7/10 Andre Nathan <redmine@ruby-lang.org>:
[#27388] [Bug #2554] Net::FTP should not use MSG_OOB — Hongli Lai <redmine@...>
Bug #2554: Net::FTP should not use MSG_OOB
[#27393] Re: compressed pointers? — Roger Pack <rogerdpack2@...>
Martin wrote:
[#27420] closing of the stderr pipe not detected - issue in 1.9.1? — Robert Klemme <shortcutter@...>
Hi,
2010/1/5 Robert Klemme <shortcutter@googlemail.com>:
2010/1/5 Tanaka Akira <akr@fsij.org>:
[#27425] [Bug #2559] IO#write raises Errno::EINVAL instead of expected Errno::EPIPE — Hongli Lai <redmine@...>
Bug #2559: IO#write raises Errno::EINVAL instead of expected Errno::EPIPE
[#27429] [Bug #2560] IO.read not always closes the file — Vladimir Sizikov <redmine@...>
Bug #2560: IO.read not always closes the file
[#27437] [Feature #2561] 1.8.7 Patch reduces time cost of Rational operations by 50%. — Kurt Stephens <redmine@...>
Feature #2561: 1.8.7 Patch reduces time cost of Rational operations by 50%.
[#27447] [Bug #2564] [patch] re-initialize timer_thread_{lock,cond} after fork — Aliaksey Kandratsenka <redmine@...>
Bug #2564: [patch] re-initialize timer_thread_{lock,cond} after fork
[#27448] [Feature:trunk] adding hooks for better tracing — Yugui <yugui@...>
Hi,
[#27456] Re: better GC? — Roger Pack <rogerdpack2@...>
> Yes, but unfortunately it's not small at all. GC has a lot of
[#27504] C can't instantiate over existing classes? — Roger Pack <rogerdpack2@...>
Is this expected? [1.9.1]
[#27522] require behavior in 1.9 with respect to loading files with different extensions — Dirkjan Bussink <d.bussink@...>
Hi,
Hi,
[#27545] [Feature #2594] 1.8.7 Patch: Reduce time spent in gc.c is_pointer_to_heap(). — Kurt Stephens <redmine@...>
Feature #2594: 1.8.7 Patch: Reduce time spent in gc.c is_pointer_to_heap().
Issue #2594 has been updated by Kurt Stephens.
[#27551] [Bug #2595] Add crc32_combine and adler32_combine to zlib API — Aaron Patterson <redmine@...>
Bug #2595: Add crc32_combine and adler32_combine to zlib API
Hi Aaron,
On Tue, Jan 19, 2010 at 10:22:25AM +0900, NAKAMURA, Hiroshi wrote:
[#27625] [Bug #2616] unable to trap in doze — Roger Pack <redmine@...>
Bug #2616: unable to trap in doze
[#27635] [Bug #2619] Proposed method: Process.fork_supported? — Hongli Lai <redmine@...>
Bug #2619: Proposed method: Process.fork_supported?
Issue #2619 has been updated by Luis Lavena.
Hi,
On Thu, Jan 21, 2010 at 11:27 PM, Yukihiro Matsumoto <matz@ruby-lang.org> wrote:
Hi,
On Fri, Jan 22, 2010 at 1:25 PM, Yukihiro Matsumoto <matz@ruby-lang.org> wrote:
On Fri, Jan 22, 2010 at 9:06 PM, Charles Oliver Nutter
2010/1/21 Hongli Lai <redmine@ruby-lang.org>:
On 1/21/10 5:20 AM, Tanaka Akira wrote:
2010/1/21 Hongli Lai <hongli@plan99.net>:
On Thu, Jan 21, 2010 at 10:53 AM, Tanaka Akira <akr@fsij.org> wrote:
2010/1/22 Vladimir Sizikov <vsizikov@gmail.com>:
On Thu, Jan 21, 2010 at 9:43 PM, Tanaka Akira <akr@fsij.org> wrote:
2010/1/22 Charles Oliver Nutter <headius@headius.com>:
Hi,
On Thu, Jan 21, 2010 at 12:49 PM, Vladimir Sizikov <vsizikov@gmail.com> wrote:
On 1/21/10 8:09 PM, Charles Oliver Nutter wrote:
>> I propose a method Process.fork_supported? which returns whether fork is supported on the current platform. See attached patch.
On 1/25/10 3:46 PM, Roger Pack wrote:
[#27656] A patch to rdoc — Tetsu Soh <tetsu.soh.dev@...>
Hello everyone,
[#27670] able to re-require $0 — Roger Pack <rogerdpack2@...>
Currently with 1.9.x you cannot "re-require" a file, even if you pass
Hi,
Hi,
Hi,
[#27698] [Bug #2629] ConditionVariable#wait(mutex, timeout) should return whether the condition was signalled, not the waited time — Hongli Lai <redmine@...>
Bug #2629: ConditionVariable#wait(mutex, timeout) should return whether the condition was signalled, not the waited time
[#27701] [Feature #2631] Allow IO#reopen to take a block — Daniel Berger <redmine@...>
Feature #2631: Allow IO#reopen to take a block
[#27722] [Feature #2635] Unbundle rdoc — Yui NARUSE <redmine@...>
Feature #2635: Unbundle rdoc
Hi,
Issue #2635 has been updated by Yui NARUSE.
[#27748] [Bug #2636] Incorrect UTF-16 string length — Vincent Isambart <redmine@...>
Bug #2636: Incorrect UTF-16 string length
2010/1/24 Vincent Isambart <redmine@ruby-lang.org>:
What needs to be fixed here is the data, nothing else:
[#27753] [Bug #2637] unable to select for < 0.1s in windows — Roger Pack <redmine@...>
Bug #2637: unable to select for < 0.1s in windows
[#27757] [Bug #2638] ruby-1.9.1-p37[68] build on aix5.3 with gcc-4.2 failed to run for me because it ignores where libgcc is located. — Joel Soete <redmine@...>
Bug #2638: ruby-1.9.1-p37[68] build on aix5.3 with gcc-4.2 failed to run for me because it ignores where libgcc is located.
[#27790] [Feature #2643] test/unit redefinition check of test_* method — Yusuke Endoh <redmine@...>
Feature #2643: test/unit redefinition check of test_* method
[#27791] [Bug #2644] memory over-allocation with regexp — Greg Hazel <redmine@...>
Bug #2644: memory over-allocation with regexp
Issue #2644 has been updated by Greg Hazel.
[#27794] [Bug #2647] Lack of testing for String#split — Hugh Sasse <redmine@...>
Bug #2647: Lack of testing for String#split
[#27828] [Bug #2656] Inconsistent docs for Zlib. — Hugh Sasse <redmine@...>
Bug #2656: Inconsistent docs for Zlib. [ruby-core:27692]
[#27902] Ruby 1.8.7, rb_define_method and ArgumentError: wrong number of arguments (0 for 1) — Gerardo Santana Gez Garrido <gerardo.santana@...>
I have the following method defined in a C extension:
On 1/27/10 8:55 AM, "Gerardo Santana Gez Garrido"
On Wed, Jan 27, 2010 at 11:18 AM, Eero Saynatkari
[#27912] [Bug #2669] mkmf find_executable doesn't find .bat files — Roger Pack <redmine@...>
Bug #2669: mkmf find_executable doesn't find .bat files
Issue #2669 has been updated by Luis Lavena.
[#27930] [Bug:trunk] some behavior changes of lib/csv.rb between 1.8 and 1.9 — Yusuke ENDOH <mame@...>
Hi jeg2, or anyone who knows the implementation of FasterCSV,
On Jan 28, 2010, at 10:51 AM, Yusuke ENDOH wrote:
Hi jeg2,
On Jan 28, 2010, at 11:13 AM, James Edward Gray II wrote:
Hi,
On Jan 31, 2010, at 4:40 AM, Yusuke ENDOH wrote:
[#27961] RCR: allow {select, collect, map} to accept symbol argument — Roger Pack <rogerdpack2@...>
Background.
This reply registers the suggestion by Roger to the redmine.
[ruby-core:27448] [Feature:trunk] adding hooks for better tracing
Hi, I made a commit that embeded dtrace probes into Ruby so that you can profile a Ruby application at runtime. (r26235) Adding probes had been approved by a Ruby developer's meeting, however, the commit was little larger than what other committers expected. I got some objection for the commit. [ruby-dev:39954] In the end, I decided to temporarily revert the commit. (r26243) I discussed how we should support dynamic runtime tracing, with ko1, mame, naruse, unak and shyouhei. The problems of the commit were: * the probes duplicated with the event_hook framework (rb_add_event_hook, Kernel#set_trace_func) * Design of the probes were not verified enough. * more trial and error are necessary, to make it clear what is necessary to trace a Ruby application. I accepted ko1's suggestion: * reverting the commit * adding some hooks for rb_add_event_hook(). * implementing probes for dynamic runtime tracing on the event_hook framework. * these probes can be implemented as a gem * I will aget a chance for trial and error. * The probes possibly will be merged into Ruby itself after enough designed and getting enough use cases. Here is a patch to add the hooks I and ko1 talked about. (attached) And here is an extension library that provides prove points to dtrace, on top of the hooks. (http://github.com/yugui/vm_probes ) What do you think? Can I commit the patch I attached? Thank you, -- Yuki Sonoda (Yugui)
Attachments (1)
diff --git a/compile.c b/compile.c
index 54b513c..ea4268a 100644
--- a/compile.c
+++ b/compile.c
@@ -3569,6 +3569,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
}
ADD_INSNL(ret, nd_line(node), jump, label_miss);
ADD_LABEL(ret, label_hit);
+ ADD_TRACE(ret, nd_line(node), RUBY_EVENT_RESCUE);
COMPILE(ret, "resbody body", resq->nd_body);
if (iseq->compile_data->option->tailcall_optimization) {
ADD_INSN(ret, nd_line(node), nop);
diff --git a/gc.c b/gc.c
index 4021220..35489aa 100644
--- a/gc.c
+++ b/gc.c
@@ -1059,17 +1059,17 @@ rb_during_gc(void)
VALUE
rb_newobj(void)
{
-#if USE_VALUE_CACHE || (defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE)
rb_thread_t *th = GET_THREAD();
-#endif
-#if USE_VALUE_CACHE
- VALUE v = *th->value_cache_ptr;
-#endif
#if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE
rb_objspace_t *objspace = th->vm->objspace;
#else
rb_objspace_t *objspace = &rb_objspace;
#endif
+#if USE_VALUE_CACHE
+ VALUE v = *th->value_cache_ptr;
+#else
+ VALUE v = rb_newobj_from_heap(objspace);
+#endif
if (during_gc) {
dont_gc = 1;
@@ -1085,15 +1085,14 @@ rb_newobj(void)
else {
v = rb_fill_value_cache(th);
}
+#endif
#if defined(GC_DEBUG)
printf("cache index: %d, v: %p, th: %p\n",
th->value_cache_ptr - th->value_cache, v, th);
#endif
+ EXEC_EVENT_HOOK(th, RUBY_EVENT_OBJ_ALLOC, v, 0, 0);
return v;
-#else
- return rb_newobj_from_heap(objspace);
-#endif
}
NODE*
@@ -1973,6 +1972,8 @@ obj_free(rb_objspace_t *objspace, VALUE obj)
break;
}
+ EXEC_EVENT_HOOK(GET_THREAD(), RUBY_EVENT_OBJ_FREE, obj, 0, 0);
+
if (FL_TEST(obj, FL_EXIVAR)) {
rb_free_generic_ivar((VALUE)obj);
FL_UNSET(obj, FL_EXIVAR);
@@ -2153,6 +2154,7 @@ garbage_collect(rb_objspace_t *objspace)
during_gc++;
objspace->count++;
+ EXEC_EVENT_HOOK(th, RUBY_EVENT_GC_START, 0, 0, 0);
GC_PROF_TIMER_START;
GC_PROF_MARK_TIMER_START;
SET_STACK_END;
@@ -2201,6 +2203,7 @@ garbage_collect(rb_objspace_t *objspace)
GC_PROF_SWEEP_TIMER_STOP;
GC_PROF_TIMER_STOP;
+ EXEC_EVENT_HOOK(th, RUBY_EVENT_GC_END, 0, 0, 0);
if (GC_NOTIFY) printf("end garbage_collect()\n");
return TRUE;
}
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h
index 5318772..7b8c982 100644
--- a/include/ruby/ruby.h
+++ b/include/ruby/ruby.h
@@ -1316,19 +1316,26 @@ void ruby_sysinit(int *, char ***);
#define HAVE_NATIVETHREAD
int ruby_native_thread_p(void);
-#define RUBY_EVENT_NONE 0x0000
-#define RUBY_EVENT_LINE 0x0001
-#define RUBY_EVENT_CLASS 0x0002
-#define RUBY_EVENT_END 0x0004
-#define RUBY_EVENT_CALL 0x0008
-#define RUBY_EVENT_RETURN 0x0010
-#define RUBY_EVENT_C_CALL 0x0020
-#define RUBY_EVENT_C_RETURN 0x0040
-#define RUBY_EVENT_RAISE 0x0080
-#define RUBY_EVENT_ALL 0xffff
-#define RUBY_EVENT_VM 0x10000
-#define RUBY_EVENT_SWITCH 0x20000
-#define RUBY_EVENT_COVERAGE 0x40000
+#define RUBY_EVENT_NONE 0x0000
+#define RUBY_EVENT_LINE 0x0001
+#define RUBY_EVENT_CLASS 0x0002
+#define RUBY_EVENT_END 0x0004
+#define RUBY_EVENT_CALL 0x0008
+#define RUBY_EVENT_RETURN 0x0010
+#define RUBY_EVENT_C_CALL 0x0020
+#define RUBY_EVENT_C_RETURN 0x0040
+#define RUBY_EVENT_RAISE 0x0080
+#define RUBY_EVENT_ALL 0xffff
+#define RUBY_EVENT_VM 0x10000
+#define RUBY_EVENT_SWITCH 0x20000
+#define RUBY_EVENT_COVERAGE 0x40000
+#define RUBY_EVENT_TH_INIT 0x80000
+#define RUBY_EVENT_TH_TERM 0x100000
+#define RUBY_EVENT_RESCUE 0x200000
+#define RUBY_EVENT_OBJ_ALLOC 0x400000
+#define RUBY_EVENT_OBJ_FREE 0x800000
+#define RUBY_EVENT_GC_START 0x1000000
+#define RUBY_EVENT_GC_END 0x2000000
typedef unsigned int rb_event_flag_t;
typedef void (*rb_event_hook_func_t)(rb_event_flag_t, VALUE data, VALUE, ID, VALUE klass);
diff --git a/thread.c b/thread.c
index 0ba41c7..06a7da4 100644
--- a/thread.c
+++ b/thread.c
@@ -376,6 +376,8 @@ thread_cleanup_func(void *th_ptr)
{
rb_thread_t *th = th_ptr;
+ EXEC_EVENT_HOOK(th, RUBY_EVENT_TH_TERM, th->self, 0, 0);
+
/* unlock all locking mutexes */
if (th->keeping_mutexes) {
rb_mutex_unlock_all(th->keeping_mutexes, th);
@@ -533,6 +535,7 @@ thread_create_core(VALUE thval, VALUE args, VALUE (*fn)(ANYARGS))
native_mutex_initialize(&th->interrupt_lock);
/* kick thread */
st_insert(th->vm->living_threads, thval, (st_data_t) th->thread_id);
+ EXEC_EVENT_HOOK(GET_THREAD(), RUBY_EVENT_TH_INIT, thval, 0, 0);
err = native_thread_create(th);
if (err) {
st_delete_wrap(th->vm->living_threads, th->self);
@@ -3680,6 +3683,7 @@ thread_reset_event_flags(rb_thread_t *th)
flag |= hook->flag;
hook = hook->next;
}
+ th->event_flags = flag;
}
static void