IP Library Granted Patent US 12,298,875
Granted Patent B2
US 12,298,875 · App. 17/837,507 · Granted May 13, 2025

Employing sampled register values to infer memory accesses by an application

Inventors: Danny Chen (Woodinville, WA); Colin M. Francis (Bellevue, WA); Eric M. Vaughn (Bellevue, WA)
Assignee: Microsoft Technology Licensing, LLC
G06F11/3037G06F9/30G06F9/30101G06F9/30145G06F9/3016G06F11/3495G06F11/3636
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 12,298,875
App. No.
17/837,507
Granted
May 13, 2025
Kind
B2
Abstract

This document relates to memory access profiling. One example relates to a method or technique that can include obtaining samples collected when executing an application, the samples comprising sampled register values that were present in one or more registers of a processor when the samples were collected. The method or technique can also include identifying sampled instructions of the application that were executing when the samples were collected and other instructions of the application. The method or technique can also include evaluating the sampled instructions and one or more of the other instructions using the sampled register values to identify memory accesses by the application. The method or technique can also include outputting the identified memory accesses.

Claims (47)

1. A method comprising:

obtaining samples collected when executing an application, the samples comprising sampled register values that were present in one or more registers of a processor other than a program counter when the samples were collected, the sampled register values being collected from the one or more registers other than the program counter after a context switch from the application to an operating system that recorded the sampled register values;

identifying sampled instructions of the application that were executing when the samples were collected and other instructions of the application;

evaluating the sampled instructions and one or more of the other instructions using the sampled register values to identify memory accesses by the application; and

storing the identified memory accesses in a memory access log.

2. The method of claim 1 , wherein the storing comprises storing, in the memory access log, memory addresses of the identified memory accesses and memory sizes that were accessed by the identified memory accesses.

3. The method of claim 1 , further comprising:

identifying the sampled instructions that were executing when the samples were taken based at least on contents of the program counter, the sampled register values further including the contents of the program counter.

4. The method of claim 3 , wherein the evaluating comprises iterating through the other instructions, updating individual register values based at least on the other instructions and the sampled register values, identifying individual memory accesses based at least on the updated individual register values, and storing the individual memory accesses in the memory access log.

5. The method of claim 4 , the iterating being performed in a backward direction over multiple previous instructions occurring in the application prior to the sampled instructions and in a forward direction over multiple subsequent instructions occurring in the application after the sampled instructions.

6. The method of claim 1 , wherein the evaluating comprises marking individual registers as invalid according to one or more register invalidity criteria.

7. The method of claim 6 , wherein the one or more register invalidity criteria relate to instructions that load the individual registers from memory.

8. The method of claim 7 , wherein the one or more register invalidity criteria relate to instructions that compute register values for the individual registers from other registers previously designated as invalid.

9. The method of claim 1 , further comprising:

configuring a garbage collector based at least on the identified memory accesses.

10. The method of claim 1 , further comprising:

identifying memory utilization of at least one function or data object in the application based at least on the identified memory accesses.

11. The method of claim 1 , further comprising:

characterizing memory fragmentation of the application based at least on the identified memory accesses.

12. A system comprising:

a processor; and

a storage medium storing instructions which, when executed by the processor, cause the system to:

obtain samples collected when executing an application, the samples comprising sampled register values that were present in one or more registers of a processor other than a program counter when the samples were collected, the sampled register values being collected from the one or more registers other than the program counter after a context switch from the application to an operating system that recorded the sampled register values;

obtain application code of the application, the application code including sampled instructions that were executing when the samples were taken and other instructions of the application;

iterate through the sampled instructions and the other instructions of the application while updating the sampled register values to obtain updated register values;

identify memory accesses based at least on the other instructions and the sampled register values or the updated register values; and

store the memory accesses in a memory access log.

13. The system of claim 12 , wherein the instructions, when executed by the processor, cause the system to:

calculate addresses of the memory accesses based at least on the sampled register values or the updated register values.

14. The system of claim 13 , wherein the instructions, when executed by the processor, cause the system to:

cease iterating through the other instructions responsive to encountering a control flow instruction.

15. The system of claim 12 , wherein the instructions, when executed by the processor, cause the system to:

receive the samples via telemetry data reported from a plurality of client devices that execute the application locally.

16. A computer-readable storage medium storing instructions which, when executed by a computing device, cause the computing device to perform acts comprising:

receiving user input specifying a sampling configuration for an application;

configuring sampling of the application according to the sampling configuration;

obtaining samples collected when executing the application according to the sampling configuration, the samples comprising sampled register values that were present in one or more registers of a processor other than a program counter when the samples were collected, the sampled register values being collected from the one or more registers other than the program counter after a context switch from the application to an operating system that recorded the sampled register values;

evaluating the samples to identify memory accesses by the application;

storing the identified memory accesses in a memory access log; and

identifying memory access characteristics of the application by analyzing the identified memory accesses in the memory access log.

17. The computer-readable storage medium of claim 16 , the acts further comprising:

displaying a graphical user interface comprising user-selectable elements for specifying the sampling configuration; and

receiving the user input via the graphical user interface.

18. The computer-readable storage medium of claim 17 , the graphical user interface having user-selectable elements for specifying sampling intervals by time period or by number of instructions.

19. The computer-readable storage medium of claim 16 , the acts further comprising:

displaying a graphical user interface that conveys the identified memory access characteristics.

20. The computer-readable storage medium of claim 19 , the graphical user interface identifying at least one of memory fragmentation characteristics of the application, memory utilization of data objects the application, memory utilization characteristics of functions of the application, or data objects of the application that were not accessed.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 17, 2022
From: CHEN, DANNY; FRANCIS, COLIN M; VAUGHN, ERIC M
To: MICROSOFT TECHNOLOGY LICENSING, LLC
Reel/Frame 060835/0641 →
Continuity (1)
Related Publication 20230401135A1 · Dec 14, 2023
References Cited (13)
US 6941545B1 · Reese · 2005 [cited by examiner]
US 6961930B1 · Waldspurger et al. · 2005 [cited by applicant]
US 8762951B1 · Kosche · 2014 [cited by examiner]
US 9367316B2 · Bradbury · 2016 [cited by examiner]
US 20050071608A1 · Dewitt et al. · 2005 [cited by applicant]
US 20070028010A1 · Krasnansky · 2007 [cited by examiner]
US 20070271442A1 · Shaw · 2007 [cited by examiner]
US 20130246754A1 · Bradbury et al. · 2013 [cited by applicant]
US 20180004530A1 · Vorbach · 2018 [cited by examiner]
US 20180060213A1 · Mola · 2018 [cited by examiner]
Guru Venkataramani et al., MemTracker: Efficient and Programmable Support for Memory Access Monitoring and Debugging, 2007 IEEE, [Retrieved on Nov. 25, 2024]. Retrieved from the internet: <URL: https://ieeexplore.ieee.o… [cited by examiner]
“International Search Report and Written Opinion Issued in PCT Application No. PCT/US23/022180”, Mailed Date: Aug. 24, 2023, 12 Pages. [cited by applicant]
Moseley, et al., “Identifying Potential Parallelism via Loop-centric Profiling,” Proceedings of the 4th International Conference on Computing Frontiers, May 2007, (pp. 143-151). [cited by applicant]
Cited By (1)
US 12,737,275