Closed Bug 486397 Opened 17 years ago Closed 14 years ago

Stack dumps in opcode debug tracing should be optional

Categories

(Core :: JavaScript Engine, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: jimb, Unassigned)

Details

Attachments

(1 file, 2 obsolete files)

When using the shell's 'tracing' function, dumping the stack values consumed and produced by each opcode is very slow, and can make the trace output, which is often very large to begin with, unmanageable. For example, evaluating an array literal produces output quadratic in the size of the array being produced, as we dump the stack after each element is pushed. Simply showing opcodes with source locations is useful alone, so it should be possible to do so without seeing the stack analysis.
Attachment #370497 - Flags: review?(igor)
Attachment #370497 - Flags: review?(igor)
Fixed a stray "! ".
Assignee: general → jim
Attachment #370497 - Attachment is obsolete: true
Attachment #370503 - Flags: review?(igor)
Comment on attachment 370503 [details] [diff] [review] Make tracing of stack values optional. >Make tracing of stack values optional. > >Display stack values and their origins is slow, verbose, and >unnecessary for many uses of tracing. Make this optional. > >diff --git a/js/src/jscntxt.h b/js/src/jscntxt.h >--- a/js/src/jscntxt.h >+++ b/js/src/jscntxt.h >@@ -923,6 +923,8 @@ struct JSContext { > #ifdef DEBUG > void *tracefp; > JSOp tracePrevOp; >+ /* If true, also show stack values consumed/produced, with origins. */ Nit: blank line before the comments. >+ JSBool traceStack; > #endif > > /* Per-context optional error reporter. */ >diff --git a/js/src/jsinterp.cpp b/js/src/jsinterp.cpp >--- a/js/src/jsinterp.cpp >+++ b/js/src/jsinterp.cpp >@@ -2050,9 +2050,7 @@ js_TraceOpcode(JSContext *cx) >+ if (cx->traceStack) { >+ intN ndefs; >+ jsval *siter; >+ JSString *str; Could you attach diff -b patch here?
An observation about bytecode tracing: its infrastructure duplicates what we have for the interrupt handler support. So ideally we should move the tracing code to the shell or a debug-addon that can be activated in any build including using against non-debug version of SM. Should I file a bug about it?
(In reply to comment #3) > An observation about bytecode tracing: its infrastructure duplicates what we > have for the interrupt handler support. So ideally we should move the tracing > code to the shell or a debug-addon that can be activated in any build including > using against non-debug version of SM. Should I file a bug about it? I guess so. I've been using it together with TRACEMONKEY=verbose to follow control in and out of JITted code; as you can see from bug 469237 comment 10, it's nice to have the exact path laid out for you. For this, it doesn't need to be fancy; just the opcodes and some indication of source location is plenty.
No real changes; just adapted to current sources. I needed this.
Attachment #370503 - Attachment is obsolete: true
Attachment #370503 - Flags: review?(igor)
I'm not interested in refreshing this patch for the current tree.
Assignee: jimb → general
tracing has been removed.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: