# US 2017/0255539 A1 · Obtaining application performance data for different performance events via a unified channel

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2017/0255539 A1
- Document ID: US20170255539A1
- Status: Published application
- Kind: A1
- Application number: 15/602,480
- Filed: 2017-05-23
- Published: 2017-09-07
- Earliest claimed: 2009-12-04
- Assignees: Red Hat, Inc.
- Applicants: Red Hat, Inc.
- Inventors: Ingo Molnar; Thomas Gleixner
- Web page: https://patentgrep.com/patent/US20170255539A1

## CPC

- G06F 11/3466: {Performance evaluation by tracing or monitoring}
- G06F 11/3409: {for performance assessment}
- G06F 2201/86: Event-based monitoring
- G06F 2201/865: Monitoring of software
- G06F 2201/88: Monitoring involving counting
- G06F 2201/885: Monitoring specific for caches
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A system for obtaining performance data for different performance events includes a first application monitoring performance of a second application executing on a computing system. The first application identifies the type of event to be measured with respect to the second application, issues a first system call identifying the type of event, receives an identifier corresponding to the event type, and causes the second application to begin execution. After the execution of the second application is completed, the first application issues a second system call including the identifier corresponding to the event type, and receives a value of a hardware counter corresponding to the event type from an operating system.

## Claims

### Claim 1

A method comprising:
identifying, by a first application executed by a processing device of a computing system, an event type of event to be measured with respect to performance of a second application being monitored;
issuing, by the first application, a first virtual file system call comprising the identified event type as a parameter, wherein the identified event type corresponds to a cumulative counter, and wherein the cumulative counter is a data field to aggregate a value of a first hardware counter for a first processor, and a value of a second hardware counter for a second processor;
subsequent to receiving a file descriptor of the cumulative counter of the identified event type, causing, by the first application, the second application to begin the execution, wherein the first hardware counter is to perform measurements for the first processor during the execution of the second application based on performance characteristics of the second application for the identified event type, and the second hardware counter is to perform measurements for the second processor during the execution of the second application based on the performance characteristics of the second application for the identified event type;
after the execution of the second application is completed, issuing, by the first application, a second virtual file system call including the file descriptor for the cumulative counter of the identified event type as a parameter, wherein a value of the cumulative counter is an aggregation of the value of the first hardware counter and the value of the second hardware counter; and
receiving, by the first application, the value of the cumulative counter of the identified event type from an operating system in response to the second virtual file system call.

### Claim 2 (depends on 1)

The method of claim 1 wherein the second virtual file system call is a read virtual file system call specifying the file descriptor.

### Claim 3 (depends on 1)

The method of claim 1 wherein:
each of the first processor and the second processor is associated with a performance monitoring unit (PMU) that exports a set of hardware counters; and
the operating system is associated with a performance counter and event (PCE) subsystem that activates the set of hardware counters and provides one or more virtual counters. .

### Claim 4 (depends on 3)

The method of claim 3 wherein a number of hardware counters in the set of hardware counters does not exceed a threshold.

### Claim 5 (depends on 3)

The method of claim 3 wherein the PCE subsystem provides for sharing of hardware counters across multiple event types responsive to the first application requesting a number of event types that exceeds a number of hardware counters in the set of hardware counters.

### Claim 6 (depends on 4)

The method of claim 4 further comprising:
setting a counter scheduler to trigger a timer interrupt to ensure that a number of counters requested by the first application does not exceed the number of hardware counters in the set of hardware counters.

### Claim 7 (depends on 3)

The method of claim 3 further comprising:
receiving a sampling request of the first application, where the sampling request specifies a sampling time period;
setting a sampling register in the PMU using a requested sampling period;
activating an interrupt flag in the PMU to raise an interrupt linked to an interrupt handler in the PCE subsystem;
allocating a buffer to associate with a file descriptor;
providing the file descriptor to the first application;
in response to an interrupt, storing resulting sampling information in the buffer associated with the file descriptor;
waking up one or more tasks that are waiting for the resulting sampling information; and
upon receiving a close file descriptor request, clearing the sampling register, deactivating the interrupt flag and clearing the buffer.

### Claim 8 (depends on 1)

The method of claim 1 wherein:
the first virtual file system call comprises a task parameter identifying a task of the second application and a processor parameter;
the task parameter indicates any one of a current task, a specific task, or all tasks executed on the first and second processors; and
the processor parameter indicates the first processor and the second processor on the computing system.

### Claim 9

