Shooting snapshots for performance monitoring

Independently reading the status of performance counters through hardware solves the problems of low performance monitoring efficiency and large interference caused by software sampling in the existing technology, and achieves efficient and accurate performance monitoring and data protection.

CN118733375APending Publication Date: 2024-10-01INTEL CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311819978.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-03-31
Filing Date
2023-12-26
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

Performance counters in existing information processing systems are sampled through software, resulting in high software overhead, inaccurate measurements, and high interference, and it is difficult to protect performance information in a multi-tenant environment.

Method used

Read the status of performance counters through hardware independent of software execution, use performance monitoring hardware resources and storage devices, combine event occurrence capture and status data logging to provide more efficient and accurate performance monitoring, and allow virtual machine monitor or hypervisor selection Permanently control the collection of performance counter data.

Benefits of technology

Enables more efficient and accurate performance monitoring, reduces software overhead and interference, and supports performance information protection and selective data collection in multi-tenant environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118733375A_ABST
    Figure CN118733375A_ABST
Patent Text Reader

Abstract

The invention discloses shooting snapshots for performance monitoring. Techniques for snapshotting performance monitoring are described. In an embodiment, an apparatus includes: a plurality of performance monitoring hardware resources; hardware to capture a record of state data relating to a state of the device in conjunction with the occurrence of the event; and a storage device for storing a first indicator corresponding to at least a first performance monitoring hardware resource of the plurality of performance monitoring hardware resources and for enabling the hardware to include performance data from the first performance monitoring hardware resource in a record.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0001] A processor or execution core in an information handling system may include performance counters for monitoring and recording performance information to be used, for example, to characterize, debug, and tune microarchitecture processor designs, find and fix performance bottlenecks in hardware and software, and locate avoidable performance problems. Typically, each performance counter is sampled by software that includes instructions for reading registers associated with the counter. BRIEF DESCRIPTION OF THE DRAWINGS

[0002] Various examples according to the present disclosure will be described with reference to the accompanying drawings, in which:

[0003] Figure 1 Illustrated is a processor for taking snapshots of performance monitoring according to an embodiment.

[0004] Figure 2 Illustrate the format of configuration registers and records for taking snapshots of performance monitoring according to an embodiment.

[0005] Figure 3 A method for taking a snapshot of performance monitoring according to an embodiment is illustrated.

[0006] Figure 4 An example computing system is illustrated.

[0007] Figure 5 A block diagram illustrating an example processor and / or System on a Chip (SoC) that may have one or more cores and an integrated memory controller.

[0008] 6(A) is a block diagram illustrating both an example in-order pipeline and an example register renaming, out-of-order issue / execution pipeline according to an example.

[0009] 6(B) is a block diagram illustrating both an example in-order architecture core and an example register renaming, out-of-order issue / execution architecture core to be included in a processor according to an example.

[0010] Figure 7 An example of execution unit(s) circuitry is shown.

[0011] Figure 8 is a block diagram illustrating converting binary instructions in a source instruction set architecture to binary instructions in a target instruction set architecture using a software instruction converter according to an example. DETAILED DESCRIPTION

[0012] The present disclosure relates to methods, devices, systems, and non-transitory computer-readable storage media for taking snapshots of performance monitoring. According to some examples, an apparatus includes: a plurality of performance monitoring hardware resources; hardware for capturing a record of state data related to a state of the apparatus in conjunction with an occurrence of an event; and a storage device for storing a first indicator, the first indicator corresponding to at least a first performance monitoring hardware resource of the plurality of performance monitoring hardware resources and for enabling the hardware to include performance data from the first performance monitoring hardware resource in the record.

[0013] As mentioned in the background section, a processor or execution core in an information handling system may include performance counters for monitoring and recording performance information. Typically, each performance counter is sampled by software including instructions for reading registers associated with the counter, which may be performed in response to an interrupt generated by performance monitoring hardware. This approach may include adding one or more interrupts and / or instructions for reading performance counters and / or metrics during execution of the monitored software, which may result in software overhead and inaccurate measurements of the monitored software.

[0014] In contrast, for example, by using hardware to capture the state of any one or more performance counters and / or metrics into a record that can be read independently of the execution of the monitored software, the embodiments described in this specification can provide more efficient performance monitoring with less software overhead and less interference with the monitored software. In addition, embodiments can provide for protecting performance information by allowing a virtual machine monitor (VMM), hypervisor or other system software to selectively control which counters and / or metrics will be captured and / or made available to a user (e.g., in a multi-tenant environment).

[0015] Embodiments may provide less intrusive collection of data from multiple performance counters based on counts from a single counter, thereby enabling more efficient, complete, and / or accurate performance monitoring. Other desired uses may include capturing information related to performance metric drift (e.g., in top-down microarchitecture analysis), information that aids in explaining and / or annotating processor stalls (e.g., as reported by cycle counts recorded by the last branch), etc.

[0016] The previous discussion and the following description(s) of embodiments based on performance counters are provided as examples.Embodiments may include and / or involve other performance monitoring hardware resources or any other hardware resources that may be considered as a group and / or as parts or subgroups of a group.

[0017] Figure 1 A processing device (processor) 100 for taking snapshots for performance monitoring according to an embodiment is illustrated.

[0018] Processor 100 may represent all or part of a hardware component including one or more processors, processor cores, or execution cores integrated on a single substrate or packaged in a single package, each of which may include multiple execution threads and / or multiple execution cores in any combination. Each processor represented as processor 100 or in processor 100 may be any type of processor, including a general-purpose microprocessor (such as Processor family or from The processor 100 may be a processor from another processor family of Intel Corporation or another company), a dedicated processor or a microcontroller, or any other device or component in an information processing system in which an embodiment may be implemented. Processor 100 may be architected and designed to operate according to any instruction set architecture (ISA) with or without microcode control. For convenience and / or example, some features (e.g., instructions, performance counters, registers, exceptions, etc.) may be implemented by being compatible with a particular processor architecture (e.g., 64 and / or IA32), but the embodiments are not limited to these features, names, architectures, etc.

[0019] Processor 100 may be implemented in logic gates and / or any other type of circuitry, all or part of which may be included in discrete components and / or integrated into the circuitry of a processing device or any other device in a computer or other information processing system. For example, Figure 1 The processor 100 in the embodiment may correspond to any one of the following and / or be implemented / included in any one of the following: Figure 4 The processor 470, 480 or 415, Figure 5 6(B), each as described below.

[0020] As shown, processor 100 includes instruction unit 110, execution unit 120, and performance monitoring unit 130. Processor 100 may include any number of each of these elements (e.g., multiple execution units) and / or Figure 1 Any other elements not shown.

[0021] As described below, the instruction unit 110 may correspond to and / or be implemented / included in the front end unit 630 in FIG. 6(B), and / or may include any circuits, logic gates, structures, and / or other hardware (such as an instruction decoder) to retrieve, receive, decode, interpret, schedule, and / or process instructions to be executed by the processor 100, such as a processor identification instruction 112 (e.g., CPUID as described below), and one or more read or write instructions 114 (e.g., RDMSR, WRMSR, RDPMC as described below). Figure 1 In , instructions that may be decoded or otherwise handled by instruction unit 110 are represented as blocks with dashed boundaries because the instructions themselves are not hardware, but instruction unit 110 may include hardware or logic capable of decoding or otherwise handling these instructions.

[0022] Any instruction format may be used in embodiments; for example, an instruction may include an opcode and one or more operands, where the opcode may be decoded into one or more microinstructions or micro-operations for execution by execution unit 120. The operands or other parameters may be associated with the instruction implicitly, directly, indirectly, or in any other manner.

[0023] The execution unit 120 may be associated with the execution engine 650 in FIG. 6(B) and / or the execution engine 650 in FIG. 6(B) and Figure 7 Any of the execution unit circuits 662 in FIG. 6(B) corresponds to and / or is implemented / included in the execution engine 650 in FIG. 6(B) and / or FIG. 6(B) and Figure 7 1 and 120. The execution unit 120 may be any of the execution unit circuits 662 in the processor (each as described below), and / or include any circuits, logic gates, structures, and / or other hardware (such as arithmetic units, logic units, floating point units, shifters, etc.) to process data and execute instructions, microinstructions, and / or micro-operations. The execution unit 120 may represent any one or more physically or logically distinct execution units.

[0024] The performance monitoring unit (PMU) 130 may include any circuit, logic, structure and / or other hardware for measuring, monitoring and / or recording performance information related to the processor 100, the software running on the processor 100 and / or the system including the processor 100. The PMU 130 may include one or more performance monitoring (perfmon) counters 132A to 132N and 134A to 134N for counting the occurrence of clock cycles, events, specific types of events, operations, occurrences, actions, conditions, processor parameters, or any other measurement of performance or related to performance (for convenience, any of which may be referred to as events and / or counting events). For example, the perfmon counter may be incremented or decremented for each occurrence of a selected event, or for each clock cycle during a selected event. The event may include any of a variety of events related to the execution of program code on the processor 100, such as instruction retirement, core clock cycle, reference clock cycle, cache reference, cache miss, branch instruction retirement, branch misprediction retirement, etc. Therefore, perfmon counters can be used to tune or profile program code to improve or optimize performance.

