V8 already has a --trace flag that does precisely this. On Wed, Aug 7, 2019 at 4:06 PM Cong Zuo <zckevi...@gmail.com> wrote:
> Hey guys, I want to trace JavaScript function enter and exit events to > generate function calling graphs just like DTrace/SystemTap could do. > > e.g. > > 0 <- rl_getc > 0 <- rl_read_key > 0 -> _rl_dispatch > 0 -> _rl_dispatch_subseq > 0 -> rl_insert > 0 -> _rl_insert_char > 0 -> _rl_any_typein > 0 <- _rl_any_typein > 0 -> rl_insert_text > 0 <- rl_insert_text > 0 <- _rl_insert_char > 0 <- rl_insert > 0 <- _rl_dispatch_subseq > 0 <- _rl_dispatch > 0 -> rl_redisplay > 0 -> _rl_move_cursor_relative > 0 <- _rl_move_cursor_relative > 0 -> _rl_output_some_chars > 0 <- _rl_output_some_chars > 0 <- rl_redisplay > 0 <- readline_internal_char > 0 -> readline_internal_char > 0 -> _rl_init_argument > 0 <- _rl_init_argument > 0 -> rl_read_key > 0 -> _rl_next_macro_key > 0 <- _rl_next_macro_key > 0 -> rl_getc > > > And I found that it's kind of easy to probe function enter, but I couldn't > find a place appropriate place to probe function exit. > What I'm considering are: 1) frame destructor; 2) `Return` ignition > handler. > > Any advises would be appreciated! Thanks! > > -- > -- > v8-users mailing list > v8-users@googlegroups.com > http://groups.google.com/group/v8-users > --- > You received this message because you are subscribed to the Google Groups > "v8-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to v8-users+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/v8-users/8bfae5a7-1f80-49dc-82e9-13d41b838473%40googlegroups.com > <https://groups.google.com/d/msgid/v8-users/8bfae5a7-1f80-49dc-82e9-13d41b838473%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- -- v8-users mailing list v8-users@googlegroups.com http://groups.google.com/group/v8-users --- You received this message because you are subscribed to the Google Groups "v8-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to v8-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/v8-users/CAKSzg3RvQAFK%2ByO0HwE4en%3Dbr0or4TKKunJRNdBAmB%2Bj%3DV0GLA%40mail.gmail.com.