Re: Profiler in Callgrind format
James Ross <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.jsdebugger |
|---|---|
| Message-ID | <[email protected]> |
[email protected] wrote: > On Dec 15, 6:46 pm, James Ross <[email protected]> wrote: >> [email protected] wrote: >> What do you mean "pre-processed"? Are you referring to the access to >> profiling data? The debugger service is quite sufficient to single-step >> through all the code, although it might be a big performance hit (hardly >> surprising). You'd have to do all the work tracking profile data. > Sorry, I meant summarized times, the kind of information that > jsdIScript gives (callCount, max, min, total). > The callgrind format needs raw data (a lot of data). Let us suppose > that it's possible to observe the SpiderMonkey in every call, so the > caller/callee/time can be stored in memory during the execution. When > the profiling ends, that information can be translated to the callgrind > format. In my limited view, it doesn't seems very difficult! (too much > php here). Just so we don't all confuse each other too much, the stack for debugging in Venkman goes something like this: - Venkman UI (XUL, JS, etc.) - JSD XPC layer (jsd_xpc.cpp) - essentially just wraps JSD for JS users - JSD core (jsd_*.c) - the real works - SpiderMonkey SpiderMonkey calls into JSD for every function call (if JSD asks it to), which ends up (eventually) in this function: http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/js/jsd/jsd_step.c&rev=3.16#111 That is where the profile data is collected. If I understand you right, you just want all the data that code collects to be kept, rather than collated into min/max/ave data. That code does include calls up through the XPC layer and into Venkman (or whatever front-end is attached to JSD at the time), so I would surmise that the basis of what you want is doable even from the JS level, but I'm not sure what the best way to get the times out without doing your own... > On Dec 17, 3:54 am, "timeless" <[email protected]> wrote: >> As for your core problem, well, writing something that single steps >> using jsdI shouldn't be impossible, although I'd expect it not to be >> much fun, and I'd recommend you configure it to ignore scripts it isn't >> supposed to profile so that your system has some chance of running. > Is there any way in JSD to focus only some scripts? I mean: only track > information about the scripts in current window content. Viewing > firebug 1.0 beta, I understand that the profiler tracks all open > scripts, in the visualization all the <script> tags are searched and > they src are compared with the fileName that jsdIScript gives. How > Venkman/JSD do that? Can I give it a window content to watch? Venkman can tell you what scripts are in a window, and there are some known bits of JS (that I want to add) that'll let it go from script back to the window it is in. In terms of profiling, though, JSD works on a global toggle and a per-script one - I believe you could tell JSD not to profile anything, then flag the scripts you care about. There's also a filter you can set, but I don't believe Venkman uses this, and I don't know how to use it either. -- James Ross <[email protected]> ChatZilla Developer