From: SASADA Koichi Date: 2012-07-29T12:02:44+09:00 Subject: [ruby-core:46849] Re: [ruby-trunk - Feature #2565] adding hooks for better tracing Sorry for late response. (2012/07/19 3:52), tenderlovemaking (Aaron Patterson) wrote: > https://bugs.ruby-lang.org/projects/ruby/wiki/DTraceProbes my comments: > ruby:::function-entry(classname, methodname, filename, lineno); > ruby:::function-return(classname, methodname, filename, lineno); set_trace_func spearates "call" and "c-call" (and return). No need to separate on dtrace? > ruby:::require-entry(requiredfile, filename, lineno); > ruby:::require-return(filename); > ruby:::load-entry(loadedfile, filename, lineno); > ruby:::load-return(filename); Do we need `require' and `load' both needed? (It depends on usecase) What happen on exception? (There is a same question on `function-entry') > ruby:::object-create-start(classname, filename, lineno); > ruby:::object-create-done(classname, filename, lineno); (1) How to detect object creation and finish of creation? (2) I can't accept your patch on insns.def on string and array. IIRC, you suggest that String creation trace and Array creation trace and so on. I write examples: ruby:::string-create(filename, lineno, size) ruby:::array-create(filename, lineno, size) ruby:::hash-create(filename, lineno, size) ruby:::object-create(filename, lineno, classname) size is string or array size. classname is a classname of object. I'm not sure we need string-modified (size) are needed. ruby:::object-collected(object_id) will be help. To use it correctly, object-create needs to pass object_id. But it will be complicated. > ruby:::gc-begin(); > ruby:::gc-end(); How to define GC begin and end? > ruby:::gc-sweep-begin(); > ruby:::gc-sweep-end(); How to define GC sweep begin and end? > ruby:::line(filename, lineno); Your patch depends on the `trace' instruction. I plan to remove `trace' instruction on default (if I can implement it). It will conflicts with your proposed patch. Or I shouldn't make such optimizations? -- // SASADA Koichi at atdot dot net