Closed Bug 666091 Opened 13 years ago Closed 13 years ago

custom file for GCTIMER output

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: igor, Assigned: igor)

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 file, 1 obsolete file)

Currently MOZ_GCTIMER always writes the stats into the gcTimer.dat file in the current directory. It would be nice to be to control this via a environment variable. This way it would be harder to accidentally overwrite the collected stats.
Attached patch v1 (obsolete) — Splinter Review
With the patch the MOZ_GCTIMER controls the output file. I also removed JS_WANT_GC_SUITE_PRINT support as a similar effect can be archived by setting MOZ_GCTIMER to /proc/self/fd/1 . I have also added a special value "none" to disable the stat collection for convince.
Attachment #540940 - Flags: review?(anygregor)
Comment on attachment 540940 [details] [diff] [review]
v1

>
>
>diff --git a/js/src/jsgcstats.cpp b/js/src/jsgcstats.cpp
>--- a/js/src/jsgcstats.cpp
>+++ b/js/src/jsgcstats.cpp
> #if defined(MOZ_GCTIMER)
>-        if (JS_WANT_GC_SUITE_PRINT) {
>-            fprintf(stderr, "%f %f %f\n",
>-                    TIMEDIFF(enter, end),
>-                    TIMEDIFF(startMark, startSweep),
>-                    TIMEDIFF(startSweep, sweepDestroyEnd));
>-        } else {
>-            static FILE *gcFile;

I am still using JS_WANT_GC_SUITE_PRINT for js/src/metrics/gc/gc-test.py.
There it expects the output in stderr.
Attached patch v2Splinter Review
The new version interprets stderr/stdout values in MOZ_GCTIMER environment variable as an instruction to print data in the short format. gc-test.py sets the variable accordingly eliminating the need in JS_WANT_GC_SUITE_PRINT.
Attachment #540940 - Attachment is obsolete: true
Attachment #540993 - Flags: review?(anygregor)
Attachment #540940 - Flags: review?(anygregor)
Comment on attachment 540993 [details] [diff] [review]
v2

Thanks!
I was also thinking of making a runtime switch for optimize builds so that you don't have to add it during compilation. Everybody could enable it if wanted.
Attachment #540993 - Flags: review?(anygregor) → review+
(In reply to comment #4)
> I was also thinking of making a runtime switch for optimize builds so that
> you don't have to add it during compilation. Everybody could enable it if
> wanted.

This would be great. All the preprocessor verbiage for GCTIMER and JSGC_TESTPILOT is getting a little heavy. It would be nice if it were always enabled.
http://hg.mozilla.org/tracemonkey/rev/6933048a247c
Whiteboard: fixed-in-tracemonkey
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: