Sfink/JS Profiling-Related APIs

Revision as of 22:15, 30 July 2010 by Sfink (talk | contribs)

I've crawled around js/src/ and attempted to summarize the various APIs used for profiling-related tasks. Some of these are straight profilers, some are general debugging hooks.

  • vtune
    • #ifdef MOZ_VTUNE
    • jsdbgapi: start/stop/pause/resume API
    • global functions for JS shell & mozJSComponentLoader (NOT xpcshell!)
  • shark
    • #ifdef MOZ_SHARK
    • jsdbgapi: start/stop/connect/disconnect API (2 unused; should be static?)
    • global functions for JS shell & mozJSComponentLoader & xpcshell
    • command-line option -k for JS shell & xpcshell
  • callgrind
    • #ifdef MOZ_CALLGRIND
    • jsdbgapi: start/stop/dump API
    • global functions for JS shell & mozJSComponentLoader & xpcshell
  • dtrace
    • #ifdef INCLUDE_MOZILLA_DTRACE
    • start/stop API unnecessary
    • jsdtracef: enter/exit/execute-enter/execute-exit/objectCreate/finalize probes
    • probes in jsgc.cpp, jsinterp.cpp, jsobjinlines.h (obj create), NOT jstracer
  • jscall (bug 507012)
    • #ifdef MOZ_TRACE_JSCALLS
    • jsapi.h, jscntxt.h: get/set callback API
    • piggybacks on dtrace probes but adds in jstracer probes
    • start/stop done in nsJSEnvironment (bug 580055), may add a js/ variant
  • debughooks (jsdv1)
    • unconditionally included
    • jsdbgapi: get/set/clear
    • specific hooks enumerated in JSDebugHooks in jsprvtd.h
    • jsprvtd.h: interrupt/newScript/destroyScript/execute/call/throw hooks + some debugger,source code,error stuff
    • hooks in jsinterp.cpp (almost everything here), jsscan.cpp (source code), jsscript.cpp (newScript,destroyScript), jstracer (callHook when synthesizing a frame)
    • usage disables trace JIT
  • jsdv2
    • sorry, I don't know where this is to look at it. I've only read the spec.