[#90399] [Ruby trunk Feature#14813] [PATCH] gc.c: make gc_enter+gc_exit pairs dtrace probes, too — ko1@...
Issue #14813 has been updated by ko1 (Koichi Sasada).
3 messages
2018/12/10
[#90417] [Ruby trunk Bug#15398] TestThread#test_signal_at_join fails on FreeBSD — naruse@...
Issue #15398 has been reported by naruse (Yui NARUSE).
4 messages
2018/12/11
[#90423] Re: [Ruby trunk Bug#15398] TestThread#test_signal_at_join fails on FreeBSD
— Eric Wong <normalperson@...>
2018/12/11
[email protected] wrote:
[#90519] Spoofing warnings for mail from bugs.ruby-lang.org — Charles Oliver Nutter <headius@...>
I'm getting a spoofing warning for emails sent from bugs.ruby-lang.org when
4 messages
2018/12/13
[#90522] Re: Spoofing warnings for mail from bugs.ruby-lang.org
— Eric Wong <normalperson@...>
2018/12/13
Charles Oliver Nutter <[email protected]> wrote:
[#90533] [Ruby trunk Feature#15413] unmarkable C stack (3rd stack) — normalperson@...
Issue #15413 has been reported by normalperson (Eric Wong).
3 messages
2018/12/14
[#90581] [Ruby trunk Bug#15424] Ruby 2.6.0rc1 & 2.6.0rc2 mutex exception — mat999@...
Issue #15424 has been reported by splitice (Mathew Heard).
3 messages
2018/12/17
[#90595] [Ruby trunk Bug#15430] test_fork_while_parent_locked is failing status on Ruby CI — hsbt@...
Issue #15430 has been reported by hsbt (Hiroshi SHIBATA).
3 messages
2018/12/18
[#90614] [Ruby trunk Bug#15430][Assigned] test_fork_while_parent_locked is failing status on Ruby CI — hsbt@...
Issue #15430 has been updated by hsbt (Hiroshi SHIBATA).
4 messages
2018/12/19
[#90630] Re: [Ruby trunk Bug#15430][Assigned] test_fork_while_parent_locked is failing status on Ruby CI
— Eric Wong <normalperson@...>
2018/12/20
> It still exists. https://rubyci.org/logs/rubyci.s3.amazonaws.com/centos7/ruby-trunk/log/20181218T230003Z.fail.html.gz
[#90820] Re: [ruby-cvs:73697] k0kubun:r66593 (trunk): accept_nonblock_spec.rb: skip spurious failure — Eric Wong <normalperson@...>
[email protected] wrote:
3 messages
2018/12/30
[ruby-core:90750] [Ruby trunk Feature#15473] TracePoint#enable(target_thread:) to specify a Thread
From:
ko1@...
Date:
2018-12-27 20:15:04 UTC
List:
ruby-core #90750
Issue #15473 has been reported by ko1 (Koichi Sasada).
----------------------------------------
Feature #15473: TracePoint#enable(target_thread:) to specify a Thread
https://bugs.ruby-lang.org/issues/15473
* Author: ko1 (Koichi Sasada)
* Status: Open
* Priority: Normal
* Assignee: ko1 (Koichi Sasada)
* Target version:
----------------------------------------
We introduced `TracePoint#enable(target:, target_line:)` keyword.
How about to introduce `target_thread:` keyword which specify enabling threads?
```ruby
TracePoint.new(:line){|tp| p tp}.enable(target_thread: Thread.current) do
p 1
Thread.new{
p 10
p 12
}.join
p 2
end
```
```
#<TracePoint:line@/home/ko1/src/ruby/trunk/test.rb:3>
1
#<TracePoint:line@/home/ko1/src/ruby/trunk/test.rb:4>
10
12
#<TracePoint:line@/home/ko1/src/ruby/trunk/test.rb:8>
2
```
Maybe `Thread.current` is frequent pattern, so accepting :current` symbol is reasonable for me.
```
TracePoint.new(:line){|tp| p tp}.enable(target_thread: :current) do
p 1
Thread.new{
p 10
p 12
}.join
p 2
end
# same result
```
This is a patch.
```diff
Index: prelude.rb
===================================================================
--- prelude.rb (revision 66594)
+++ prelude.rb (working copy)
@@ -133,8 +133,8 @@ class IO
end
class TracePoint
- def enable target: nil, target_line: nil, &blk
- self.__enable target, target_line, &blk
+ def enable target: nil, target_line: nil, target_thread: nil, &blk
+ self.__enable target, target_line, target_thread, &blk
end
end
Index: vm_trace.c
===================================================================
--- vm_trace.c (revision 66594)
+++ vm_trace.c (working copy)
@@ -1398,11 +1398,26 @@ rb_hook_list_remove_tracepoint(rb_hook_l
*
*/
static VALUE
-tracepoint_enable_m(VALUE tpval, VALUE target, VALUE target_line)
+tracepoint_enable_m(VALUE tpval, VALUE target, VALUE target_line, VALUE target_thread)
{
rb_tp_t *tp = tpptr(tpval);
int previous_tracing = tp->tracing;
+ if (RTEST(target_thread)) {
+ static VALUE sym_current = 0;
+ if (sym_current == 0) sym_current = rb_id2sym(rb_intern("current"));
+
+ if (target_thread == sym_current) {
+ tp->target_th = GET_THREAD();
+ }
+ else {
+ tp->target_th = rb_thread_ptr(target_thread);
+ }
+ }
+ else {
+ tp->target_th = NULL;
+ }
+
if (NIL_P(target)) {
if (!NIL_P(target_line)) {
rb_raise(rb_eArgError, "only target_line is specified");
@@ -1801,7 +1816,7 @@ Init_vm_trace(void)
*/
rb_define_singleton_method(rb_cTracePoint, "trace", tracepoint_trace_s, -1);
- rb_define_method(rb_cTracePoint, "__enable", tracepoint_enable_m, 2);
+ rb_define_method(rb_cTracePoint, "__enable", tracepoint_enable_m, 3);
rb_define_method(rb_cTracePoint, "disable", tracepoint_disable_m, 0);
rb_define_method(rb_cTracePoint, "enabled?", rb_tracepoint_enabled_p, 0);
```
This is a similar feature proposed at https://bugs.ruby-lang.org/issues/13483 but no compatibility issue.
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>