Ignore:
Timestamp:
Jul 2, 2008, 9:55:22 PM (17 years ago)
Author:
[email protected]
Message:

Add the ability to trace JavaScriptCore garabge collections using dtrace.

Reviewed by Sam Weinig.

  • JavaScriptCore.xcodeproj/project.pbxproj: Generate the dtrace probe header

file when building on a new enough version of Mac OS X.

  • JavaScriptCorePrefix.h: Add our standard Mac OS X version detection macros.
  • kjs/Tracing.d: Declare three dtrace probes.
  • kjs/Tracing.h: Include the generated dtrace macros if dtrace is available,

otherwise provide versions that do nothing.

  • kjs/collector.cpp:

(KJS::Heap::collect): Fire dtrace probes when starting a collection, after the
mark phase has completed, and when the collection is complete.

  • wtf/Platform.h: Define HAVE_DTRACE when building on a new enough version of Mac OS X.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj

    r34960 r34969  
    1313                        buildPhases = (
    1414                                65FB3F6509D11E9100F49DEB /* Generate Derived Sources */,
     15                                5D35DEE10C7C140B008648B2 /* Generate DTrace header */,
    1516                        );
    1617                        name = "Derived Sources";
     
    6667                14BD5A320A3E91F600BAF59C /* JSValueRef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14BD5A2B0A3E91F600BAF59C /* JSValueRef.cpp */; };
    6768                14E0FF120DBAAED00007C0AB /* Machine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 149B15E70D81F986009CB8C7 /* Machine.cpp */; settings = {COMPILER_FLAGS = "-fno-tree-pre"; }; };
     69                5D53726F0E1C54880021E549 /* Tracing.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D53726E0E1C54880021E549 /* Tracing.h */; };
     70                5D53727E0E1C55EC0021E549 /* TracingDtrace.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D53727D0E1C55EC0021E549 /* TracingDtrace.h */; };
    6871                5D5D8AB60E0D0A7200F9C692 /* jsc in Copy Into Framework */ = {isa = PBXBuildFile; fileRef = 932F5BE10822A1C700736975 /* jsc */; };
    6972                5D5D8AD10E0D0EBE00F9C692 /* libedit.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 5D5D8AD00E0D0EBE00F9C692 /* libedit.dylib */; };
     
    488491                51F0EC0705C86C9A00E6DF1B /* libobjc.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libobjc.dylib; path = /usr/lib/libobjc.dylib; sourceTree = "<absolute>"; };
    489492                51F648D60BB4E2CA0033D760 /* RetainPtr.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RetainPtr.h; sourceTree = "<group>"; };
     493                5D53726D0E1C546B0021E549 /* Tracing.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = Tracing.d; sourceTree = "<group>"; };
     494                5D53726E0E1C54880021E549 /* Tracing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Tracing.h; sourceTree = "<group>"; };
     495                5D53727D0E1C55EC0021E549 /* TracingDtrace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TracingDtrace.h; sourceTree = "<group>"; };
    490496                5D5D8AD00E0D0EBE00F9C692 /* libedit.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libedit.dylib; path = /usr/lib/libedit.dylib; sourceTree = "<absolute>"; };
    491497                5DA479650CFBCF56009328A0 /* TCPackedCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TCPackedCache.h; sourceTree = "<group>"; };
     
    967973                                BC18C52B0E16FCD200B34460 /* RegExpObject.lut.h */,
    968974                                BC18C5250E16FCA700B34460 /* StringPrototype.lut.h */,
     975                                5D53727D0E1C55EC0021E549 /* TracingDtrace.h */,
    969976                        );
    970977                        name = "Derived Sources";
     
    11741181                                BC18C3C60E16EE3300B34460 /* StringPrototype.h */,
    11751182                                14A396A60CD2933100B5B4FF /* SymbolTable.h */,
     1183                                5D53726D0E1C546B0021E549 /* Tracing.d */,
     1184                                5D53726E0E1C54880021E549 /* Tracing.h */,
    11761185                                F692A8850255597D01FF60F7 /* ustring.cpp */,
    11771186                                F692A8860255597D01FF60F7 /* ustring.h */,
     
    14331442                                BC7F8FB90E19D1C3008632C0 /* JSNumberCell.h in Headers */,
    14341443                                95CD41B40E1BF6560085358E /* TreeProfile.h in Headers */,
     1444                                5D53726F0E1C54880021E549 /* Tracing.h in Headers */,
     1445                                5D53727E0E1C55EC0021E549 /* TracingDtrace.h in Headers */,
    14351446                        );
    14361447                        runOnlyForDeploymentPostprocessing = 0;
     
    16071618                        shellPath = /bin/sh;
    16081619                        shellScript = "# Touch Info.plist to let Xcode know it needs to copy it into the built product\ntouch \"$SRCROOT/Info.plist\"\n";
     1620                };
     1621                5D35DEE10C7C140B008648B2 /* Generate DTrace header */ = {
     1622                        isa = PBXShellScriptBuildPhase;
     1623                        buildActionMask = 2147483647;
     1624                        files = (
     1625                        );
     1626                        inputPaths = (
     1627                                "$(SRCROOT)/kjs/Tracing.d",
     1628                        );
     1629                        name = "Generate DTrace header";
     1630                        outputPaths = (
     1631                                "$(BUILT_PRODUCTS_DIR)/DerivedSources/JavaScriptCore/Tracing.h",
     1632                        );
     1633                        runOnlyForDeploymentPostprocessing = 0;
     1634                        shellPath = /bin/sh;
     1635                        shellScript = "TRACING_D=\"$SRCROOT/kjs/Tracing.d\";\nTRACING_H=\"$BUILT_PRODUCTS_DIR/DerivedSources/JavaScriptCore/TracingDtrace.h\";\n\nif [[ \"$MACOSX_DEPLOYMENT_TARGET\" > \"10.5\" ]];\nthen\n\tdtrace -h -o \"$TRACING_H\" -s \"$TRACING_D\";\nfi;\n";
    16091636                };
    16101637                5D5D8ABF0E0D0B0300F9C692 /* Fix Framework Reference */ = {
Note: See TracChangeset for help on using the changeset viewer.