[0025] In embodiments, a perfmon counter may generate a performance record and / or a performance monitoring interrupt (PMI) when the counter overflows, where, for convenience, a counter overflow may refer to a counter reaching or exceeding its maximum value (e.g., when incrementing), reaching zero or otherwise underflowing (e.g., when counting down from a positive start), reaching zero (e.g., when counting down from a positive start or incrementing from a negative start), otherwise reaching or exceeding a fixed or programmable target value (e.g., when incrementing or decrementing), etc. For example, a counter may be preset to a modulo value that causes the counter to overflow after a certain number of events have been counted, which may generate a PMI and / or a performance record, such as a precise event-based sampling (PEBS) record, as described below.

[0026] One or more perfmon counters (e.g., 132A to 132N) may be fixed-function (e.g., dedicated to counting only specific events such as instruction retirements, core clock cycles, reference clock cycles) counters, any of which may be referred to as fixed perfmon counters, fixed counters, FC, FCx (where x is a number), FIXED_CTR (fixed_counter), FIXED_CTRx (fixed_counterx, where x is a number), etc. One or more perfmon counters (e.g., 134A to 134N) may be general-purpose (e.g., programmable to count specific selectable events such as cache references, cache misses, branch instruction retirements, branch mispredict retirements, and reconfigurable to count different selectable events) counters, any of which may be referred to as general-purpose perfmon counters, general-purpose counters, programmable perfmon counters, programmable counters, PMC, PMCx (where x is a number), etc. In various embodiments, perfmon counters (or any set or subset of perfmon counters) may be within the core and / or accessible by the core (core scope), or outside the core (e.g., within an uncore or system agent), and / or accessible to more than one core (package scope).

[0027] Processor 100 also includes a mechanism for perfmon counters to be used. For example, PMU 130 may include and / or be connected to one or more storage locations for accessing (e.g., reading, programming, enabling) the counters. In embodiments, such storage locations may be model / machine specific registers (MSRs) and / or may be referred to as MSRs for convenience. Some such MSRs may be specific to a processor or processor architecture (e.g., 64 and / or IA32), and / or some such MSRs may be described in more detail below. In various embodiments, an MSR (or any set or subset of an MSR) may be within a core and / or accessible by a core (core scoped), or outside a core (e.g., within an uncore or system agent), and / or accessible by more than one core (package scoped).

[0028] In embodiments including fixed function perfmon counters (e.g., 132A to 132N), the processor 100 may include one or more other MSRs that may be associated with one or more FCs (e.g., for configuring one or more FCs, controlling one or more FCs, providing status of one or more FCs), and in embodiments including general purpose perfmon counters (e.g., 134A to 134N), the processor 100 may include one or more other MSRs that may be associated with one or more PMCs (e.g., for configuring one or more PMCs, controlling one or more PMCs, providing status of one or more PMCs). For example, the processor 100 may include a fixed perfmon counter control MSR 138 (which may be referred to as FIXED_CTR_CTRL (fixed_counter_control)) associated with multiple FCs (e.g., for selectively enabling or disabling multiple FCs using a single write to the MSR), a global perfmon counter control MSR (which may be referred to as PERF_GLOBAL_CTRL (PERF_global_control)) 139 associated with multiple FCs and / or PMCs (e.g., for selectively enabling or disabling multiple FCs and / or PMCs using a single write to the MSR), and / or one or more event selection MSRs 136A to 136N (any of which may be referred to as EVTSEL, PERFEVTSEL, EVTSELx (where x is a number) or PERFEVTSELx (where x is a number) MSR)), each of which is associated with a PMC 134A to 134N, and may be programmed to select (e.g., using bits 7:0) events to be counted by its corresponding PMC, and to enable (e.g., using bit 22, which may be set to 1 to enable and cleared to 0 to disable) its corresponding PMC. Thus, processor 100 may include more than one method of enabling / disabling FC and / or PMC individually and / or in groups. Other perfmon MSRs are possible.

[0029] In an embodiment, the instruction set of processor 100 may include instructions for accessing (e.g., reading and / or writing) perfmon counters and / or MSRs associated with perfmon counters, such as instructions for reading perfmon counters (RDPMC), instructions for reading from MSRs (RDMSR), and instructions for writing to MSRs (WRMSR).

[0030] Processor 100 may also include mechanisms for indicating support and enumeration of performance monitoring capabilities and / or performance monitoring snapshots according to embodiments. For example, in response to an instruction (e.g., In an x86 processor, a CPUID instruction is executed with EAX=0AH), one or more processor registers (e.g., EAX, EBX, ECX, EDX) can return information to indicate whether performance monitoring is supported (e.g., the number of perfmon counters available, events that can be counted, and / or snapshot features according to an embodiment), to what extent performance monitoring is supported, how performance monitoring is supported, and the like.

[0031] Instructions associated with and / or used in conjunction with performance monitoring (e.g., CPUID, RDPMC, RDMSR, and WRMSR) may be intercepted by the VMM (e.g., the processor may be configured to cause a virtual machine (VM) exit) so that performance monitoring may be virtualized (e.g., providing and / or limiting VM access to performance monitoring capabilities).

[0032] Embodiments may provide performance monitoring to include capabilities, mechanisms, facilities, features, architectures, hardware, etc., for capturing any possible subset of counts from a processor's perfmon counters or information related to a processor's perfmon counters (e.g., performance metrics) into a record that can be read independently of the execution of the monitored software (e.g., without executing RDPMC or RDMSR instructions). Embodiments may include performance monitoring capabilities, mechanisms, facilities, features, architectures, hardware, etc. that capture records that include processor states, such as Precise event-based sampling (PEBS), Non-precise event-based sampling (NPEBS), AMD instruction based sampling (IBS), ARM statistical profiling extension (SPE). For convenience, embodiments will be described with reference to PEBS, but embodiments are not limited to PEBS or any other specific features or architectures.

[0033] As used herein, a precise event is an event that is linked to a specific instruction or micro-operation in an instruction trace and occurs when the instruction or micro-operation retires. Such precise events may include, but are not limited to, instruction retirement, branch instruction retirement, cache reference or cache miss, etc. An imprecise event is an event that is either not linked to a specific instruction or micro-operation in an instruction trace, or that speculatively occurs even when the instruction or micro-operation is not retired. As an example, an imprecise event may include, but is not limited to, a reference clock cycle, a core clock cycle, a clock cycle when an interrupt is masked, etc.

[0034] The operation of the processor may include the occurrence of events, as described above, including but not limited to events counted by or otherwise associated with software readable perfmon counters. An event may be a response to a given instruction and / or data flow in a processing device. An event may be associated with architectural metadata that includes state information of the processor, including but not limited to an instruction pointer, a timestamp counter, and register states.

[0035] In some embodiments, the processor is monitored to track precise and imprecise events. In some embodiments, the processing device tracks precise and / or imprecise events in a non-intrusive manner using a mechanism on the processing device and stores architectural metadata related to the events without the intervention of an interrupt (e.g., PMI).

[0036] As shown, for example, in Figure 1 In the PMU 130, an implementation of a PEBS feature or mechanism may include a PEBS handler circuit or hardware (e.g., PEBS handler HW 140) and one or more registers or other storage locations to enable and / or control the PEBS feature, such as a PEBS enable MSR (e.g., PEBS_ENABLE MSR 142) and a PEBS data configuration MSR (PEBS_DATA_CFG MSR 144).

[0037] In embodiments, PEBS data may be collected, captured, recorded, written, saved, etc. (e.g., as PEBS records) in response to or in conjunction with any one or more events (such as, but not limited to, the overflow of a performance monitoring counter). For example, PEBS_ENABLE MSR 142 may include one or more bits, each corresponding to a performance monitoring counter, that may be set to enable the capture of PEBS records (e.g., by PEBS handler HW 140) in response to an overflow of a corresponding performance monitoring counter. Enabling the capture of PEBS records may also be based on enabling one or more corresponding performance monitoring counters as described above (e.g., using FIXED_CTR_CTRL, PERF_GLOBAL_CTRL, and / or EVTSEL MSRs).

