IP Library Granted Patent US 8,839,041
Granted Patent B2
US 8,839,041 · App. 13/933,957 · Granted Sep 16, 2014

Exposing application performance counters for applications through code instrumentation

Inventors: Alex Zakonov (Manchester, CT); Victor Mushkatin (West Hartford, CT)
Assignee: Microsoft Corporation
G06F11/302G06F11/3419G06F11/3409G06F11/3476G06F2201/88
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,839,041
App. No.
13/933,957
Granted
Sep 16, 2014
Kind
B2
Abstract

Disclosed is a method for adding performance counters to an application after compilation of the application to Common Intermediate Language code without a requirement for code changes to the original application code or application recompilation from the development side. With regard to a further aspect of a particularly preferred embodiment, the invention may provide a method for adding the performance counters by declarative instrumentation of an application at runtime or compile time, without the need for an application developer to hardcode instrumentation logic into the application. An instrumentation configuration file provides declarative definition for performance counters that are to be added to a particular application, and particularly includes a complete list of performance counters that need to be added and settings for each performance counter.

Claims (50)

1. A computer program product for implementing a computer implemented method for instrumenting performance counters in an application, the computer program product comprising one or more computer-readable storage devices having encoded thereon computer executable instructions which, when executed upon one or more processors within a computing system, perform the method for instrumenting performance counters in an application, the method comprising:

loading an instrumentation configuration to determine one or more application methods requiring performance counter instrumentation and one or more types of performance counter that are to be instrumented for each such application method;

locating a segment of a method body that is to be instrumented with said one or more types of performance counter; and

modifying the segment of the method body to expose one or more types of performance counter, wherein said modifying step further comprises:

inserting declarative instrumentation filtering code into said method body, said declarative instrumentation filtering code comprising computer executable instructions configured to:

retrieve values from application method runtime parameters and class member variables;

calculate filtering expressions; and

determine if a method runtime context matches a filtering rule set associated with said one or more types of performance counters that are to be instrumented.

2. The computer program product of claim 1 , further comprising the step of incrementing an instrumented performance counter upon determining that said instrumented performance counter was previously registered with an operating system on which said application runs.

3. The computer program product of claim 1 , wherein said modifying step further comprises:

inserting declarative instrumentation naming code into said Common Intermediate Language method body, said declarative instrumentation naming code comprising computer executable instructions configured to:

retrieve values from application method runtime parameters and class member variables; and

calculate a performance counter class, a performance counter name, and a performance counter instance name.

4. The computer program product of claim 3 , further comprising the step of inserting declarative instrumentation analysis code into said method body, said declarative instrumentation analysis code comprising computer executable instructions configured to determine whether or not a performance counter instance name was previously registered with an operating system on which said application runs.

5. The computer program product of claim 4 , wherein said declarative instrumentation analysis code is further configured to create a new performance counter instance and instrument a performance counter value upon determining that said performance counter instance name was not previously registered.

6. The computer program product of claim 4 , wherein said declarative instrumentation analysis code is further configured to increment a performance counter value upon determining that said performance counter instance name was previously registered.

7. The computer program product of claim 4 , wherein said declarative instrumentation analysis code is further configured to execute only upon said method runtime context matching said filtering rule set.

8. A computer implemented method for instrumenting performance counters in an application, the method comprising:

loading an instrumentation configuration to determine one or more application methods requiring performance counter instrumentation and one or more types of performance counter that are to be instrumented for each such application method;

locating a segment of a method body that is to be instrumented with said one or more types of performance counter; and

modifying the segment of the method body to expose one or more types of performance counter, wherein said modifying step further comprises:

inserting declarative instrumentation filtering code into said method body, said declarative instrumentation filtering code comprising computer executable instructions configured to:

retrieve values from application method runtime parameters and class member variables;

calculate filtering expressions; and

determine if a method runtime context matches a filtering rule set associated with said one or more types of performance counters that are to be instrumented.