A non-transitory computer readable storage medium including instructions that, when executed by a computing system, cause the computing system to perform a set of operations comprising:
identifying, by a first application executed by a processing device of the computing system, an event type of event to be measured with respect to performance of a second application being monitored;
issuing, by the first application, a first virtual file system call comprising the identified event type as a parameter, wherein the identified event type corresponds to a cumulative counter, and wherein the cumulative counter is a data field to aggregate a value of a first hardware counter for a first processor, and a value of a second hardware counter for a second processor;
subsequent to receiving a file descriptor of the cumulative counter of the identified event type, causing, by the first application, the second application to begin the execution, wherein the first hardware counter is to perform measurements for the first processor during the execution of the second application based on performance characteristics of the second application for the identified event type, and the second hardware counter is to perform measurements for the second processor during the execution of the second application based on the performance characteristics of the second application for the identified event type;
after the execution of the second application is completed, issuing, by the first application, a second virtual file system call including the file descriptor for the cumulative counter of the identified event type as a parameter, wherein a value of the cumulative counter is an aggregation of the value of the first hardware counter and the value of the second hardware counter; and
receiving, by the first application, the value of the cumulative counter of the identified event type from an operating system in response to the second virtual file system call.

### Claim 10 (depends on 9)

The non-transitory computer readable storage medium of claim 9 wherein:
each of the first processor and the second processor is associated with a performance monitoring unit (PMU) that exports a set of hardware counters; and
the operating system is associated with a performance counter and event (PCE) subsystem that activates the set of hardware counters and provides one or more virtual counters. .

### Claim 11 (depends on 10)

The non-transitory computer readable storage medium of claim 10 wherein a number of hardware counters in the set of hardware counters does not exceed a threshold.

### Claim 12 (depends on 10)

The non-transitory computer readable storage medium of claim 10 wherein the PCE subsystem provides for sharing of hardware counters across multiple event types responsive to the first application requesting a number of event types that exceeds a number of hardware counters in the set of hardware counters.

### Claim 13 (depends on 11)

The non-transitory computer readable storage medium of claim 11 wherein the set of operations further comprise:
setting a counter scheduler to trigger a timer interrupt to ensure that a number of counters requested by the first application does not exceed the number of hardware counters in the set of hardware counters.

### Claim 14 (depends on 11)

The non-transitory computer readable storage medium of claim 11 wherein the set of operations further comprise:
receiving a sampling request of the first application, where the sampling request specifies a sampling time period;
setting a sampling register in the PMU using a requested sampling period;
activating an interrupt flag in the PMU to raise an interrupt linked to an interrupt handler in the PCE subsystem;
allocating a buffer to associate with a file descriptor;
providing the file descriptor to the first application;
in response to an interrupt, storing resulting sampling information in the buffer associated with the file descriptor;
waking up one or more tasks that are waiting for the resulting sampling information; and
upon receiving a close file descriptor request, clearing the sampling register, deactivating the interrupt flag and clearing the buffer.

### Claim 15 (depends on 9)

The non-transitory computer readable storage medium of claim 9 wherein:
the first virtual file system call comprises a task parameter identifying a task of the second application and a processor parameter;
the task parameter indicates any one of a current task, a specific task, or all tasks executed on the first and second processors; and
the processor parameter indicates the first processor and the second processor on the computing system.

### Claim 16

A system comprising:
a memory;
processors coupled to the memory; and
a first application, executed from the memory by the processors, to:
identify an event type of event to be measured with respect to performance of a second application being monitored;
issue a first virtual file system call comprising the identified event type as a parameter, wherein the identified event type corresponds to a cumulative counter, and wherein the cumulative counter is a data field to aggregate a value of a first hardware counter for a first processor, and a value of a second hardware counter for a second processor;
subsequent to receiving a file descriptor of the cumulative counter of the identified event type, cause the second application to begin the execution, wherein the first hardware counter is to perform measurements for the first processor during the execution of the second application based on performance characteristics of the second application for the identified event type, and the second hardware counter is to perform measurements for the second processor during the execution of the second application based on the performance characteristics of the second application for the identified event type;
after the execution of the second application is completed, issue a second virtual file system call including the file descriptor for the cumulative counter of the identified event type as a parameter, wherein a value of the cumulative counter is an aggregation of the value of the first hardware counter and the value of the second hardware counter; and
receive the value of the cumulative counter of the identified event type from an operating system in response to the second virtual file system call.

### Claim 17 (depends on 16)

The system of claim 16 wherein the second virtual file system call is a read virtual file system call specifying the file descriptor.

### Claim 18 (depends on 16)

The system of claim 16 wherein:
each of the first processor and the second processor is associated with a performance monitoring unit (PMU) that exports a set of hardware counters; and
the operating system is associated with a performance counter and event (PCE) subsystem that activates the set of hardware counters and provides one or more virtual counters.

### Claim 19 (depends on 18)

The system of claim 18 wherein a number of hardware counters in the set of hardware counters does not exceed a threshold.

### Claim 20 (depends on 18)

The system of claim 18 wherein the PCE subsystem provides for sharing of hardware counters across multiple event types responsive to the first application requesting a number of event types that exceeds a number of hardware counters in the set of hardware counters.