[0038] In an embodiment, the one or more registers for enabling and / or controlling the PEBS feature may include one or more registers (e.g., PEBS_ENABLE MSR 142 and / or PEBS_DATA_CFGMSR 144) containing one or more bits for enabling and disabling the capture or snapshot of performance monitoring information into a PEBS record, the performance monitoring information may include performance counter counts from one or more performance counters (performance monitoring snapshot feature) and / or metrics derived from the counts. Control of the performance monitoring snapshot feature may be separate, distinct, and / or independent from control of the performance counter / metric feature and the PEBS feature in one or more ways. For example, enabling or disabling data collection in conjunction with the performance monitoring snapshot feature may or may not (depending on the implementation) enable or disable data collection or other operations of the performance counter / metric feature and the PEBS feature. As a more specific example, the value of an indicator (e.g., a bit in PEBS_ENABLE MSR 142 or PEBS_DATA_CFG MSR 144) that controls the collection of data from a particular counter in conjunction with the performance monitoring snapshot feature may not override or otherwise control the collection of data from the particular counter in conjunction with the performance counter / metric feature and the PEBS feature and / or the use of the particular counter (e.g., even if a particular counter is disabled in conjunction with the performance monitoring snapshot feature, the particular counter may still be enabled and / or used in conjunction with the performance counter / metric feature and / or the PEBS feature, and its data may still be read in conjunction with the performance counter / metric feature, and / or its identity may still be captured as applicable counter data in the basic information group of the PEBS record, all of which may be further described above and / or below). However, in some embodiments, the opposite may or may not be true (depending on the implementation). For example, disabling (or not enabling) a particular counter or event in conjunction with the performance counter feature (e.g., a particular event is not selected to be counted by the general counter) may prevent the collection of data related to the particular counter or event in conjunction with the performance monitoring snapshot feature.

[0039] For example, a single bit position may control the performance monitoring snapshot feature at a global level such that if the value in bit position 0 is 1, performance monitoring snapshot information may be collected (subject to finer level control, if any); and if the value in that bit position is 0, performance monitoring snapshot information is not collected. Additionally or alternatively, bit positions may also be provided to enable and / or disable the collection of performance snapshot information at any number of finer levels (such bit positions may include, for example, bits for controlling the collection of performance metrics (PEBS_DATA_CFG.METRICS); bits for controlling the collection of counts from fixed counters and general purpose counters (PEBS_DATA_CFG.COUNTERS); bits for controlling the collection of counts from fixed counters; bits for controlling the collection of data from general purpose counters (PEBS_DATA_CFG.COUNTERS); bits for controlling the collection of counts from fixed counters; bits for controlling the collection of data from general purpose counters (PEBS_DATA_CFG.COUNTERS); bits for controlling the collection of data ... bits; a bit field (PEBS_DATA_CFG.INCLUDED_FIXED_CTRx(PEBS_data_configuration.Included_Fixed_CTRx)), including bit positions, each bit position corresponds to a separate fixed counter, and counts are collected from the separate fixed counter; a bit field (PEBS_DATA_CFG.INCLUDED_PMCx(PEBS_data_configuration.Included_PMCx)), including bit positions, each bit position corresponds to a separate general counter, and counts are collected from the separate general counter; etc.), as can be further described below.

[0040] The data and / or format of the PEBS records may be specified in whole or in part based on information from PEBS data configuration registers, as described below as an example. One or more PEBS records may be stored in a storage device or memory within or accessible to PMU 130, such as a PEBS buffer (e.g., PEBS buffer 146), and may be read and / or moved from the buffer or other storage device or memory by performance monitoring or other software, independent of the execution of the monitored software.

[0041] PEBS records may include architectural metadata of the state of the processor and / or system at the time of or in response to an event (e.g., a performance counter overflow). Such architectural metadata may include, but is not limited to, instruction pointers (IP), time stamp counters (TSC), register states, counts and / or states of any number of performance counters, and performance metrics (e.g., based on performance counters). Thus, PEBS records not only allow accurate analysis of the location of precise events in instruction traces, but also provide additional information for software optimization, hardware optimization, performance tuning, etc.

[0042] For example, Figure 2 The PEBS data configuration register (e.g., PEBS data configuration MSR 200) is shown, which can be used with Figure 1 144) and the format of a corresponding PEBS record (e.g., PEBS record 210), which may be stored in a PEBS buffer (e.g., PEBS buffer 220, which may be associated with Figure 1 Corresponding to the PEBS buffer 146 in ).

[0043] A PEBS record (e.g., PEBS record 210) may include PEBS data, which may refer to processor state, central processor unit (CPU) state, machine state, system state, architectural data and metadata, microarchitectural data and metadata, and any other data or information that may be collected in response to precise or imprecise events. A PEBS record may be formatted into data fields organized in groups.

[0044] For example, Figure 2 As shown, a PEBS record may include a basic information group (Basic Info 211), which may include a data field for the IP (e.g., the instruction whose execution, completion, retirement, etc. caused a counter overflow and / or triggered record generation), a data field for the TSC (e.g., when the record was generated), a data field for applicable counters (e.g., for identifying which counter(s) triggered record generation), etc.

[0045] For example, Figure 2 As shown, a PEBS record may include a memory information group (Memory Info 212), which may include a data field for a memory access address (e.g., a linear address of a source of a load or a destination of a store that caused a counter overflow and / or triggered record generation), one or more data fields for other memory access information, and the like.

[0046] For example, Figure 2 As shown, a PEBS record may include a group of general registers (GPR 213), which may include data fields for each or any number of general registers in the processor (e.g., the contents of the registers immediately following the execution, completion, retirement, etc. of the instruction that caused the counter to overflow and / or triggered the generation of the record), etc.

[0047] For example, Figure 2 As shown, a PEBS record may include a data register group (XMM 214) that may include data fields for each or any number of data registers in the processor (e.g., the contents of the register immediately following the execution, completion, retirement, etc. of the instruction that caused the counter to overflow and / or triggered the generation of the record), etc.

[0048] For example, Figure 2 As shown, the PEBS record may include a last branch record group (LBR 215), which may include one or more data fields for a last branch from address (e.g., the address from which the last branch was taken prior to execution, completion, retirement, etc. of the instruction that caused the counter to overflow and / or triggered the generation of the record), one or more data fields for a last branch to address (e.g., the address to which the last branch was taken prior to execution, completion, retirement, etc. of the instruction that caused the counter to overflow and / or triggered the generation of the record), one or more data fields for other last branch information, etc.

[0049] For example, Figure 2 As shown, a PEBS record may include a performance monitoring group (PerfMon 216) that may include one or more data fields for each or any number of performance monitoring counters in the processor (e.g., for counts immediately following execution, completion, retirement, etc. of an instruction that caused a counter to overflow and / or triggered record generation), one or more data fields for performance metrics (e.g., based on performance counter counts immediately following execution, completion, retirement, etc. of an instruction that caused a counter to overflow and / or triggered record generation), etc. The information to be collected for this group is different from and / or in addition to the information collected for the applicable counter fields discussed above, in that the group may include information (e.g., counts) for each performance counter or any subset of performance counters, not just information for the overflowed performance counter(s). For example, information may be collected from performance counters that triggered a PEBS event and / or from different counters (i.e., counters that did not trigger a PEBS event).

[0050] In various embodiments, the PEBS record may include additional PEBS data, omit the PEBS data mentioned above, and / or include PEBS data in different groups, formats, etc. In an embodiment, the PEBS facility may provide adaptive collection of PEBS data. For example, one or more PEBS records in an implementation may include a PEBS data set that is different from one or more other PEBS records in the same implementation. Any such PEBS data set may include some PEBS data collected by default and / or some PEBS data collected according to an optional configuration of the PEBS hardware (e.g., OS or other software).

[0051] For example, a basic information group (basic info 211) may be collected by default, and other data (such as memory info 212, GPR 213, XMM 214, LBR 215, PerfMon 216, etc.) may be collected when selected for collection. Embodiments may include one or more PEBS data configuration registers that are programmable so that software (e.g., and the OS) can specify or select what data is to be collected in a PEBS record, and / or the format of the PEBS record.

[0052] exist Figure 2 In the example of , PEBS data configuration MSR 200 may be a 64-bit register, wherein each of any one or more bit positions may correspond to a particular data group of PEBS record 210 , such that the value of each bit controls whether PEBS data for that group is to be collected.

[0053] For example, bit positions 0, 1, 2, and 3 may correspond to memory info 212, GPR 213, XMM 214, and LBR 215, respectively, such that if the value of bit position 0 is 1, memory information is collected; if the value of bit position 1 is 1, GPR status is collected; if the value of bit position 2 is 1, XMM status is collected; and if the value of bit position 3 is 1, LBR data is collected; and if the value of bit position 0 is 0, memory information is not collected; if the value of bit position 1 is 0, GPR status is not collected; if the value of bit position 2 is 0, XMM status is not collected; and if the value of bit position 3 is 0, LBR data is not collected.

[0054] Similarly, in some implementations, performance counter information may be collected by default, while in other implementations, performance counter information collection may be configurable. Embodiments may provide various levels, tiers, groupings, etc. of PEBS performance counter information collection configurability.

[0055] For example, a PEBS data configuration register (e.g., PEBS data configuration MSR 200) may include one or more bit positions (e.g., bits m:n, where each of bit positions m and n may be any bit position within the register, including different bit positions (i.e., representing bit fields) and the same bit position (i.e., representing a single bit position)) corresponding to a performance monitoring group (e.g., PerfMon216) in a PEBS record (e.g., PEBS record 210).

