IP Library › Granted Patent US 8,286,139
Granted Patent B2
US 8,286,139 · App. 12/051,265 · Granted Oct 9, 2012

Call stack sampling for threads having latencies exceeding a threshold

Assignee: International Businesss Machines Corporation
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 8,286,139
App. No.
12/051,265
Granted
Oct 9, 2012
Kind
B2
Abstract

A computer implemented method, apparatus, and computer usable program code for sampling call stack information. An accumulated latency time is monitored for a set of threads executing in a data processing system. The call stack information is obtained for the thread in response to a thread in the set of threads having an associated accumulated latency exceeding a threshold.

Claims (42)

1. A computer implemented method of sampling call stack information, the computer implemented method comprising:

monitoring an accumulated latency time for each thread in a set of threads while executing in a data processing system;

responsive to a thread in the set of threads having an associated accumulated latency exceeding a threshold, obtaining the call stack information for the thread, wherein the call stack information includes for each thread elapsed time, execution time, and previous latency; and

constructing a call tree from the call stack information by monitoring method and function entries and exits, wherein the call tree includes nodes comprising call stack information and latency information associated with a particular thread for a method or a function.

2. The computer implemented method of claim 1 , wherein the obtaining step comprises:

responsive to the thread in the set of threads having the associated accumulated latency exceeding the threshold, sending a signal to a profiler to initiate sampling of the call stack information.

3. The computer implemented method of claim 1 , wherein the obtaining step further comprises:

waking a sampling thread, of a profiler, to obtain sample call stack information.

4. The computer implemented method of claim 1 , wherein the threshold is selected from one of a value and a ratio of a value.

5. The computer implemented method of claim 1 , wherein the threshold is based on a current operating environment and changes as the current operating environment changes.

6. The computer implemented method of claim 1 , wherein the monitoring step comprises:

responsive to an interrupt, identifying a current accumulated latency for each thread in the set of threads; and

comparing the accumulated latency for the each thread in the set of threads to the threshold.

7. The computer implemented method of claim 1 , wherein the monitoring step is performed by a device driver.

8. The computer implemented method of claim 1 , wherein the call stack information is obtained using a virtual machine interface to collect the call stack information.

9. A data processing system comprising:

a bus;

a communications unit connected to the bus;

a storage device connected to the bus, wherein the storage device includes program code; and

a processor unit connected to the bus, wherein the processor unit executes the program code to monitor an accumulated latency time for each thread in a set of threads while executing in a data processing system; obtain call stack information for the thread in response to a thread in the set of threads having an associated accumulated latency exceeding a threshold, wherein the call stack information includes for each thread elapsed time, execution time, and previous latency; and construct a call tree from the call stack information by monitoring method and function entries and exits, wherein the call tree includes nodes comprising call stack information and latency information associated with a particular thread for a method or a function.

10. The data processing system of claim 9 , wherein in executing the program code to obtain the call stack information for the thread in response to the thread in the set of threads having the associated accumulated latency exceeding the threshold, the processor executes the program code to send a signal to a profiler to initiate sampling of the call stack information in response to the thread in the set of threads having the associated accumulated latency exceeding the threshold.

11. The data processing system of claim 9 , wherein in executing the program code to obtain the call stack information for the thread in response to the thread in the set of threads having the associated accumulated latency exceeding the threshold, the processor unit further executes the program code to wake a sampling thread, by a profiler, to obtain sample call stack information.

12. The data processing system of claim 9 , wherein the threshold is selected from one of a value and a ratio of values.

13. The data processing system of claim 9 , wherein the threshold is based on a current operating environment and changes as the current operating environment changes.

14. The data processing system of claim 9 , wherein in executing the program code to monitor the accumulated latency time for the set of threads executing in the data processing system, the processor executes the program code to identify a current accumulated latency for each thread in the set of threads in response to an interrupt; and compare the total latency for the each thread in the set of threads to the threshold.

15. The data processing system of claim 9 , wherein the call stack information is obtained using a virtual machine interface to collect the call stack information.

16. A computer program product for sampling call stack information, the computer program product comprising:

a computer recordable storage media;

program code, stored on the computer recordable media, for monitoring an accumulated latency time for each thread in a set of threads while executing in a data processing system; and

program code, stored on the computer recordable media, responsive to a thread in the set of threads having an associated accumulated latency exceeding a threshold, for obtaining the call stack information for the thread wherein the call stack information includes for each thread elapsed time, execution time, and previous latency; and

program code, stored on the computer recordable media, for constructing a call tree from the call stack information by monitoring method and function entries and exits, wherein the call tree includes nodes comprising call stack information and latency information associated with a particular thread for a method or function.

17. The computer program product of claim 16 , wherein the program code, stored on the computer recordable media, responsive to the thread in the set of threads having the associated accumulated latency exceeding the threshold, for obtaining the call stack information for the thread comprises:

program code, stored on the computer recordable media, responsive to the thread in the set of threads having the associated accumulated latency exceeding the threshold, for sending a signal to a profiler to initiate sampling of the call stack information.

18. The computer program product of claim 16 , wherein the program code, stored on the computer recordable media, responsive to the thread in the set of threads having the associated accumulated latency exceeding the threshold, for obtaining the call stack information for the thread further comprises:

program code, stored on the computer readable media, for waking a sampling thread, by the profiler, to obtain sample call stack information.

19. The computer program product of claim 16 , wherein the threshold is selected from one of a value and a ratio of values.

20. The computer program product of claim 16 , wherein the threshold is based on a current operating environment and changes as the current operating environment changes.

21. The computer program product of claim 16 , wherein the program code, stored on the computer recordable media, for monitoring the accumulated latency time for the set of threads executing in the data processing system comprises:

program code, stored on the computer recordable media, responsive to an interrupt, for identifying a current accumulated latency for each thread in the set of threads; and

program code, stored on the computer recordable media, for comparing the total latency for the each thread in the set of threads to the threshold.

22. The computer program product of claim 16 , wherein the program code, stored on the computer recordable media, for monitoring the accumulated latency time for the set of threads executing in a data processing system is program code for a device driver.

23. The computer program product of claim 16 , wherein the call stack information is obtained using a virtual machine interface to collect the call stack information.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 19, 2008
From: JONES, SCOTT THOMAS; LEVINE, FRANK ELIOT
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 020673/0341 →
Continuity (1)
Related Publication 20090241095A1 · Sep 24, 2009