P
US6954922B2ExpiredUtilityPatentIndex 96

Method apparatus and article of manufacture for time profiling multi-threaded programs

Assignee: SUN MICROSYSTEMS INCPriority: Apr 29, 1998Filed: Apr 29, 1998Granted: Oct 11, 2005
Est. expiryApr 29, 2018(expired)· nominal 20-yr term from priority
Inventors:LIANG SHENG
G06F 11/3404G06F 11/3419G06F 2201/88G06F 11/3466G06F 11/348G06F 2201/865
96
PatentIndex Score
56
Cited by
13
References
30
Claims

Abstract

Methods, systems, and articles of manufacture consistent with the present invention time profile program threads using data corresponding to states of the registers of a processor(s) executing the threads. Methods, systems, and articles of manufacture consistent with the present invention determine whether a selected thread of execution of a multi-threaded program is running by suspending execution of the multi-threaded program, retrieving register data corresponding to the selected thread, computing register information based on the register data, comparing the computed register information with stored register information from a previous suspension of the multi-threaded program, and regarding the selected thread as running if the computed register information is different from stored register information. The last operation of regarding the selected thread as running may involve updating the previous register information based on the computed register information, and/or providing an indication corresponding to a portion of the program containing the selected thread.

Claims

exact text as granted — not AI-modified
1. A method for time profiling multiple threads of execution corresponding to a program, comprising:
 periodically interrupting execution of all of the threads;  
 determining whether register data corresponding to a selected thread has changed from a previous interrupt of all of the threads; and  
 providing an indication of the change for the selected thread.  
 
   
   
     2. The method of  claim 1 , wherein the determining step includes
 accessing stored data corresponding to the selected thread; and  
 comparing the stored data with register information stored following a previous interrupt.  
 
   
   
     3. The method of  claim 2 , wherein the comparing step includes
 computing a value corresponding to the stored; and  
 determining a relationship between the computed value and the previously stored register information.  
 
   
   
     4. The method of  claim 3 , wherein the step of providing an indication of the change for the selected thread includes
 updating a memory segment to reflect that the selected thread is running when it is determined that the computed value and the previously stored register information do not match.  
 
   
   
     5. The method of  claim 1 , further comprising:
 assigning a cost indicator to an identified portion of the program that is active when it is determined that the selected thread is running.  
 
   
   
     6. The method of  claim 5 , wherein the cost indicator reflects a number of cycles the selected thread was running in the identified portion of the program. 
   
   
     7. A method for determining whether a selected thread of execution of a multi-threaded program is running, comprising:
 suspending execution of the multi-threaded program;  
 retrieving register data corresponding to the selected thread;  
 computing a value based on the register data;  
 comparing the computed value with register information stored following a previous suspension of the multi-threaded program;  
 regarding the selected thread as running if the computed value is different from the previously stored register information; and  
 providing an indication corresponding to a portion of the program containing the selected thread.  
 
   
   
     8. The method of  claim 7 , wherein the regarding step includes updating the previous register information based on the computed value. 
   
   
     9. The method of  claim 7 , wherein the indication reflects a number of cycles the selected thread was running in a portion of the program that is active when it is determined the selected thread is running. 
   
   
     10. A method for time profiling multiple threads of execution corresponding to a program, comprising:
 periodically suspending execution of the program;  
 determining whether information corresponding to processor registers for each thread indicates that the thread is running by comparing the information to stored information from a previous interrupt of all of the threads; and  
 recording time-profiling information for each running thread.  
 
   
   
     11. The method of  claim 10 , wherein the time-profiling information includes a cost indicator that reflects a number of cycles the selected thread was running in the portion of the program that is active when it is determined the selected thread is running. 
   
   
     12. A time profiling system, comprising:
 a multi-threaded program; and  
 a processor configured to execute the multi-threaded program, and to periodically interrupt execution of all of the threads to determine whether register data corresponding to a selected thread has changed from a previous interrupt and provide an indication of the change for the selected thread.  
 
   
   
     13. The system of  claim 12 , wherein the processor is further configured to access stored data corresponding to the selected thread and compare the stored data b with register information stored following a previous interrupt. 
   
   
     14. The system of  claim 13 , wherein the processor is further configured to compute a value corresponding to the stored data and determine a relationship between the computed value and the previously stored register information. 
   
   
     15. The system of  claim 14 , wherein the processor is further configured to update a memory segment to reflect that the selected thread is running when it is determined that the computed value and the previously stored register information do not match. 
   
   
     16. A time profiling system, comprising:
 a multi-threaded program; and  
 a processor configured to periodically suspend execution of the multi-threaded program, to retrieve register data corresponding to a selected thread, compute a value based on the register data, compare the computed value with register information stored following a previous suspension of the multi-threaded program, regard the selected thread as running if the computed value is different from the previously stored register information, and provide an indication corresponding to a portion of the program containing the selected thread.  
 
   
   
     17. The system of  claim 16 , wherein the processor is further configured to updating the previous register information based on the computed value. 
   
   
     18. A time profiling system for time profiling multiple threads of execution corresponding to a program, comprising:
 a processor configured to periodically suspend execution of the program; and  
 said processor further configured to, during each program suspension, determine whether information corresponding to processor registers for each program thread indicates that the thread is running by comparing the information to stored information from a previous program suspension and record time-profiling information for each running thread.  
 
   
   
     19. An article of manufacture containing instructions for performing operations, when executed by a processor, for time profiling multiple threads of execution corresponding to a program, by:
 periodically interrupting execution of all of the threads;  
 determining whether register data corresponding to a selected thread has changed from a previous interrupt of all of the threads; and  
 providing an indication of the change for the selected thread.  
 
   
   
     20. The article manufacture of  claim 19 , wherein the determining step includes accessing stored data corresponding to the selected thread; and comparing the stored data with register information stored following a previous interrupt. 
   
   
     21. The article of manufacture of  claim 20 , wherein the comparing step includes computing a value corresponding to the stored data; and determining a relationship between the computed value and the previously stored register information. 
   
   
     22. The article of manufacture of  claim 21 , wherein the step of providing an indication of the change for the selected thread includes updating a profile to reflect that the selected thread is running when it is determined that the computed value and the previously stored register information do not match. 
   
   
     23. The article of manufacture of  claim 19 , wherein the method further comprises: assigning a cost indicator to an identified portion of the program that is active when it is determined that the selected thread is running. 
   
   
     24. The article of manufacture of  claim 23 , wherein the cost indicator reflects a number of cycles the selected thread was running in the identified portion of the program. 
   
   
     25. An article of manufacture containing instructions for performing operations, when executed by a processor, for determining whether a selected thread of execution of a multi-threaded program is running, by:
 suspending execution of the multi-threaded program;  
 retrieving register data corresponding to the selected thread;  
 computing a value based on the register data;  
 comparing the computed value with register information stored following a previous suspension of the multi-threaded program;  
 regarding the selected thread as running if the computed value is different from the previously stored register information; and  
 providing an indication corresponding to a portion of the program containing the selected thread.  
 
   
   
     26. The article of manufacture of  claim 25 , wherein the regarding step includes updating the previous register information based on the computed value. 
   
   
     27. The article of manufacture of  claim 25 , wherein the indication reflects a number of cycles the selected thread was running in a portion of the program that is active when it is determined the selected thread is running. 
   
   
     28. An article of manufacture containing instructions for performing operations, when executed by a processor, for time profiling multiple threads of execution corresponding to a program, by:
 periodically suspending execution of the program;  
 determining whether information corresponding to processor registers for each thread indicates that the thread is running by comparing the information to stored information from a previous interrupt; and  
 recording time-profiling information for each running thread.  
 
   
   
     29. The article of manufacture of  claim 28 , wherein the time profiling information includes a cost indicator that reflects a number of cycles the selected thread was running in the portion of the program that is active when it is determined the selected thread is running. 
   
   
     30. A system for time profiling multiple threads of execution corresponding to a program, comprising:
 means for periodically interrupting execution of all of the threads;  
 means for determining whether register data corresponding to a selected thread has changed from a previous interrupt; and  
 means for providing an indication of the change for the selected thread.

Cited by (0)

No later patents cite this yet.

References (0)

No backward citations on record.