[0056] In an embodiment, a single bit position in a PEBS data configuration register may be used to enable PEBS collection of data from a set of performance counters. For example, if the value of the bit position is 1, data is collected from all counters in the set; and if the value of the bit position is 0, data is not collected from any counter in the set. In various embodiments, a set may include all performance counters in a processor, all enabled performance counters, all performance counters assigned to a VMM, all performance counters assigned to a VM or other tenant, all performance counters with counts above a threshold, etc., and the definition of a set, the specification of a set, and / or the assignment of counters to a set may be fixed or configurable (e.g., by software or firmware, or otherwise flexible). In an embodiment, the data collected from a set may include (and / or may be limited to) performance metrics derived from one or more performance counters.

[0057] In an embodiment, bits and / or bit field positions in a PEBS data configuration register may be used to enable PEBS collection of data from a set of performance counters. Each or any bit position in a bit field may correspond to a single performance counter (or a single performance metric), a subset of performance counters (and / or may include and / or be limited to one or more performance metrics derived from one or more counters in a subset), or an entire set of performance counters (and / or may include and / or be limited to one or more performance metrics derived from one or more counters in a set). In various embodiments, a set may include all performance counters in a processor, all enabled performance counters, all performance counters assigned to a VMM, all performance counters assigned to a VM or other tenant, all performance counters with counts above a threshold, etc., and / or a subset may be any group (including one or all counters) within a set (e.g., all performance counters assigned to a VMM, all performance counters assigned to a VM or other tenant, all fixed performance counters, all enabled general performance counters, etc.). In an embodiment, data collected from counter(s), subset(s), and / or set(s) may include performance metrics derived from one or more performance counters.

[0058] For example, if the value of the first bit position in the bit field is 1, data is collected from the (one or more) counters corresponding to the first bit position; if the value of the first bit position is 0, data is not collected from the (one or more) counters corresponding to the first bit position; if the value of the second bit position in the bit field is 1, data is collected from the (one or more) counters corresponding to the second bit position; if the value of the second bit position is 0, data is not collected from the (one or more) counters corresponding to the second bit position.

[0059] The definition of counters and / or metrics, the specification of counters and / or metrics, and / or the assignment of counters and / or metrics to sets and / or subsets may be fixed or configurable (e.g., by software or firmware, or otherwise flexible). The definition, specification, and / or assignment of the correspondence between bit(s) in the PEBS data configuration register and individual performance counters and / or metrics, subset(s) of performance counters and / or metrics, and / or sets of performance counters and / or metrics may be fixed or configurable (e.g., by software or firmware, or otherwise flexible).

[0060] Embodiments may provide a performance monitoring snapshot feature that is controlled by a first software (e.g., an OS, a VMM, a hypervisor, other system or privileged software) and is protected from the influence of a second software (e.g., application software, guest software operating on virtual software, tenant software operating in a container, etc.), for example, so that any one or more counters can be used in conjunction with the performance counter / metric feature and / or the PEBS feature, but the data from these one or more counters in conjunction with the performance monitoring snapshot feature may be hidden from the second software or may be unavailable to the second software.

[0061] In some embodiments, after programming the PEBS data configuration register(s), the PEBS handler circuit (e.g., as described below), when enabled, generates a PEBS record each time a performance counter enabled to trigger PEBS (e.g., based on the configuration of PEBS_ENABLE MSR 142, as described above) overflows. The PEBS record is intended to reflect the state of the processor at the time of the overflow, including the count of the performance counter.

[0062] Various embodiments may include PEBS handler circuitry or hardware for handling PEBS events and NPEBS events, PEBS handler circuitry or hardware for handling only PEBS events, PEBS handler circuitry or hardware for handling only PEBS events and separate NPEBS handler circuitry or hardware for handling only NPEBS events, etc. Thus, in the present description, PEBS handler circuitry or hardware (e.g., PEBS handler HW 140), PEBS registers (e.g., PEBS_ENABLE MSR 142 and PEBS_DATA_CFG MSR 144), PEBS records (e.g., PEBS record 210), etc. may represent PEBS features, NPEBS features, combined PEBS and NPEBS features, etc.

[0063] For example, the PEBS handler circuit and the NPEBS handler circuit may share some circuits and / or be implemented as a single combined handler circuit. The NPEBS handler circuit may use the resources of the PEBS handler circuit and differ from the PEBS handler circuit only in name. In an embodiment, when a PEBS enable or event select register is programmed with an imprecise event identifier, a corresponding performance counter may track the programmed imprecise event. In an embodiment, the NPEBS handler circuit may be coupled to a PEBS enable circuit, which is coupled to a performance counter, such that when the performance counter overflows, the PEBS enable circuit causes the NPEBS handler circuit to generate an NPEBS record of the imprecise event. Therefore, architectural metadata associated with imprecise events may be captured without the need for PMI.

[0064] In some embodiments, the NPEBS handler circuit controls the timing of generating NPEBS records for imprecise events. In an embodiment, the NPEBS record for an imprecise event may be generated immediately upon an overflow of a performance counter that tracks the imprecise event. In another embodiment, the NPEBS record for an imprecise event may be generated immediately after an overflow of a performance counter that tracks the imprecise event occurs (e.g., upon execution, completion, or retirement of the next subsequent instruction in the instruction trace or instruction stream that triggered the performance counter overflow).

[0065] The above-described techniques for avoiding the use of PMI to capture system architectural state associated with events have many advantages. One such advantage is that when interrupts are masked, such as in interrupt handling routines, context switches, locking algorithms, and other areas within privileged code (e.g., ring 0), the architectural state of storing events in memory storage in this manner is not suppressed. With the move toward SoCs (Silicon on a Chip), which require interrupts for interaction between processors (e.g., central processing units or CPUs) and intellectual property (IP) units, the amount of time for interrupt handling increases. If event-based sampling profiling is performed when interrupts are masked, the event-based sampling profiling may be inaccurate, resulting in the capture of incorrect instruction pointers. In an embodiment, when interrupts are masked, the details of placing events in the PEBS buffer are not suppressed, thereby avoiding the above-described disadvantages.

[0066] Another advantage of using the NPEBS handler circuit to generate NPEBS records of imprecise events is that detection is faster, resulting in higher accuracy. The processor state can be captured with a shorter latency to obtain the instruction pointer (and additional information about the architectural state) than the latency required for the interrupt handler to start the PMI. A further advantage is that the sampling overhead is lower. Interrupts can be the cause of performance interference with event-based sampling. Therefore, it is advantageous to reduce the number of interrupts used to obtain performance monitoring samples.

[0067] Some embodiments of the present disclosure are compact circuits and can therefore be implemented as part of various processing units without causing significant increases in cost and power consumption. Some embodiments of the present disclosure are programmable circuit logic and can be used to track and manage different types of precise and / or imprecise events on the same circuit logic. In an embodiment, the PEBS and / or NPEBS handler circuits can be scalable to track multiple processing units. In an embodiment, the PEBS and / or NPEBS handler circuits can be shared by multiple applications running on the same processor and managed as a shared resource by the OS, VMM or hypervisor.

[0068] In an embodiment, a PEBS handler circuit, NPEBS handler circuit, PEBS control circuit or logic, NPEBS circuit or logic, etc. may provide for reloading or resetting of one or more performance counters in conjunction with capturing a PEBS record (after recording data from (one or more) counters) so that data collected in subsequent PEBS records is accurate (e.g., not cumulative).

[0069] In an embodiment, existing PEBS handler circuitry, NPEBS handler circuitry, PEBS control circuitry or logic, NPEBS circuitry or logic, etc. may be reconfigured or modified so that reloading or resetting of performance counters (if any) is performed after data from the performance counters is captured in the PEBS records rather than before.

[0070] Figure 3 1 and 2. The method 300 for taking a snapshot of performance monitoring according to an embodiment is shown. The method 300 may be performed by, for example, Figure 1 The operation of a processor such as processor 100 in the embodiment of the present invention is performed and / or combined with the operation of a processor such as processor 100 in the embodiment of the present invention. Figure 1 The method 300 may be performed by the operation of a processor such as the processor 100 in the method; therefore, all or any part of the foregoing description of the processor 100 may be applicable to the method 300.

[0071] In 310, a processor having a set of fixed-function perfmon counters (e.g., FC0 to FC3) and / or a set of general-purpose perfmon counters (e.g., PMC0 to PMC7) may receive and / or store configurable / programmable settings and / or control indicators to enable and / or configure performance counters / metrics and / or PEBS features (e.g., by executing and / or responding to (one or more) WRMSR instructions issued by an OS, VMM, or other system software that set one or more bits in performance counter and / or PEBS control and / or configuration registers).

