When I say CPU profiler I mean the programmatic API. I'm familiar with most of the tools currently available for generating flame graphs and have even written one myself based on ptrace for linux, but nothing is really good enough. I am looking for something that can be switched on and off on a production system without needing to start the process with special flags.
The cpu profiler supplied by v8-profiler.h generates a cpu profile artifact. To generate the cpu statistics v8 backtraces on an interval and then generate statistics from the backtraces. I would like access to the raw data that's driving the cpu profiler. The raw set of backtraces with resolved js symbols is enough to generate a flame graph and do other interesting things. The other symbols for the native code can be resolved in the standard way after the profile is generated. On Monday, 4 January 2016 01:28:53 UTC-8, Ben Noordhuis wrote: > > On Mon, Jan 4, 2016 at 6:16 AM, Matt Esch <[email protected] > <javascript:>> wrote: > > Hi, > > > > I'm trying to implement flame graph support using v8's cpu profiler. The > > flame graph tool needs to do a full backtrace including non-js frames > and > > provide the symbols for the frames generated by v8. > > > > I've been taking a look into how the cpu profiler works. Essentially it > > comprises of a cross-platform ticker/stack walker and a cpu profile > > generator. For my needs the aggregated data in the cpu profile doesn't > have > > enough information (or I misunderstand what is logged here). I know that > v8 > > is taking backtraces. We don't get backtraces for every sample, for > example, > > if there is currently no js entry frame or if we are currently in GC, > but > > for the most part v8 is actually collecting full backtraces on an > interval. > > > > What I am looking to do is to manually handle the cpu-profiler samples > so I > > can build a flame graph. I just want each raw backtrace with the C++ and > js > > frames left in tact. Ideally I want to see the v8 GC frames too but I'd > like > > to start with being able to dump each raw stack frame with annotations > for > > the javascript frames. > > > > For any of you who might have some experience with the profiler, do you > > have any recommendations for how to go about doing this? > > > > ~Matt > > When you say "the CPU profiler" do you mean the --prof command line > switch or the programmatic API from include/v8-profiler.h? > > Tools to post-process the output of the former into flame graphs > exist; e.g. `--prof --track_gc_object_stats --trace_gc_verbose > --log_timer_events` produces output suitable for Chromium's > chrome://tracing tool. > -- -- v8-users mailing list [email protected] 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
