Ignore:
Timestamp:
Aug 19, 2008, 3:22:02 PM (17 years ago)
Author:
[email protected]
Message:

2008-08-19 Kevin McCullough <[email protected]>

Reviewed by Tim and Mark.

Implement DTrace hooks for dashcode and instruments.

  • API/JSProfilerPrivate.cpp: Added. Expose SPI so that profiling can be turned on from a client. The DTrace probes were added within the profiler mechanism for performance reasons so the profiler must be started to enable tracing. (JSStartProfiling): (JSEndProfiling):
  • API/JSProfilerPrivate.h: Added. Ditto.
  • JavaScriptCore.exp: Exposing the start/stop methods to clients.
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • kjs/Tracing.d: Define the DTrace probes.
  • kjs/Tracing.h: Ditto.
  • profiler/ProfileGenerator.cpp: Implement the DTrace probes in the profiler. (KJS::ProfileGenerator::willExecute): (KJS::ProfileGenerator::didExecute):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/profiler/ProfileGenerator.cpp

    r35823 r35847  
    2929#include "Profile.h"
    3030#include "Profiler.h"
     31#include "Tracing.h"
    3132
    3233namespace KJS {
     
    5758void ProfileGenerator::willExecute(const CallIdentifier& callIdentifier)
    5859{
     60    if (JAVASCRIPTCORE_PROFILE_WILL_EXECUTE_ENABLED()) {
     61        CString name = callIdentifier.m_name.UTF8String();
     62        CString url = callIdentifier.m_url.UTF8String();
     63        JAVASCRIPTCORE_PROFILE_WILL_EXECUTE(m_profileGroup, const_cast<char*>(name.c_str()), const_cast<char*>(url.c_str()), callIdentifier.m_lineNumber);
     64    }
     65
    5966    if (m_stoppedProfiling) {
    6067        ++m_stoppedCallDepth;
     
    6875void ProfileGenerator::didExecute(const CallIdentifier& callIdentifier)
    6976{
     77    if (JAVASCRIPTCORE_PROFILE_DID_EXECUTE_ENABLED()) {
     78        CString name = callIdentifier.m_name.UTF8String();
     79        CString url = callIdentifier.m_url.UTF8String();
     80        JAVASCRIPTCORE_PROFILE_DID_EXECUTE(m_profileGroup, const_cast<char*>(name.c_str()), const_cast<char*>(url.c_str()), callIdentifier.m_lineNumber);
     81    }
     82
    7083    if (!m_currentNode)
    7184        return;
Note: See TracChangeset for help on using the changeset viewer.