[0072] At 312, the processor may receive and / or store one or more setup and / or control indicators (e.g., bits in the PEBS_DATA_CFG MSR 144) to enable (e.g., set to 1) and / or configure aspects, capabilities, etc. of a performance monitoring snapshot feature (e.g., by executing and / or responding to WRMSR instruction(s) issued by an OS, VMM, or other system software that sets one or more bits in a PEBS control and / or configuration register). For example, a bit may be set to enable capture of performance metric data, a bit may be set to enable capture of data from a first subset of performance counters, a bit may be set to enable capture of data from a second subset of performance counters, a bit may be set to enable capture of data from a first individual performance counter, a bit may be set to enable capture of data from a second individual performance counter, and so on.

[0073] One or more actions, operations, etc. included in 310 and / or 312 and / or 314 may be performed in a different order and / or in parallel (eg, a single write to a configuration register).

[0074] At 320, one or more performance monitors / counters operate (e.g., count events) during execution of software (e.g., an application) by a processor. At 322, a PEBS event occurs. At 324, in response to the PEBS event, a PEBS record including a performance monitoring snapshot (e.g., counts of at least one or more performance counters that did not trigger a PEBS event and / or one or more counts and / or metrics derived from at least one or more performance counters that did not trigger a PEBS event) is generated (e.g., by PEBS circuitry / hardware in the processor) and stored (e.g., in a PEBS buffer in the processor) without interrupting execution of the software. At 326, the performance monitors / counters may be reloaded or reset (e.g., by PEBS circuitry / hardware in the processor). At 328, the software may continue to execute on the processor while the performance monitors / counters continue to operate.

[0075] During uninterrupted execution of the software, PEBS records may be generated, captured, stored, etc. by hardware. In other words, execution of the software may continue from 320 to 322, 324, 326, and 328 without interruption and / or transfer of control to other software (e.g., an interrupt handler or system software).

[0076] At 330, control of the processor (e.g., instruction flow) may be transferred to other software (e.g., an OS, VMM, or other system software). At 332, a PEBS record and / or data from a PEBS record may be provided (e.g., by executing and / or in response to read and / or move instructions issued by other software), including one or more counts and / or metrics derived from one or more performance counters that did not trigger a PEBS event and / or one or more performance counters that did not trigger a PEBS event.

[0077] In an embodiment (for example, based on PEBS architecture), circuits, hardware and / or logic may operate as represented by the following pseudo code:

[0078] According to some examples, a device includes: multiple performance monitoring hardware resources; hardware for capturing a record of status data related to the status of the device in conjunction with the occurrence of an event; and a storage device for storing a first indicator that corresponds to at least a first performance monitoring hardware resource among the multiple performance monitoring hardware resources and is used to enable the hardware to include performance data from the first performance monitoring hardware resource in the record.

[0079] According to some examples, a method includes: receiving, by a processor having multiple performance monitoring hardware resources, one or more settings to enable the hardware to capture a record of state data related to the state of the processor in conjunction with the occurrence of an event; receiving, by the processor, a first indicator corresponding to at least a first performance monitoring hardware resource among the multiple performance monitoring hardware resources, for enabling the hardware to include performance data from the first performance monitoring hardware resource in the record; and capturing the record in conjunction with the occurrence of an event during execution of first software by the processor, wherein the record includes performance data from the first performance monitoring hardware resource.

[0080] According to some examples, a system includes a system memory and a processor. The system memory is used to store first software. The processor includes: a plurality of performance monitoring hardware resources; hardware for capturing a record of state data related to a state of a device in conjunction with the occurrence of an event during uninterrupted execution of the first software; and a storage device for storing a first indicator corresponding to at least a first performance monitoring hardware resource of the plurality of performance monitoring hardware resources and for enabling the hardware to include performance data from the first performance monitoring hardware resource in the record.

[0081] Any such example may include any one of the following aspects or any combination thereof. The first performance monitoring hardware resource may be a first performance counter. The performance data from the first performance monitoring hardware resource may be a count from the first performance counter or based on a count from the first performance counter. The plurality of performance monitoring hardware resources may include a second performance monitoring hardware resource for triggering the capture of the record. The second performance monitoring hardware resource may be a second performance counter. The second performance counter may be used to trigger the capture of the record in response to an overflow of the second performance counter. The storage device may also be used to store a second indicator, which corresponds to at least the second performance counter and is used to enable the hardware to include performance data from the second performance counter in the record. The performance data from the second performance counter may be a count from the second performance counter or based on a count from the second performance counter. The record may include an identification of which of the plurality of performance monitoring hardware resources triggered the capture of the record. The identification may be captured in the record, regardless of the case of the first indicator or the case of the second indicator. The hardware may be used to capture the record during uninterrupted execution of the application. The apparatus may include a processing device for executing the application. The execution of the first software may not be interrupted by the capture of the record. The first performance monitoring hardware resource may be a first performance counter, and the performance data from the first performance monitoring hardware resource may be a count from the first performance counter or based on a count from the first performance counter. The plurality of performance monitoring hardware resources may include a second performance counter for triggering capture of a record in response to an overflow of a second performance counter. The method may further include receiving, by a processor, a second indicator corresponding to at least the second performance counter for enabling the hardware to include performance data from the second performance counter in the record. Regardless of the case of the first indicator or the case of the second indicator, the record may include an identification of which of the plurality of performance monitoring hardware resources triggered capture of the record. The system memory may also be used to store second software for reading the record.

[0082] According to some examples, a device may include means for performing any function disclosed herein; a device may include a data storage device storing code, which, when executed by a hardware processor or controller, causes the hardware processor or controller to perform any method or part of a method disclosed herein; the device, method, system, etc. may be as described in the detailed description; a non-transitory machine-readable medium may store instructions, which, when executed by a machine, causes the machine to perform any method or part of a method disclosed herein. Embodiments may include any details, features, etc. described in this specification or a combination of details, features, etc.

[0083] Example computer architecture.

[0084] The example computer architecture is described in detail below. Other system designs and configurations for laptops, desktop computers, handheld personal computers (personal computers, PCs), personal digital assistants, engineering workstations, servers, decomposed servers, network devices, network hubs, switches, routers, embedded processors, digital signal processors (digitalsignal processors, DSPs), graphics devices, video game devices, set-top boxes, microcontrollers, cellular phones, portable media players, handheld devices, and various other electronic devices known in the art are also appropriate. In a word, various systems or electronic devices that can include processors disclosed herein and / or other execution logics are generally appropriate.

[0085] Figure 4 An example computing system is illustrated. Multiprocessor system 400 is an interfaced system and includes multiple processors or cores, including a first processor 470 and a second processor 480 coupled via an interface 450 (e.g., a point-to-point (PP) interconnect, a fabric, and / or a bus). In some examples, first processor 470 and second processor 480 are isomorphic. In some examples, first processor 470 and second processor 480 are heterogeneous. Although example system 400 is shown as having two processors, the system may have three or more processors, or may be a single processor system. In some embodiments, the computing system is a system on chip (SoC).

[0086] Processors 470 and 480 are shown as including integrated memory controller (IMC) circuits 472 and 482, respectively. Processor 470 also includes interface circuits 476 and 478; similarly, second processor 480 includes interface circuits 486 and 488. Processors 470, 480 may exchange information via interface 450 using interface circuits 478, 488. IMCs 472 and 482 couple processors 470, 480 to respective memories, namely memory 432 and memory 434, which may be part of the main memory locally attached to the respective processors.

[0087] Processors 470, 480 can each utilize interface circuits 476, 494, 486, 498 to exchange information with a network interface (NW I / F) 490 via respective interfaces 452, 454. Network interface 490 (e.g., one or more of an interconnect, bus, and / or structure, a chipset in some examples) can optionally exchange information with a coprocessor 438 via interface circuit 492. In some examples, coprocessor 438 is a special-purpose processor, such as a high-throughput processor, a network or communication processor, a compression engine, a graphics processor, a general purpose graphics processing unit (GPGPU), a neural-network processing unit (NPU), an embedded processor, and the like.

[0088] A shared cache (not shown) may be included in either processor 470, 480, or external to both processors but connected to the processors via an interface (e.g., a PP interconnect) such that if a processor is placed in a low power mode, local cache information of either or both processors may also be stored in the shared cache.

[0089] The network interface 490 can be coupled to the first interface 416 via the interface circuit 496. In some examples, the first interface 416 can be an interface such as a Peripheral Component Interconnect (PCI) interconnect, a PCI Express interconnect, or another I / O interconnect. In some examples, the first interface 416 is coupled to a power control unit (PCU) 417, which can include circuits, software, and / or firmware to perform power management operations with respect to the processors 470, 480, and / or the coprocessor 438. The PCU 417 provides control information to a voltage regulator (not shown) so that the voltage regulator generates an appropriate regulated voltage. The PCU 417 also provides control information to control the generated operating voltage. In various examples, the PCU 417 can include various power management logic units (circuits) to perform hardware-based power management. Such power management may be entirely processor controlled (e.g., controlled by various processor hardware and may be triggered by workload and / or power constraints, thermal constraints, or other processor constraints), and / or power management may be performed in response to an external source (e.g., a platform or power management source or system software).