9. The method of claim 8 , further comprising the step of incrementing an instrumented performance counter upon determining that said instrumented performance counter was previously registered with an operating system on which said application runs.

10. The method of claim 8 , wherein said modifying step further comprises:

inserting declarative instrumentation naming code into said Common Intermediate Language method body, said declarative instrumentation naming code comprising computer executable instructions configured to:

retrieve values from application method runtime parameters and class member variables; and

calculate a performance counter class, a performance counter name, and a performance counter instance name.

11. The method of claim 10 , further comprising the step of inserting declarative instrumentation analysis code into said Common Intermediate Language method body, said declarative instrumentation analysis code comprising computer executable instructions configured to determine whether or not a performance counter instance name was previously registered with an operating system on which said application runs.

12. The method of claim 11 , wherein said declarative instrumentation analysis code is further configured to create a new performance counter instance and instrument a performance counter value upon determining that said performance counter instance name was not previously registered.

13. The method of claim 11 , wherein said declarative instrumentation analysis code is further configured to increment a performance counter value upon determining that said performance counter instance name was previously registered.

14. A system for implementing a computer implemented method for instrumenting performance counters in an application, the system comprising one or more computer processors and computer memory having encoded thereon computer executable instructions which, when executed upon the one or more processors, perform the method for instrumenting performance counters in an application, the method comprising:

loading an instrumentation configuration to determine one or more application methods requiring performance counter instrumentation and one or more types of performance counter that are to be instrumented for each such application method;

locating a segment of a method body that is to be instrumented with said one or more types of performance counter; and

modifying the segment of the method body to expose one or more types of performance counter, wherein said modifying step further comprises:

inserting declarative instrumentation filtering code into said method body, said declarative instrumentation filtering code comprising computer executable instructions configured to:

retrieve values from application method runtime parameters and class member variables;

calculate filtering expressions; and

determine if a method runtime context matches a filtering rule set associated with said one or more types of performance counters that are to be instrumented.

15. The system of claim 14 , further comprising the step of incrementing an instrumented performance counter upon determining that said instrumented performance counter was previously registered with an operating system on which said application runs.

16. The computer program product of claim 14 , wherein said modifying step further comprises:

inserting declarative instrumentation naming code into said Common Intermediate Language method body, said declarative instrumentation naming code comprising computer executable instructions configured to:

retrieve values from application method runtime parameters and class member variables; and

calculate a performance counter class, a performance counter name, and a performance counter instance name.

17. The system of claim 16 , further comprising the step of inserting declarative instrumentation analysis code into said Common Intermediate Language method body, said declarative instrumentation analysis code comprising computer executable instructions configured to determine whether or not a performance counter instance name was previously registered with an operating system on which said application runs.

18. The system of claim 17 , wherein said declarative instrumentation analysis code is further configured to create a new performance counter instance and instrument a performance counter value upon determining that said performance counter instance name was not previously registered.

19. system claim 17 , wherein said declarative instrumentation analysis code is further configured to increment a performance counter value upon determining that said performance counter instance name was previously registered.

20. The system of claim 17 , wherein said declarative instrumentation analysis code is further configured to execute only upon said method runtime context matching said filtering rule set.

Assignments (3)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Dec 14, 2017
From: MICROSOFT CORPORATION
To: MICROSOFT TECHNOLOGY LICENSING, LLC
Reel/Frame 044402/0393 →
MERGER Recorded Dec 8, 2017
From: AVICODE, INC.
To: MICROSOFT CORPORATION
Reel/Frame 044342/0533 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jul 2, 2013
From: ZAKONOV, ALEX; MUSHKATIN, VICTOR
To: MICROSOFT CORPORATION
Reel/Frame 030730/0921 →
Continuity (4)
Continuation 13252648 · Oct 4, 2011
Continuation 12503313 · Jul 15, 2009
Provisional Application 61134919 · Jul 15, 2008
Related Publication 20130297963A1 · Nov 7, 2013