1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/tool
ko1 96990203b7 Support targetting TracePoint [Feature #15289]
* vm_trace.c (rb_tracepoint_enable_for_target): support targetting
  TracePoint. [Feature #15289]

  Tragetting TracePoint is only enabled on specified method, proc
  and so on, example: `tp.enable(target: code)`.

  `code` should be consisted of InstructionSeuqnece (iseq)
  (RubyVM::InstructionSeuqnece.of(code) should not return nil)
  If code is a tree of iseq, TracePoint is enabled on all of
  iseqs in a tree.

  Enabled tragetting TracePoints can not enabled again with
  and without target.

* vm_core.h (rb_iseq_t): introduce `rb_iseq_t::local_hooks`
  to store local hooks.
  `rb_iseq_t::aux::trace_events` is renamed to
  `global_trace_events` to contrast with `local_hooks`.

* vm_core.h (rb_hook_list_t): add `rb_hook_list_t::running`
  to represent how many Threads/Fibers are used this list.
  If this field is 0, nobody using this hooks and we can
  delete it.

  This is why we can remove code from cont.c.

* vm_core.h (rb_vm_t): because of above change, we can eliminate
  `rb_vm_t::trace_running` field.
  Also renamed from `rb_vm_t::event_hooks` to `global_hooks`.

* vm_core.h, vm.c (ruby_vm_event_enabled_global_flags): renamed
  from `ruby_vm_event_enabled_flags.

* vm_core.h, vm.c (ruby_vm_event_local_num): added to count
  enabled targetting TracePoints.

* vm_core.h, vm_trace.c (rb_exec_event_hooks): accepts
  hook list.

* vm_core.h (rb_vm_global_hooks): added for convinience.

* method.h (rb_method_bmethod_t): added to maintain Proc
  and `rb_hook_list_t` for bmethod (defined by define_method).

* prelude.rb (TracePoint#enable): extracet a keyword parameter
  (because it is easy than writing in C).
  It calls `TracePoint#__enable` internal method written in C.

* vm_insnhelper.c (vm_trace): check also iseq->local_hooks.

* vm.c (invoke_bmethod): check def->body.bmethod.hooks.

* vm.c (hook_before_rewind): check iseq->local_hooks
  and def->body.bmethod.hooks before rewind by exception.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66003 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-26 18:16:39 +00:00
..
m4 _colorize_result_prepare.m4: do not save CONFIGURE_TTY 2018-11-19 07:00:12 +00:00
ruby_vm Support targetting TracePoint [Feature #15289] 2018-11-26 18:16:39 +00:00
test
asm_parse.rb
bisect.sh tool/bisect.sh: extracted build part [ci skip] 2018-03-01 03:26:05 +00:00
build-transcode
change_maker.rb
checksum.rb tool: fixed shadowing variables 2018-05-18 00:40:06 +00:00
colorize.rb
darwin-cc darwin-cc: hide ld warnings 2018-09-21 07:19:13 +00:00
downloader.rb tool/downloader.rb: retry Net::ReadTimeout 2018-10-16 09:29:23 +00:00
enc-emoji-citrus-gen.rb tool: removed unused variables 2018-05-18 00:38:00 +00:00
enc-emoji4unicode.rb
enc-unicode.rb Make some internal functions static 2018-11-16 06:52:00 +00:00
eval.rb tool: removed unused variables 2018-05-18 00:38:00 +00:00
expand-config.rb tool: removed unused variables 2018-05-18 00:38:00 +00:00
extlibs.rb Revert "Use &. instead of modifier if" 2018-06-09 16:05:38 +00:00
fake.rb Add RbConfig.fire_update! 2018-11-14 04:42:14 +00:00
fetch-bundled_gems.rb
file2lastrev.rb
gem-unpack.rb
gen_dummy_probes.rb
gen_ruby_tapset.rb tool: removed unused variables 2018-05-18 00:38:00 +00:00
generate-backport-changelog.rb
generic_erb.rb generic_erb.rb: get rid of fileutils 2018-05-15 07:46:55 +00:00
git-refresh tool/git-refresh: skip git fetch and checkout 2018-07-08 05:52:12 +00:00
gperf.sed
id2token.rb
ifchange
insns2vm.rb
install-sh
jisx0208.rb
make-snapshot make-snapshot: package with TarHeader 2018-10-18 06:36:30 +00:00
make_hgraph.rb
mdoc2man.rb
merger.rb remove message already unnecesary 2018-10-18 00:54:32 +00:00
mjit_archflag.sh mjit_archflag.sh: fix bare word in the header 2018-11-22 06:09:07 +00:00
mk_call_iseq_optimized.rb _mjit_compile_send.erb: refactor code to setup iseq 2018-09-24 06:09:55 +00:00
mkconfig.rb Add RbConfig.fire_update! 2018-11-14 04:42:14 +00:00
mkrunnable.rb tool: removed unused variables 2018-05-18 00:38:00 +00:00
node_name.rb tool/node_name.rb: rewrote without flip-flop 2018-09-07 13:43:01 +00:00
parse.rb
prereq.status
probes_to_wiki.rb
rbinstall.rb Use stub executables generated by RubyGems istead of original executables. 2018-11-25 01:20:00 +00:00
rbuninstall.rb
redmine-backporter.rb get rid of an encode noncompatible error 2018-08-13 12:42:55 +00:00
release.sh
rmdirs
run-gcov.rb
run-lcov.rb
runruby.rb Add lldb as a debugger option 2018-07-09 17:49:21 +00:00
strip-rdoc.rb
sync_default_gems.rb Sync the executables of rdoc from upstream repository. 2018-11-26 12:23:45 +00:00
test-coverage.rb make test-all COVERAGE=true supports directory-separated build 2018-04-05 01:05:16 +00:00
transcode-tblgen.rb tool: fixed shadowing variables 2018-05-18 00:40:06 +00:00
transform_mjit_header.rb Fix a typo [ci skip] 2018-11-05 06:02:42 +00:00
update-deps update-deps: fix runtime error [ci skip] 2018-11-18 23:29:40 +00:00
vcs.rb ChangeLog compatibility [ci skip] 2018-11-25 08:32:52 +00:00
vpath.rb
vtlh.rb
ytab.sed Fix for bison 3.2 [Bug #15284] 2018-11-11 12:40:40 +00:00