[0090] PCU 417 is illustrated as existing as logic separate from processor 470 and / or processor 480. In other cases, PCU 417 may execute on a given one or more cores of a core (not shown) of processor 470 or 480. In some cases, PCU 417 may be implemented as a microcontroller (dedicated or general purpose) or other control logic that is configured to execute its own dedicated power management code (sometimes referred to as P-code). In yet other examples, the power management operations to be performed by PCU 417 may be implemented outside the processor, such as by a separate power management integrated circuit (PMIC) or another component external to the processor. In yet other examples, the power management operations to be performed by PCU 417 may be implemented within BIOS or other system software.

[0091] Various I / O devices 414 and a bus bridge 418 can be coupled to the first interface 416, and the bus bridge 418 couples the first interface 416 to the second interface 420. In some examples, (one or more) additional processors 415 are coupled to the first interface 416, such as a coprocessor, a high-throughput integrated many core (MIC) processor, a GPGPU, an accelerator (such as a graphics accelerator or a digital signal processing (DSP) unit), a field programmable gate array (FPGA), or any other processor. In some examples, the second interface 420 can be a low pin count (LPC) interface. Various devices can be coupled to the second interface 420, including, for example, a keyboard and / or mouse 422, a communication device 427, and a storage circuit 428. The storage circuit 428 can be one or more non-transitory machine-readable storage media described below, such as a disk drive or other mass storage device, which may include instructions / codes and data 430. In addition, an audio I / O 424 can be coupled to the second interface 420. Note that other architectures are possible besides the point-to-point architecture described above. For example, a system such as multiprocessor system 400 may implement a multi-drop interface or other such architecture instead of a point-to-point architecture.

[0092] Example core architectures, processors, and computer architectures.

[0093] Processor cores can be implemented in different ways, for different purposes, and in different processors. For example, implementations of these cores may include: 1) general-purpose in-order cores for general-purpose computing purposes; 2) high-performance general-purpose out-of-order cores for general-purpose computing purposes; 3) special-purpose cores, mainly for graphics and / or scientific (throughput) computing purposes. Implementations of different processors may include: 1) a CPU including one or more general-purpose in-order cores for general-purpose computing purposes and / or one or more general-purpose out-of-order cores for general-purpose computing purposes; and 2) a coprocessor including one or more special-purpose cores mainly for graphics and / or scientific (throughput) computing purposes. These different processors result in different computer system architectures, which may include: 1) coprocessors on separate chips from the CPU; 2) coprocessors on separate dies in the same package as the CPU; 3) coprocessors on the same die as the CPU (in which case such coprocessors are sometimes referred to as dedicated logic, such as integrated graphics and / or scientific (throughput) logic, or as dedicated cores); and 4) systems on a chip (SoCs), which may include the described CPU (sometimes referred to as application core(s) or application processor(s), the coprocessors described above, and additional functionality on the same die. An example core architecture is described next, followed by a description of an example processor and computer architecture.

[0094] Figure 5 A block diagram of an example processor and / or SoC 500 is illustrated, which may have one or more cores and have an integrated memory controller. The processor 500 illustrated in solid line boxes has a single core 502(A), a system agent unit circuit 510, and a set of one or more interface controller unit circuits 516, while the optionally added dashed line boxes illustrate an alternative processor 500 as having multiple cores 502(A)-(N), a set of one or more integrated memory control unit circuits 514 in the system agent unit circuit 510, dedicated logic 508, and a set of one or more interface controller unit circuits 516. Note that the processor 500 may be Figure 4 One of the processors 470 or 480 or the coprocessors 438 or 415.

[0095] Thus, different implementations of processor 500 may include: 1) a CPU, where the dedicated logic 508 is integrated graphics and / or scientific (throughput) logic (which may include one or more cores, not shown), and cores 502(A)-(N) are one or more general purpose cores (e.g., general purpose in-order cores, general purpose out-of-order cores, or a combination of the two); 2) a coprocessor, where cores 502(A)-(N) are a large number of dedicated cores primarily for graphics and / or scientific (throughput) purposes; and 3) a coprocessor, where cores 502(A)-(N) are a large number of general purpose in-order cores. Thus, processor 500 may be a general purpose processor, a coprocessor, or a dedicated processor, such as a network or communication processor, a compression engine, a graphics processor, a GPGPU (general purpose graphics processing unit), a high throughput many integrated core (MIC) coprocessor (including 30 or more cores), an embedded processor, etc. The processor may be implemented on one or more chips. Processor 500 may be part of and / or may be implemented on one or more substrates using any of a variety of process technologies, such as complementary metal oxide semiconductor (CMOS), bipolar CMOS (BiCMOS), P-type metal oxide semiconductor (PMOS), or N-type metal oxide semiconductor (NMOS).

[0096] The memory hierarchy includes one or more levels of cache unit circuits 504(A)-(N) within the cores 502(A)-(N), a set of one or more shared cache unit circuits 506, and external memory (not shown) coupled to the set of integrated memory controller unit circuits 514. The set of one or more shared cache unit circuits 506 may include one or more intermediate level caches, such as level 2 (L2), level 3 (L3), level 4 (L4), or other levels of cache, such as last level cache (LLC), and / or combinations thereof. While in some examples an interface network circuit 512 (e.g., a ring interconnect) provides an interface to the dedicated logic 508 (e.g., integrated graphics logic), the set of shared cache unit circuits 506, and the system agent unit circuit 510, alternative examples use any number of well-known techniques to provide interfaces to these units. In some examples, coherency is maintained between one or more circuits in the shared cache unit circuits 506 and the cores 502(A)-(N). In some examples, interface controller unit circuitry 516 couples the cores 502 to one or more other devices 518 , such as one or more I / O devices, storage, one or more communication devices (e.g., wireless network, wired network, etc.), and the like.

[0097] In some examples, one or more of the cores 502(A)-(N) have multi-threading capabilities. System agent unit circuitry 510 includes those components that coordinate and operate the cores 502(A)-(N). System agent unit circuitry 510 may include, for example, power control unit (PCU) circuitry and / or display unit circuitry (not shown). The PCU may be (or may include) logic and components required to regulate the power state of the cores 502(A)-(N) and / or the dedicated logic 508 (e.g., integrated graphics logic). The display unit circuitry is used to drive one or more externally connected displays.

[0098] The cores 502(A)-(N) may be homogeneous with respect to instruction set architecture (ISA). Alternatively, the cores 502(A)-(N) may be heterogeneous with respect to ISA; that is, a subset of the cores 502(A)-(N) may be capable of executing one ISA, while other cores may be capable of executing only a subset of the ISA or may be capable of executing another ISA.

[0099] Example core architectures—in-order and out-of-order core block diagrams.

[0100] The block diagram of FIG. 6(A) illustrates both an example in-order pipeline and an example register renaming, out-of-order issue / execution pipeline according to some examples. The block diagram of FIG. 6(B) illustrates both an example in-order architecture core and an example register renaming, out-of-order issue / execution architecture core to be included in a processor according to an example. The solid line boxes in FIG. 6(A)-(B) illustrate the in-order pipeline and the in-order core, while the optionally added dashed line boxes illustrate the register renaming, out-of-order issue / execution pipeline and core. Considering that the in-order aspect is a subset of the out-of-order aspect, the out-of-order aspect will be described.

[0101] In FIG. 6(A), the processor pipeline 600 includes a fetch stage 602, an optional length decoding stage 604, a decode stage 606, an optional allocation (Alloc) stage 608, an optional rename stage 610, a dispatch (also called dispatch or issue) stage 612, an optional register read / memory read stage 614, an execute stage 616, a write back / memory write stage 618, an optional exception handling stage 622, and an optional commit stage 624. One or more operations may be performed in each of these processor pipeline stages. For example, during the fetch stage 602, one or more instructions are fetched from the instruction memory, and during the decode stage 606, the fetched one or more instructions may be decoded, an address using a forwarding register port (e.g., a load store unit (LSU) address) may be generated, and branch forwarding (e.g., an immediate offset or a link register (LR)) may be performed. In one example, the decode stage 606 and the register read / memory read stage 614 may be combined into one pipeline stage. In one example, during the execution stage 616, decoded instructions may be executed, LSU address / data pipelining to an Advanced Microcontroller Bus (AMB) interface may be performed, multiplication and addition operations may be performed, arithmetic operations with branch results may be performed, and the like.

[0102] As an example, the example register renaming, out-of-order issue / execution architecture core of FIG. 6(B) may implement pipeline 600 in the following manner: 1) instruction fetch circuit 638 performs fetch and length decode stages 602 and 604; 2) decode circuit 640 performs decode stage 606; 3) rename / allocator unit circuit 652 performs allocation stage 608 and rename stage 610; 4) (one or more) scheduler circuit 656 performs scheduling stage 612; 5) (one or more) physical register file circuit 658 and memory unit circuit 670 perform register read / memory read stage 614; (one or more) execution cluster 660 performs execution stage 616; 6) memory unit circuit 670 and (one or more) physical register file circuit 658 perform write back / memory write stage 618; 7) various circuits may be involved in exception handling stage 622; and 8) retirement unit circuit 654 and (one or more) physical register file circuit 658 perform commit stage 624.

