1 / 9

TPTP 4.4 Thread Profiler Pause/Resume and Attach/Detach Design

TPTP 4.4 Thread Profiler Pause/Resume and Attach/Detach Design. Asaf Yaffe Software and Solutions Group Intel Corporation. Agenda. Requirements Martini Runtime Enhancements Thread Profiler Design Changes. Requirements.

cardea
Télécharger la présentation

TPTP 4.4 Thread Profiler Pause/Resume and Attach/Detach Design

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. TPTP 4.4 Thread Profiler Pause/Resume and Attach/Detach Design Asaf Yaffe Software and Solutions Group Intel Corporation

  2. Agenda • Requirements • Martini Runtime Enhancements • Thread Profiler Design Changes

  3. Requirements • Support pause/resume and attach/detach commands available in the Profiling Monitor view of the Eclipse Client • Attach • Create a new profiling session • Update all views to reflect up-to-date thread information • Thread “start time” is the attach time • Current state, current stack, wait information (for waiting threads), etc… • Detach • Terminate the profiling session • Do not terminate the profiled application • Pause/resume • During pause – profiler does not transmit data to the client • On Resume – all views are updated to reflect up-to-date thread information

  4. Martini Runtime Enhancements • New data items in GetThreadInfo • DR_THREAD_STATE: Returns one of the following thread states: Unstarted, Running, Sleeping, Blocked (on monitor lock), Waiting (Object.wait), Terminated • DR_CURRENT_MONITOR: Returns the id of the object (if any) whose monitor the thread is waiting for • New API – GetAllThreadsInfo • Similar to GetThreadInfo, but returns the information for all live threads instead of a specific thread • Supports the following data items for each thread: • Thread id • Thread name (optional) • Thread group (optional) • Thread parent group (optional) • Current stack trace (optional) • Thread state (optional)

  5. Thread Profiler Design Changes

  6. Thread Profiler Initialization (MPICL_Instantiate) • Register for all the necessary events (thread start, thread end, all monitor events) • If started in “enabled” (detached) mode • Disable the EG_MONITOR event group • Ignore all incoming THREAD_START and THREAD_END events until an “attach” command is received

  7. Processing the “attach” Command • Call GetAllThreadsInfo to obtain a list of all living threads • For each thread in state other than Unstarted: • Write a <threadStart> element to the data channel • Do the following based on the thread’s state: • Enable the EG_MONITOR event group and resume the processing of THREAD_START and THREAD_END events

  8. Processing the “detach” Command • Disable the EG_MONITOR event group • Ignore all incoming THREAD_START and THREAD_END events until an “attach” command is received

  9. Processing the “pause” and “resume” Commands • When “pause” command is received • Stop writing data to the data channel • Keep processing events, and remember the last event received for each thread • When “resume” command is received • Write the element corresponding to the last event received for each thread. Update the timestamp of the event to the time of the “resume” • Resume writing to the data channel

More Related