[0103] 6(B) shows that the processor core 690 includes a front end unit circuit 630 coupled to an execution engine unit circuit 650, and both are coupled to a memory unit circuit 670. The core 690 can be a reduced instruction set architecture computing (RISC) core, a complex instruction set architecture computing (CISC) core, a very long instruction word (VLIW) core, or a hybrid or alternative core type. As another option, the core 690 can be a special-purpose core, such as a network or communication core, a compression engine, a coprocessor core, a general purpose computing graphics processing unit (GPGPU) core, a graphics core, and the like.

[0104] The front end unit circuit 630 may include a branch prediction circuit 632 coupled to an instruction cache circuit 634 coupled to an instruction translation lookaside buffer (TLB) 636 coupled to an instruction fetch circuit 638 coupled to a decode circuit 640. In one example, the instruction cache circuit 634 is included in the memory unit circuit 670 instead of the front end circuit 630. The decode circuit 640 (or decoder) may decode the instruction and generate one or more micro-operations, microcode entry points, micro-instructions, other instructions, or other control signals as outputs, which are decoded from the original instruction, or otherwise reflect the original instruction, or are derived from the original instruction. The decode circuit 640 may also include an address generation unit (AGU, not shown) circuit. In one example, the AGU generates an LSU address using the forwarded register port, and may further perform branch forwarding (e.g., immediate offset branch forwarding, LR register branch forwarding, etc.). The decode circuit 640 may be implemented using a variety of different mechanisms. Examples of suitable mechanisms include, but are not limited to, lookup tables, hardware implementations, programmable logic arrays (PLA), microcode read only memories (ROMs), and the like. In one example, the core 690 includes a microcode ROM (not shown) or other medium that stores microcode for certain macroinstructions (e.g., in the decode circuit 640 or otherwise within the front end circuit 630). In one example, the decode circuit 640 includes a micro-op or operation cache (not shown) to save / cache decoded operations, micro-flags, or micro-ops generated during decoding or other stages of the processor pipeline 600. The decode circuit 640 may be coupled to a rename / allocator unit circuit 652 in the execution engine circuit 650.

[0105] The execution engine circuit 650 includes a rename / allocator unit circuit 652, which is coupled to a retirement unit circuit 654 and a set of one or more scheduler circuits 656. The scheduler circuit 656 represents any number of different schedulers, including reservation stations, central instruction windows, and the like. In some examples, the scheduler circuit(s) 656 may include an arithmetic logic unit (ALU) scheduler / scheduling circuit, an ALU queue, an address generation unit (AGU) scheduler / scheduling circuit, an AGU queue, and the like. The scheduler circuit(s) 656 are coupled to physical register file(s) circuit(s) 658. Each of the physical register file(s) circuit(s) 658 represents one or more physical register files, different ones of which store one or more different data types, such as scalar integers, scalar floating points, packed integers, packed floating points, vector integers, vector floating points, status (e.g., instruction pointers, i.e., the address of the next instruction to be executed), and the like. In one example, the (one or more) physical register file circuits 658 include vector register unit circuits, write mask register unit circuits, and scalar register unit circuits. These register units can provide architectural vector registers, vector mask registers, general registers, etc. The (one or more) physical register file circuits 658 are coupled to the retirement unit circuits 654 (also called retirement queues) to demonstrate various ways that register renaming and out-of-order execution can be implemented (e.g., using (one or more) reorder buffers (ROBs) and (one or more) retirement register files; using (one or more) future stacks, (one or more) history buffers, and (one or more) retirement register files; using register maps and pools of registers; etc.). The retirement unit circuits 654 and (one or more) physical register file circuits 658 are coupled to (one or more) execution clusters 660. The (one or more) execution clusters 660 include a set of one or more execution unit circuits 662 and a set of one or more memory access circuits 664. The execution unit circuit(s) 662 may perform various arithmetic, logical, floating point, or other types of operations (e.g., shifts, additions, subtractions, multiplications) on various types of data (e.g., scalar integer, scalar floating point, packed integer, packed floating point, vector integer, vector floating point). While some examples may include several execution units or execution unit circuits dedicated to a particular function or set of functions, other examples may include only one execution unit circuit or multiple execution units / execution unit circuits that all perform all functions.Scheduler circuit(s) 656, physical register file circuit(s) 658, and execution cluster(s) 660 are shown as possibly multiple because some examples create separate pipelines for certain types of data / operations (e.g., scalar integer pipeline, scalar floating point / packed integer / packed floating point / vector integer / vector floating point pipeline, and / or memory access pipeline, each with its own scheduler circuit, physical register file circuit(s), and / or execution cluster—and in the case of a separate memory access pipeline, only the execution cluster of that pipeline has memory access unit circuit(s) 664 in some examples of the implementation). It should also be understood that where separate pipelines are used, one or more of these pipelines may be out-of-order issue / execution, while the rest are in-order.

[0106] In some examples, the execution engine unit circuit 650 may perform load store unit (LSU) address / data pipelining to an advanced microcontroller bus (AMB) interface (not shown), as well as address stage and writeback, data stage loads, stores, and branches.

[0107] A set of memory access circuits 664 are coupled to the memory cell circuit 670, which includes a data TLB circuit 672, which is coupled to a data cache circuit 674, which is coupled to a level 2 (L2) cache circuit 676. In one example, the memory access circuit 664 may include a load unit circuit, a storage address unit circuit, and a storage data unit circuit, each of which is coupled to the data TLB circuit 672 in the memory cell circuit 670. The instruction cache circuit 634 is further coupled to the level 2 (L2) cache circuit 676 in the memory cell circuit 670. In one example, the instruction cache 634 and the data cache 674 are combined into a single instruction and data cache in the L2 cache circuit 676, a level 3 (L3) cache circuit (not shown), and / or a main memory (not shown). The L2 cache circuit 676 is coupled to one or more other levels of cache and ultimately to the main memory.

[0108] Core 690 may support one or more instruction sets (e.g., x86 instruction set architecture (optionally with some extensions that have been added with newer versions); MIPS instruction set architecture; ARM instruction set architecture (optionally with optional additional extensions, such as NEON)) that include the instruction(s) described herein. In one example, core 690 includes logic to support packed data instruction set architecture extensions (e.g., AVX1, AVX2), allowing operations used by many multimedia applications to be performed using packed data.

[0109] Example execution unit circuit.

[0110] Figure 7 An example of (one or more) execution unit circuits is illustrated, such as (one or more) execution unit circuits 662 of FIG. 6 (B). As shown, (one or more) execution unit circuits 662 may include one or more ALU circuits 701, optional vector / single instruction multiple data (single instruction multiple data, SIMD) circuits 703, load / store circuits 705, branch / jump circuits 707, and / or floating-point unit (FPU) circuits 709. ALU circuits 701 perform integer arithmetic and / or Boolean operations. Vector / SIMD circuits 703 perform vector / SIMD operations on packed data (e.g., SIMD / vector registers). Load / store circuits 705 execute load and store instructions to load data from memory into registers, or store data from registers to memory. Load / store circuits 705 may also generate addresses. Branch / jump circuits 707 cause branches or jumps to a certain memory address depending on the instruction. FPU circuits 709 perform floating-point arithmetic. The width of the execution unit circuit(s) 662 varies depending on the example and may range, for example, from 16 bits to 1024 bits. In some examples, two or more smaller execution units are logically combined to form a larger execution unit (e.g., two 128-bit execution units are logically combined to form a 256-bit execution unit).

[0111] Program code can be applied to input information to perform the functions described herein and generate output information. The output information can be applied to one or more output devices in a known manner. For the present application, the processing system includes any system having a processor, such as a digital signal processor (DSP), a microcontroller, an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), a microprocessor, or any combination thereof.

[0112] Program code can be implemented in a process-oriented or object-oriented high-level programming language to communicate with the processing system. If desired, program code can also be implemented in assembly or machine language. In fact, the mechanism described herein is not limited to any specific programming language in scope. In any case, the language can be a compiled language or an interpreted language.

[0113] Examples of the mechanisms disclosed herein can be implemented in hardware, software, firmware, or a combination of these implementation approaches. Examples can be implemented as computer programs or program codes, executed on a programmable system including at least one processor, a storage system (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device.

[0114] One or more aspects of at least one example can be implemented by representative instructions stored on a machine-readable medium, which represent various logics within a processor, and when these instructions are read by a machine, the machine makes logic for performing the technology described herein. These representations are called "intellectual property (IP) cores" and can be stored on a tangible machine-readable medium and provided to various customers or manufacturing facilities to be loaded into a manufacturing machine that makes the logic or processor.

[0115] These machine-readable storage media may include, but are not limited to, non-transitory tangible arrangements of items manufactured or formed by a machine or device, including storage media such as: hard disks, any other type of disk (including floppy disks, optical disks, compact disk read-only memory (CD-ROM), compact disk rewritable (CD-RW), and magneto-optical disks), semiconductor devices (e.g., read-only memory (ROM), random access memory (RAM) such as dynamic random access memory (DRAM), static random access memory (SRAM), erasable programmable read-only memory (EPROM), flash memory, electrically erasable programmable read-only memory (EEPROM), phase change memory (PCM)), magnetic cards or optical cards, or any other type of medium suitable for storing electronic instructions.

[0116] Therefore, examples also include non-transitory tangible machine-readable media containing instructions or design data, such as hardware description languages ​​(HDL), that define the structures, circuits, devices, processors and / or system features described herein. Such examples may also be referred to as program products.

[0117] Emulation (including binary translation, code deformation, etc.).

[0118] In some cases, the instruction converter can be used to convert instructions from a source instruction set architecture to a target instruction set architecture. For example, the instruction converter can translate (e.g., using static binary translation, dynamic binary translation including dynamic compilation), deform, simulate or otherwise convert instructions to one or more other instructions to be processed by the core. The instruction converter can be implemented with software, hardware, firmware or a combination thereof. The instruction converter can be on the processor, outside the processor, or partly on the processor and partly outside the processor.

[0119] Figure 8 The block diagram of illustrates the use of a software instruction converter according to an example, which is used to convert binary instructions in a source ISA into binary instructions in a target ISA. In the illustrated example, the instruction converter is a software instruction converter, but alternatively, the instruction converter can be implemented in software, firmware, hardware, or various combinations thereof. Figure 8 It is shown that a program in a high-level language 802 may be compiled using a first ISA compiler 804 to generate first ISA binary code 806 that may be natively executed by a processor having at least one first ISA core 816. The processor having at least one first ISA core 816 represents any processor that is capable of executing or otherwise processing (1) a substantial portion of the first ISA or (2) a program that is natively executed by a processor having at least one first ISA core. The first ISA compiler 804 represents a compiler operable to generate first ISA binary code 806 (e.g., object code) that can be executed on a processor 816 having at least one first ISA core with or without additional linking processing. Similarly, Figure 8It is shown that the program of high-level language 802 can be compiled using alternative ISA compiler 808 to generate alternative ISA binary code 810, which can be executed natively by a processor 814 without a first ISA core. Instruction converter 812 is used to convert the first ISA binary code 806 into code that can be executed natively by a processor 814 without a first ISA core. This converted code will not necessarily be the same as the alternative ISA binary code 810; however, the converted code will implement the overall operation and be composed of instructions from the alternative ISA. Thus, instruction converter 812 represents software, firmware, hardware, or a combination thereof, which allows a processor or other electronic device without a first ISA processor or core to execute the first ISA binary code 806 through simulation, emulation, or any other process.

[0120] References to "an example," "an example," "an embodiment," "an embodiment," etc. indicate that the described example or embodiment may include a particular feature, structure, or characteristic, but not every example or embodiment may include the particular feature, structure, or characteristic. Furthermore, such phrases do not necessarily refer to the same example or embodiment. In addition, when a particular feature, structure, or characteristic is described in conjunction with an example or embodiment, it should be considered that it is within the knowledge of those skilled in the art to implement such feature, structure, or characteristic in conjunction with other examples or embodiments (whether or not explicitly described).

[0121] In addition, in the examples described above, unless otherwise specifically noted, delimited language such as phrases "at least one of A, B, or C" or "A, B, and / or C" is intended to be understood to mean A, B, or C, or any combination thereof (i.e., A and B, A and C, B and C, and A, B, and C). As used in this specification and claims, and unless otherwise specified, the use of ordinal adjectives "first," "second," "third," etc., used to describe elements merely indicates that a specific instance of an element or different instances of similar elements are being referenced, and is not intended to imply that the elements so described must be in a particular order in time, space, hierarchically, or in any other manner. In addition, as used in the description of the embodiments, the " / " character between items may mean that what is described may include the first item and / or the second item (and / or any other additional items), or may be implemented using, utilizing, and / or according to the first item and / or the second item (and / or any other additional items).

[0122] In addition, the terms "bit", "flag", "field", "entry", "indicator", etc. may be used to describe a storage location in a register, table, database, or other data structure of any type or content, whether implemented in hardware or software, and these terms are not intended to limit the embodiments to any particular type of storage location or the number of bits or other elements within any particular storage location. For example, the term "bit" may be used to refer to a bit position within a register and / or data stored or to be stored in the bit position. The term "clear" may be used to indicate storing a logic value of 0 in a storage location, or otherwise causing a logic value of 0 to be stored in a storage location; and the term "set" may be used to indicate storing a logic value of 1, all 1s, or some other specified value in a storage location, or otherwise causing a logic value of 1, all 1s, or some other specified value to be stored in a storage location; however, these terms are not intended to limit the embodiments to any particular logical convention, as any logical convention may be used within the embodiments.

[0123] Accordingly, the specification and drawings are to be regarded in an illustrative rather than a restrictive sense. It will, however, be evident that various modifications and changes may be made thereto without departing from the broader spirit and scope of the disclosure as set forth in the claims.

Claims

1. An apparatus for taking a snapshot of performance monitoring, comprising: Multiple performance monitoring hardware resources; hardware for capturing a record of state data relating to a state of the device in conjunction with the occurrence of an event; as well as A storage device is used to store a first indicator, the first indicator corresponding to at least a first performance monitoring hardware resource of the plurality of performance monitoring hardware resources and used to enable the hardware to include performance data from the first performance monitoring hardware resource in the record.

2. The device according to claim 1, wherein: The first performance monitoring hardware resource is a first performance counter.

3. The device as claimed in claim 2, wherein: The performance data from the first performance monitoring hardware resource is or is based on counts from the first performance counter.

4. The device according to claim 3, wherein: The plurality of performance monitoring hardware resources includes a second performance monitoring hardware resource for triggering capture of the record.

5. The device according to claim 4, wherein: The second performance monitoring hardware resource is a second performance counter.

6. The device according to claim 5, wherein: The second performance counter is used to trigger the capture of the record in response to an overflow of the second performance counter.

7. The device according to claim 6, wherein: The storage device is also used to store a second indicator, which corresponds to at least the second performance counter and is used to enable the hardware to include performance data from the second performance counter in the record.

8. The device according to claim 7, wherein: The performance data from the second performance counter is or is based on a count from the second performance counter.

9. The device of claim 8, wherein: The record includes an identification of which of the plurality of performance monitoring hardware resources triggered capture of the record.

10. The device of claim 9, wherein: The identification is captured in the record, whether in the case of the first indicator or the second indicator.

11. The device of claim 1, wherein: The hardware is used to capture the record during uninterrupted execution of the application program.

12. The device of claim 11, wherein: The apparatus comprises a processing device for executing the application.

13. A method for taking a snapshot of performance monitoring, comprising: receiving, by a processor having a plurality of performance monitoring hardware resources, one or more settings to enable the hardware to capture a record of state data related to a state of the processor in conjunction with an occurrence of an event; receiving, by the processor, a first indicator corresponding to at least a first performance monitoring hardware resource of the plurality of performance monitoring hardware resources for enabling the hardware to include performance data from the first performance monitoring hardware resource in the record; as well as The record is captured in conjunction with an occurrence of the event during execution of first software by the processor, wherein the record includes performance data from the first performance monitoring hardware resource.

14. The method of claim 13, wherein: The execution of the first software is not captured by the recording interruption.

15. The method of claim 13, wherein: The first performance monitoring hardware resource is a first performance counter, and the performance data from the first performance monitoring hardware resource is or is based on counts from the first performance counter.

16. The method of claim 15, wherein: The plurality of performance monitoring hardware resources includes a second performance counter for triggering capture of the record in response to an overflow of the second performance counter.

17. The method of claim 16, further comprising: A second indicator is received by the processor, the second indicator corresponding to at least the second performance counter for enabling the hardware to include performance data from the second performance counter in the record.

18. The method of claim 17, wherein: In either case of the first indicator or the second indicator, the record includes an identification of which of the plurality of performance monitoring hardware resources triggered the capture of the record.

19. A system for taking snapshots of performance monitoring, comprising: A system memory, used for storing the first software; as well as Processor, including: Multiple performance monitoring hardware resources; hardware for capturing a record of state data relating to a state of the processor in conjunction with the occurrence of an event during uninterrupted execution of the first software; and A storage device is used to store a first indicator, the first indicator corresponding to at least a first performance monitoring hardware resource of the plurality of performance monitoring hardware resources and used to enable the hardware to include performance data from the first performance monitoring hardware resource in the record.

20. The system of claim 19, wherein: The system memory is further used to store second software for reading the record.