Blame SOURCES/oprofile-skylake.patch

d5df0a
From 917dfab881becfad104ad02682a88afb54284932 Mon Sep 17 00:00:00 2001
d5df0a
From: Andi Kleen <ak@linux.intel.com>
d5df0a
Date: Wed, 1 Jul 2015 14:36:42 -0700
d5df0a
Subject: [PATCH 1/3] Add support for Intel Skylake events
d5df0a
d5df0a
Add support for the Intel Skylake micro architecture to oprofile.
d5df0a
d5df0a
OFFCORE_* and FRONTEND_* events are not supported for now because
d5df0a
oprofile does not support setting up config1
d5df0a
d5df0a
Signed-off-by: Andi Kleen <ak@linux.intel.com>
d5df0a
---
d5df0a
 events/Makefile.am             |   1 +
d5df0a
 events/i386/skylake/events     |  62 ++++++++
d5df0a
 events/i386/skylake/unit_masks | 314 +++++++++++++++++++++++++++++++++++++++++
d5df0a
 libop/op_cpu_type.c            |   2 +
d5df0a
 libop/op_cpu_type.h            |   1 +
d5df0a
 libop/op_events.c              |   1 +
d5df0a
 libop/op_hw_specific.h         |   3 +
d5df0a
 utils/ophelp.c                 |   1 +
d5df0a
 8 files changed, 385 insertions(+)
d5df0a
 create mode 100644 events/i386/skylake/events
d5df0a
 create mode 100644 events/i386/skylake/unit_masks
d5df0a
d5df0a
diff --git a/events/Makefile.am b/events/Makefile.am
d5df0a
index d68f0e8..56f9020 100644
d5df0a
--- a/events/Makefile.am
d5df0a
+++ b/events/Makefile.am
d5df0a
@@ -18,6 +18,7 @@ event_files = \
d5df0a
 	i386/ivybridge/events i386/ivybridge/unit_masks \
d5df0a
 	i386/haswell/events i386/haswell/unit_masks \
d5df0a
 	i386/broadwell/events i386/broadwell/unit_masks \
d5df0a
+	i386/skylake/events i386/skylake/unit_masks \
d5df0a
 	i386/silvermont/events i386/silvermont/unit_masks \
d5df0a
 	ia64/ia64/events ia64/ia64/unit_masks \
d5df0a
 	ia64/itanium2/events ia64/itanium2/unit_masks \
d5df0a
diff --git a/events/i386/skylake/events b/events/i386/skylake/events
d5df0a
new file mode 100644
d5df0a
index 0000000..28d6654
d5df0a
--- /dev/null
d5df0a
+++ b/events/i386/skylake/events
d5df0a
@@ -0,0 +1,62 @@
d5df0a
+#
d5df0a
+# Intel "Skylake" microarchitecture core events.
d5df0a
+#
d5df0a
+# See http://ark.intel.com/ for help in identifying Skylake based CPUs
d5df0a
+#
d5df0a
+# Note the minimum counts are not discovered experimentally and could be likely
d5df0a
+# lowered in many cases without ill effect.
d5df0a
+#
d5df0a
+event:0x00 counters:1 um:inst_retired minimum:2000003 name:inst_retired :
d5df0a
+event:0x00 counters:cpuid um:cpu_clk_unhalted minimum:2000003 name:cpu_clk_unhalted :
d5df0a
+event:0x03 counters:cpuid um:ld_blocks minimum:100003 name:ld_blocks :
d5df0a
+event:0x07 counters:cpuid um:ld_blocks_partial minimum:100003 name:ld_blocks_partial_address_alias :
d5df0a
+event:0x08 counters:cpuid um:dtlb_load_misses minimum:2000003 name:dtlb_load_misses :
d5df0a
+event:0x0d counters:cpuid um:int_misc minimum:2000003 name:int_misc :
d5df0a
+event:0x0e counters:cpuid um:uops_issued minimum:2000003 name:uops_issued :
d5df0a
+event:0x14 counters:cpuid um:arith minimum:2000003 name:arith_divider_active :
d5df0a
+event:0x24 counters:cpuid um:l2_rqsts minimum:200003 name:l2_rqsts :
d5df0a
+event:0x2e counters:cpuid um:longest_lat_cache minimum:100003 name:longest_lat_cache :
d5df0a
+event:0x3c counters:cpuid um:cpu_clk_thread_unhalted minimum:2000003 name:cpu_clk_thread_unhalted :
d5df0a
+event:0x48 counters:cpuid um:l1d_pend_miss minimum:2000003 name:l1d_pend_miss :
d5df0a
+event:0x49 counters:cpuid um:dtlb_store_misses minimum:2000003 name:dtlb_store_misses :
d5df0a
+event:0x4c counters:cpuid um:load_hit_pre minimum:100003 name:load_hit_pre_sw_pf :
d5df0a
+event:0x4f counters:cpuid um:ept minimum:2000003 name:ept_walk_pending :
d5df0a
+event:0x51 counters:cpuid um:l1d minimum:2000003 name:l1d_replacement :
d5df0a
+event:0x54 counters:cpuid um:tx_mem minimum:2000003 name:tx_mem :
d5df0a
+event:0x5d counters:cpuid um:tx_exec minimum:2000003 name:tx_exec :
d5df0a
+event:0x5e counters:cpuid um:rs_events minimum:2000003 name:rs_events :
d5df0a
+event:0x60 counters:cpuid um:offcore_requests_outstanding minimum:2000003 name:offcore_requests_outstanding :
d5df0a
+event:0x63 counters:cpuid um:lock_cycles minimum:2000003 name:lock_cycles_cache_lock_duration :
d5df0a
+event:0x79 counters:cpuid um:idq minimum:2000003 name:idq :
d5df0a
+event:0x80 counters:cpuid um:icache_16b minimum:2000003 name:icache_16b_ifdata_stall :
d5df0a
+event:0x83 counters:cpuid um:icache_64b minimum:200003 name:icache_64b :
d5df0a
+event:0x85 counters:cpuid um:itlb_misses minimum:100003 name:itlb_misses :
d5df0a
+event:0x87 counters:cpuid um:ild_stall minimum:2000003 name:ild_stall_lcp :
d5df0a
+event:0x9c counters:cpuid um:idq_uops_not_delivered minimum:2000003 name:idq_uops_not_delivered :
d5df0a
+event:0xa1 counters:cpuid um:uops_dispatched_port minimum:2000003 name:uops_dispatched_port :
d5df0a
+event:0xa2 counters:cpuid um:resource_stalls minimum:2000003 name:resource_stalls :
d5df0a
+event:0xa3 counters:cpuid um:cycle_activity minimum:2000003 name:cycle_activity :
d5df0a
+event:0xa6 counters:cpuid um:exe_activity minimum:2000003 name:exe_activity :
d5df0a
+event:0xa8 counters:cpuid um:lsd minimum:2000003 name:lsd :
d5df0a
+event:0xab counters:cpuid um:dsb2mite_switches minimum:2000003 name:dsb2mite_switches_penalty_cycles :
d5df0a
+event:0xae counters:cpuid um:itlb minimum:100007 name:itlb_itlb_flush :
d5df0a
+event:0xb0 counters:cpuid um:offcore_requests minimum:100003 name:offcore_requests :
d5df0a
+event:0xb1 counters:cpuid um:uops_executed minimum:2000003 name:uops_executed :
d5df0a
+event:0xb2 counters:cpuid um:offcore_requests_buffer minimum:2000003 name:offcore_requests_buffer_sq_full :
d5df0a
+event:0xbd counters:cpuid um:tlb_flush minimum:100007 name:tlb_flush :
d5df0a
+event:0xc1 counters:cpuid um:other_assists minimum:100003 name:other_assists_any :
d5df0a
+event:0xc2 counters:cpuid um:uops_retired minimum:2000003 name:uops_retired :
d5df0a
+event:0xc3 counters:cpuid um:machine_clears minimum:100003 name:machine_clears :
d5df0a
+event:0xc4 counters:cpuid um:br_inst_retired minimum:400009 name:br_inst_retired :
d5df0a
+event:0xc5 counters:cpuid um:br_misp_retired minimum:400009 name:br_misp_retired :
d5df0a
+event:0xc7 counters:cpuid um:fp_arith_inst_retired minimum:2000003 name:fp_arith_inst_retired :
d5df0a
+event:0xc8 counters:cpuid um:hle_retired minimum:2000003 name:hle_retired :
d5df0a
+event:0xc9 counters:cpuid um:rtm_retired minimum:2000003 name:rtm_retired :
d5df0a
+event:0xca counters:cpuid um:fp_assist minimum:100003 name:fp_assist_any :
d5df0a
+event:0xcb counters:cpuid um:hw_interrupts minimum:100003 name:hw_interrupts_received :
d5df0a
+event:0xd0 counters:0,1,2,3 um:mem_inst_retired minimum:2000003 name:mem_inst_retired :
d5df0a
+event:0xd1 counters:0,1,2,3 um:mem_load_retired minimum:2000003 name:mem_load_retired :
d5df0a
+event:0xd2 counters:0,1,2,3 um:mem_load_l3_hit_retired minimum:100003 name:mem_load_l3_hit_retired :
d5df0a
+event:0xe6 counters:cpuid um:baclears minimum:100003 name:baclears_any :
d5df0a
+event:0xf0 counters:cpuid um:l2_trans minimum:200003 name:l2_trans_l2_wb :
d5df0a
+event:0xf1 counters:cpuid um:l2_lines_in minimum:100003 name:l2_lines_in_all :
d5df0a
diff --git a/events/i386/skylake/unit_masks b/events/i386/skylake/unit_masks
d5df0a
new file mode 100644
d5df0a
index 0000000..98ed65c
d5df0a
--- /dev/null
d5df0a
+++ b/events/i386/skylake/unit_masks
d5df0a
@@ -0,0 +1,314 @@
d5df0a
+#
d5df0a
+# Unit masks for the Intel "Skylake" micro architecture
d5df0a
+#
d5df0a
+# See http://ark.intel.com/ for help in identifying Skylake based CPUs
d5df0a
+#
d5df0a
+name:arith type:mandatory default:0x1
d5df0a
+	0x1 extra:cmask=1,edge divider_active Cycles when divide unit is busy executing divide or square root operations. Accounts for integer and floating-point operations.
d5df0a
+name:baclears type:mandatory default:0x1
d5df0a
+	0x1 extra: any Counts the total number when the front end is resteered, mainly when the BPU cannot provide a correct prediction and this is corrected by other branch handling mechanisms at the front end.
d5df0a
+name:dsb2mite_switches type:mandatory default:0x2
d5df0a
+	0x2 extra: penalty_cycles Decode Stream Buffer (DSB)-to-MITE switch true penalty cycles.
d5df0a
+name:ept type:mandatory default:0x10
d5df0a
+	0x10 extra: walk_pending Counts 1 per cycle for each PMH that is busy with a EPT (Extended Page Table) walk for any request type.
d5df0a
+name:fp_assist type:mandatory default:0x1e
d5df0a
+	0x1e extra:cmask=1 any Cycles with any input/output SSE or FP assist
d5df0a
+name:hw_interrupts type:mandatory default:0x1
d5df0a
+	0x1 extra: received Number of hardware interrupts received by the processor.
d5df0a
+name:icache_16b type:mandatory default:0x4
d5df0a
+	0x4 extra: ifdata_stall Cycles where a code fetch is stalled due to L1 instruction cache miss.
d5df0a
+name:ild_stall type:mandatory default:0x1
d5df0a
+	0x1 extra: lcp Stalls caused by changing prefix length of the instruction.
d5df0a
+name:itlb type:mandatory default:0x1
d5df0a
+	0x1 extra: itlb_flush Flushing of the Instruction TLB (ITLB) pages, includes 4k/2M/4M pages.
d5df0a
+name:l1d type:mandatory default:0x1
d5df0a
+	0x1 extra: replacement L1D data line replacements
d5df0a
+name:l2_lines_in type:mandatory default:0x7
d5df0a
+	0x7 extra: all L2 cache lines filling L2
d5df0a
+name:l2_trans type:mandatory default:0x40
d5df0a
+	0x40 extra: l2_wb L2 writebacks that access L2 cache
d5df0a
+name:ld_blocks_partial type:mandatory default:0x1
d5df0a
+	0x1 extra: address_alias False dependencies in MOB due to partial compare on address.
d5df0a
+name:load_hit_pre type:mandatory default:0x1
d5df0a
+	0x1 extra: sw_pf Demand load dispatches that hit L1D fill buffer (FB) allocated for software prefetch.
d5df0a
+name:lock_cycles type:mandatory default:0x2
d5df0a
+	0x2 extra: cache_lock_duration Cycles when L1D is locked
d5df0a
+name:offcore_requests_buffer type:mandatory default:0x1
d5df0a
+	0x1 extra: sq_full Offcore requests buffer cannot take more entries for this thread core.
d5df0a
+name:other_assists type:mandatory default:0x3f
d5df0a
+	0x3f extra: any Number of times a microcode assist is invoked by HW other than FP-assist. Examples include AD (page Access Dirty) and AVX* related assists.
d5df0a
+name:inst_retired type:exclusive default:any
d5df0a
+	0x1 extra: any Instructions retired from execution.mem
d5df0a
+	0x0 extra: any_p Number of instructions retired. General Counter   - architectural event
d5df0a
+	0x1 extra:pebs prec_dist Precise instruction retired event with HW to reduce effect of PEBS shadow in IP distribution
d5df0a
+name:cpu_clk_unhalted type:exclusive default:thread
d5df0a
+	0x2 extra: thread Core cycles when the thread is not in halt state
d5df0a
+	0x3 extra: ref_tsc Reference cycles when the core is not in halt state.
d5df0a
+	0x0 extra: thread_p Thread cycles when thread is not in halt state
d5df0a
+	0x2 extra:any thread_any Core cycles when at least one thread on the physical core is not in halt state
d5df0a
+	0x0 extra:any thread_p_any Core cycles when at least one thread on the physical core is not in halt state
d5df0a
+name:ld_blocks type:exclusive default:0x2
d5df0a
+	0x2 extra: store_forward loads blocked by overlapping with store buffer that cannot be forwarded .
d5df0a
+	0x8 extra: no_sr The number of times that split load operations are temporarily blocked because all resources for handling the split accesses are in use
d5df0a
+name:dtlb_load_misses type:exclusive default:miss_causes_a_walk
d5df0a
+	0x1 extra: miss_causes_a_walk Load misses in all DTLB levels that cause page walks
d5df0a
+	0x10 extra: walk_pending Counts 1 per cycle for each PMH that is busy with a page walk for a load.
d5df0a
+	0x20 extra: stlb_hit Loads that miss the DTLB and hit the STLB.
d5df0a
+	0xe extra: walk_completed Load miss in all TLB levels causes a page walk that completes. (All page sizes)
d5df0a
+	0x10 extra:cmask=1 walk_active Cycles when at least one PMH is busy with a page walk for a load.
d5df0a
+name:int_misc type:exclusive default:recovery_cycles
d5df0a
+	0x1 extra: recovery_cycles Core cycles the allocator was stalled due to recovery from earlier clear event for this thread (e.g. misprediction or memory nuke)
d5df0a
+	0x80 extra: clear_resteer_cycles Cycles the issue-stage is waiting for front-end to fetch from resteered path following branch misprediction or machine clear events.
d5df0a
+	0x1 extra:any recovery_cycles_any Core cycles the allocator was stalled due to recovery from earlier clear event for any thread running on the physical core (e.g. misprediction or memory nuke)
d5df0a
+name:uops_issued type:exclusive default:any
d5df0a
+	0x1 extra: any Uops that Resource Allocation Table (RAT) issues to Reservation Station (RS)
d5df0a
+	0x20 extra: slow_lea Number of slow LEA uops being allocated. A uop is generally considered SlowLea if it has 3 sources (e.g. 2 sources + immediate) regardless if as a result of LEA instruction or not.
d5df0a
+	0x1 extra:cmask=1,inv stall_cycles Cycles when Resource Allocation Table (RAT) does not issue Uops to Reservation Station (RS) for the thread
d5df0a
+	0x2 extra: vector_width_mismatch This event counts the number of Blend Uops issued by the Resource Allocation Table (RAT) to the reservation station (RS) in order to preserve upper bits of vector registers. Starting the Skylake microarchitecture, these Blend uops are needed since every Intel SSE instruction executed in Dirty Upper State needs to preserve bits 128-255 of the destination register.  For more information, refer to ?Mixing Intel AVX and Intel SSE Code? section of the Optimization Guide.
d5df0a
+name:l2_rqsts type:exclusive default:0x21
d5df0a
+	0x21 extra: demand_data_rd_miss Demand Data Read miss L2, no rejects
d5df0a
+	0x41 extra: demand_data_rd_hit Demand Data Read requests that hit L2 cache
d5df0a
+	0xe1 extra: all_demand_data_rd Demand Data Read requests
d5df0a
+	0xe2 extra: all_rfo RFO requests to L2 cache
d5df0a
+	0xe4 extra: all_code_rd L2 code requests
d5df0a
+	0xf8 extra: all_pf Requests from the L1/L2/L3 hardware prefetchers or Load software prefetches
d5df0a
+	0x38 extra: pf_miss Requests from the L1/L2/L3 hardware prefetchers or Load software prefetches that miss L2 cache
d5df0a
+	0xd8 extra: pf_hit Requests from the L1/L2/L3 hardware prefetchers or Load software prefetches that hit L2 cache
d5df0a
+	0x42 extra: rfo_hit RFO requests that hit L2 cache
d5df0a
+	0x22 extra: rfo_miss RFO requests that miss L2 cache
d5df0a
+	0x44 extra: code_rd_hit L2 cache hits when fetching instructions, code reads.
d5df0a
+	0x24 extra: code_rd_miss L2 cache misses when fetching instructions
d5df0a
+	0x27 extra: all_demand_miss Demand requests that miss L2 cache
d5df0a
+	0xe7 extra: all_demand_references Demand requests to L2 cache
d5df0a
+	0x3f extra: miss All requests that miss L2 cache
d5df0a
+	0xff extra: references All L2 requests
d5df0a
+name:longest_lat_cache type:exclusive default:0x41
d5df0a
+	0x41 extra: miss Core-originated cacheable demand requests missed L3
d5df0a
+	0x4f extra: reference Core-originated cacheable demand requests that refer to L3
d5df0a
+name:cpu_clk_thread_unhalted type:exclusive default:ref_xclk
d5df0a
+	0x1 extra: ref_xclk Reference cycles when the thread is unhalted (counts at 100 MHz rate)
d5df0a
+	0x2 extra: one_thread_active Count XClk pulses when this thread is unhalted and the other thread is halted.
d5df0a
+	0x1 extra:any ref_xclk_any Reference cycles when the at least one thread on the physical core is unhalted (counts at 100 MHz rate)
d5df0a
+name:l1d_pend_miss type:exclusive default:pending
d5df0a
+	0x1 extra: pending L1D miss oustandings duration in cycles
d5df0a
+	0x2 extra: fb_full Number of times a request needed a FB entry but there was no entry available for it. That is the FB unavailability was dominant reason for blocking the request. A request includes cacheable/uncacheable demands that is load, store or SW prefetch. HWP are e
d5df0a
+	0x1 extra:cmask=1 pending_cycles Cycles with L1D load Misses outstanding.
d5df0a
+	0x1 extra:cmask=1,any pending_cycles_any Cycles with L1D load Misses outstanding from any thread on physical core
d5df0a
+name:dtlb_store_misses type:exclusive default:miss_causes_a_walk
d5df0a
+	0x1 extra: miss_causes_a_walk Store misses in all DTLB levels that cause page walks
d5df0a
+	0x10 extra: walk_pending Counts 1 per cycle for each PMH that is busy with a page walk for a store.
d5df0a
+	0x20 extra: stlb_hit Stores that miss the DTLB and hit the STLB.
d5df0a
+	0xe extra: walk_completed Store misses in all TLB levels causes a page walk that completes. (All page sizes)
d5df0a
+	0x10 extra:cmask=1 walk_active Cycles when at least one PMH is busy with a page walk for a store.
d5df0a
+name:tx_mem type:exclusive default:0x1
d5df0a
+	0x1 extra: abort_conflict Number of times a transactional abort was signaled due to a data conflict on a transactionally accessed address
d5df0a
+	0x2 extra: abort_capacity Number of times a transactional abort was signaled due to a data capacity limitation for transactional reads or writes.
d5df0a
+	0x4 extra: abort_hle_store_to_elided_lock Number of times a HLE transactional region aborted due to a non XRELEASE prefixed instruction writing to an elided lock in the elision buffer
d5df0a
+	0x8 extra: abort_hle_elision_buffer_not_empty Number of times an HLE transactional execution aborted due to NoAllocatedElisionBuffer being non-zero.
d5df0a
+	0x10 extra: abort_hle_elision_buffer_mismatch Number of times an HLE transactional execution aborted due to XRELEASE lock not satisfying the address and value requirements in the elision buffer
d5df0a
+	0x20 extra: abort_hle_elision_buffer_unsupported_alignment Number of times an HLE transactional execution aborted due to an unsupported read alignment from the elision buffer.
d5df0a
+	0x40 extra: hle_elision_buffer_full Number of times HLE lock could not be elided due to ElisionBufferAvailable being zero.
d5df0a
+name:tx_exec type:exclusive default:0x1
d5df0a
+	0x1 extra: misc1 Counts the number of times a class of instructions that may cause a transactional abort was executed. Since this is the count of execution, it may not always cause a transactional abort.
d5df0a
+	0x2 extra: misc2 Counts the number of times a class of instructions (e.g., vzeroupper) that may cause a transactional abort was executed inside a transactional region
d5df0a
+	0x4 extra: misc3 Counts the number of times an instruction execution caused the transactional nest count supported to be exceeded
d5df0a
+	0x8 extra: misc4 Counts the number of times a XBEGIN instruction was executed inside an HLE transactional region.
d5df0a
+	0x10 extra: misc5 Counts the number of times an HLE XACQUIRE instruction was executed inside an RTM transactional region
d5df0a
+name:rs_events type:exclusive default:empty_cycles
d5df0a
+	0x1 extra: empty_cycles Cycles when Reservation Station (RS) is empty for the thread
d5df0a
+	0x1 extra:cmask=1,inv,edge empty_end Counts end of periods where the Reservation Station (RS) was empty. Could be useful to precisely locate Frontend Latency Bound issues.
d5df0a
+name:offcore_requests_outstanding type:exclusive default:demand_data_rd
d5df0a
+	0x1 extra: demand_data_rd Offcore outstanding Demand Data Read transactions in uncore queue.
d5df0a
+	0x2 extra:cmask=1 demand_code_rd Cycles with offcore outstanding Code Reads transactions in the SuperQueue (SQ), queue to uncore, every cycle.
d5df0a
+	0x4 extra:cmask=1 demand_rfo Offcore outstanding demand rfo reads transactions in SuperQueue (SQ), queue to uncore, every cycle
d5df0a
+	0x8 extra: all_data_rd Offcore outstanding cacheable Core Data Read transactions in SuperQueue (SQ), queue to uncore
d5df0a
+	0x10 extra: l3_miss_demand_data_rd Counts number of Offcore outstanding Demand Data Read requests who miss L3 cache in the superQ every cycle.
d5df0a
+	0x1 extra:cmask=1 cycles_with_demand_data_rd Cycles when offcore outstanding Demand Data Read transactions are present in SuperQueue (SQ), queue to uncore
d5df0a
+	0x8 extra:cmask=1 cycles_with_data_rd Cycles when offcore outstanding cacheable Core Data Read transactions are present in SuperQueue (SQ), queue to uncore
d5df0a
+	0x2 extra:cmask=1 cycles_with_demand_code_rd Cycles with offcore outstanding Code Reads transactions in the SuperQueue (SQ), queue to uncore, every cycle.
d5df0a
+	0x4 extra:cmask=1 cycles_with_demand_rfo Offcore outstanding demand rfo reads transactions in SuperQueue (SQ), queue to uncore, every cycle
d5df0a
+	0x10 extra:cmask=1 cycles_with_l3_miss_demand_data_rd Cycles with at least 1 Demand Data Read requests who miss L3 cache in the superQ
d5df0a
+	0x10 extra:cmask=6 l3_miss_demand_data_rd_ge_6 Cycles with at least 6 Demand Data Read requests who miss L3 cache in the superQ
d5df0a
+	0x1 extra:cmask=6 demand_data_rd_ge_6 Cycles with at least 6 offcore outstanding Demand Data Read transactions in uncore queue
d5df0a
+name:idq type:exclusive default:mite_uops
d5df0a
+	0x4 extra: mite_uops Uops delivered to Instruction Decode Queue (IDQ) from MITE path
d5df0a
+	0x8 extra: dsb_uops Uops delivered to Instruction Decode Queue (IDQ) from the Decode Stream Buffer (DSB) path
d5df0a
+	0x20 extra: ms_mite_uops Uops initiated by MITE and delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy
d5df0a
+	0x30 extra:cmask=1 ms_cycles Cycles when uops are being delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy
d5df0a
+	0x4 extra:cmask=1 mite_cycles Cycles when uops are being delivered to Instruction Decode Queue (IDQ) from MITE path
d5df0a
+	0x8 extra:cmask=1 dsb_cycles Cycles when uops are being delivered to Instruction Decode Queue (IDQ) from Decode Stream Buffer (DSB) path
d5df0a
+	0x10 extra:cmask=1 ms_dsb_cycles Cycles when uops initiated by Decode Stream Buffer (DSB) are being delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy
d5df0a
+	0x18 extra:cmask=4 all_dsb_cycles_4_uops Cycles Decode Stream Buffer (DSB) is delivering 4 Uops
d5df0a
+	0x18 extra:cmask=1 all_dsb_cycles_any_uops Cycles Decode Stream Buffer (DSB) is delivering any Uop
d5df0a
+	0x24 extra:cmask=4 all_mite_cycles_4_uops Cycles MITE is delivering 4 Uops
d5df0a
+	0x24 extra:cmask=1 all_mite_cycles_any_uops Cycles MITE is delivering any Uop
d5df0a
+	0x30 extra:cmask=1,edge ms_switches Number of switches from DSB (Decode Stream Buffer) or MITE (legacy decode pipeline) to the Microcode Sequencer
d5df0a
+	0x30 extra: ms_uops Uops delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy
d5df0a
+name:icache_64b type:exclusive default:0x1
d5df0a
+	0x1 extra: iftag_hit Instruction fetch tag lookups that hit in the instruction cache (L1I). Counts at 64-byte cache-line granularity.
d5df0a
+	0x2 extra: iftag_miss Instruction fetch tag lookups that miss in the instruction cache (L1I). Counts at 64-byte cache-line granularity.
d5df0a
+	0x4 extra: iftag_stall Cycles where a code fetch is stalled due to L1 instruction cache tag miss.
d5df0a
+name:itlb_misses type:exclusive default:0x1
d5df0a
+	0x1 extra: miss_causes_a_walk Misses at all ITLB levels that cause page walks
d5df0a
+	0x10 extra: walk_pending Counts 1 per cycle for each PMH that is busy with a page walk for an instruction fetch request.
d5df0a
+	0x20 extra: stlb_hit Intruction fetch requests that miss the ITLB and hit the STLB.
d5df0a
+	0xe extra: walk_completed Code miss in all TLB levels causes a page walk that completes. (All page sizes)
d5df0a
+name:idq_uops_not_delivered type:exclusive default:core
d5df0a
+	0x1 extra: core Uops not delivered to Resource Allocation Table (RAT) per thread when backend of the machine is not stalled
d5df0a
+	0x1 extra:cmask=4 cycles_0_uops_deliv_core Cycles per thread when 4 or more uops are not delivered to Resource Allocation Table (RAT) when backend of the machine is not stalled
d5df0a
+	0x1 extra:cmask=3 cycles_le_1_uop_deliv_core Cycles per thread when 3 or more uops are not delivered to Resource Allocation Table (RAT) when backend of the machine is not stalled
d5df0a
+	0x1 extra:cmask=2 cycles_le_2_uop_deliv_core Cycles with less than 2 uops delivered by the front end.
d5df0a
+	0x1 extra:cmask=1 cycles_le_3_uop_deliv_core Cycles with less than 3 uops delivered by the front end.
d5df0a
+	0x1 extra:cmask=1,inv cycles_fe_was_ok Counts cycles FE delivered 4 uops or Resource Allocation Table (RAT) was stalling FE.
d5df0a
+name:uops_dispatched_port type:exclusive default:0x1
d5df0a
+	0x1 extra: port_0 Cycles per thread when uops are executed in port 0
d5df0a
+	0x2 extra: port_1 Cycles per thread when uops are executed in port 1
d5df0a
+	0x4 extra: port_2 Cycles per thread when uops are executed in port 2
d5df0a
+	0x8 extra: port_3 Cycles per thread when uops are executed in port 3
d5df0a
+	0x10 extra: port_4 Cycles per thread when uops are executed in port 4
d5df0a
+	0x20 extra: port_5 Cycles per thread when uops are executed in port 5
d5df0a
+	0x40 extra: port_6 Cycles per thread when uops are executed in port 6
d5df0a
+	0x80 extra: port_7 Cycles per thread when uops are executed in port 7
d5df0a
+name:resource_stalls type:exclusive default:0x1
d5df0a
+	0x1 extra: any Resource-related stall cycles
d5df0a
+	0x8 extra: sb Cycles stalled due to no store buffers available. (not including draining form sync).
d5df0a
+name:cycle_activity type:exclusive default:0x4
d5df0a
+	0x4 extra:cmask=4 stalls_total Total execution stalls.
d5df0a
+	0x8 extra:cmask=8 cycles_l1d_miss Cycles while L1 cache miss demand load is outstanding.
d5df0a
+	0xc extra:cmask=c stalls_l1d_miss Execution stalls while L1 cache miss demand load is outstanding.
d5df0a
+	0x1 extra:cmask=1 cycles_l2_miss Cycles while L2 cache miss demand load is outstanding.
d5df0a
+	0x5 extra:cmask=5 stalls_l2_miss Execution stalls while L2 cache miss demand load is outstanding.
d5df0a
+	0x10 extra:cmask=10 cycles_mem_any Cycles while memory subsystem has an outstanding load.
d5df0a
+	0x14 extra:cmask=14 stalls_mem_any Execution stalls while memory subsystem has an outstanding load.
d5df0a
+	0x2 extra:cmask=2 cycles_l3_miss Cycles while L3 cache miss demand load is outstanding.
d5df0a
+	0x6 extra:cmask=6 stalls_l3_miss Execution stalls while L3 cache miss demand load is outstanding.
d5df0a
+name:exe_activity type:exclusive default:0x1
d5df0a
+	0x1 extra: exe_bound_0_ports Cycles where no uops were executed, the Reservation Station was not empty, the Store Buffer was full and there was no outstanding load.
d5df0a
+	0x2 extra: u1_ports_util Cycles total of 1 uop is executed on all ports and Reservation Station was not empty.
d5df0a
+	0x4 extra: u2_ports_util Cycles total of 2 uops are executed on all ports and Reservation Station was not empty.
d5df0a
+	0x8 extra: u3_ports_util Cycles total of 3 uops are executed on all ports and Reservation Station was not empty.
d5df0a
+	0x10 extra: u4_ports_util Cycles total of 4 uops are executed on all ports and Reservation Station was not empty.
d5df0a
+	0x40 extra: bound_on_stores Cycles where the Store Buffer was full and no outstanding load.
d5df0a
+name:lsd type:exclusive default:uops
d5df0a
+	0x1 extra: uops Number of Uops delivered by the LSD.
d5df0a
+	0x1 extra:cmask=1 cycles_active Cycles Uops delivered by the LSD, but didn't come from the decoder
d5df0a
+	0x1 extra:cmask=4 cycles_4_uops Cycles 4 Uops delivered by the LSD, but didn't come from the decoder
d5df0a
+name:offcore_requests type:exclusive default:0x80
d5df0a
+	0x80 extra: all_requests Any memory transaction that reached the SQ.
d5df0a
+	0x1 extra: demand_data_rd Demand Data Read requests sent to uncore
d5df0a
+	0x2 extra: demand_code_rd Cacheable and noncachaeble code read requests
d5df0a
+	0x4 extra: demand_rfo Demand RFO requests including regular RFOs, locks, ItoM
d5df0a
+	0x8 extra: all_data_rd Demand and prefetch data reads
d5df0a
+	0x10 extra: l3_miss_demand_data_rd Demand Data Read requests who miss L3 cache
d5df0a
+name:uops_executed type:exclusive default:thread
d5df0a
+	0x1 extra: thread Counts the number of uops to be executed per-thread each cycle.
d5df0a
+	0x2 extra: core Number of uops executed on the core.
d5df0a
+	0x10 extra: x87 Counts the number of x87 uops dispatched.
d5df0a
+	0x1 extra:cmask=1,inv stall_cycles Counts number of cycles no uops were dispatched to be executed on this thread.
d5df0a
+	0x1 extra:cmask=1 cycles_ge_1_uop_exec Cycles where at least 1 uop was executed per-thread
d5df0a
+	0x1 extra:cmask=2 cycles_ge_2_uops_exec Cycles where at least 2 uops were executed per-thread
d5df0a
+	0x1 extra:cmask=3 cycles_ge_3_uops_exec Cycles where at least 3 uops were executed per-thread
d5df0a
+	0x1 extra:cmask=4 cycles_ge_4_uops_exec Cycles where at least 4 uops were executed per-thread
d5df0a
+	0x2 extra:cmask=1 core_cycles_ge_1 Cycles at least 1 micro-op is executed from any thread on physical core
d5df0a
+	0x2 extra:cmask=2 core_cycles_ge_2 Cycles at least 2 micro-op is executed from any thread on physical core
d5df0a
+	0x2 extra:cmask=3 core_cycles_ge_3 Cycles at least 3 micro-op is executed from any thread on physical core
d5df0a
+	0x2 extra:cmask=4 core_cycles_ge_4 Cycles at least 4 micro-op is executed from any thread on physical core
d5df0a
+	0x2 extra:cmask=1,inv core_cycles_none Cycles with no micro-ops executed from any thread on physical core
d5df0a
+name:tlb_flush type:exclusive default:0x1
d5df0a
+	0x1 extra: dtlb_thread DTLB flush attempts of the thread-specific entries
d5df0a
+	0x20 extra: stlb_any STLB flush attempts
d5df0a
+name:uops_retired type:exclusive default:retire_slots
d5df0a
+	0x2 extra: retire_slots Retirement slots used.
d5df0a
+	0x1 extra:cmask=1,inv stall_cycles Cycles without actually retired uops.
d5df0a
+	0x1 extra:cmask=a,inv total_cycles Cycles with less than 10 actually retired uops.
d5df0a
+name:machine_clears type:exclusive default:0x1
d5df0a
+	0x1 extra:cmask=1,edge count Number of machine clears (nukes) of any type.
d5df0a
+	0x2 extra: memory_ordering Counts the number of machine clears due to memory order conflicts.
d5df0a
+	0x4 extra: smc Self-modifying code (SMC) detected.
d5df0a
+name:br_inst_retired type:exclusive default:all_branches
d5df0a
+	0x0 extra: all_branches All (macro) branch instructions retired.
d5df0a
+	0x1 extra: conditional Conditional branch instructions retired.
d5df0a
+	0x1 extra:pebs conditional_pebs Conditional branch instructions retired.
d5df0a
+	0x2 extra: near_call Direct and indirect near call instructions retired.
d5df0a
+	0x2 extra:pebs near_call_pebs Direct and indirect near call instructions retired.
d5df0a
+	0x8 extra: near_return Return instructions retired.
d5df0a
+	0x8 extra:pebs near_return_pebs Return instructions retired.
d5df0a
+	0x10 extra: not_taken Not taken branch instructions retired.
d5df0a
+	0x20 extra: near_taken Taken branch instructions retired.
d5df0a
+	0x20 extra:pebs near_taken_pebs Taken branch instructions retired.
d5df0a
+	0x40 extra: far_branch Far branch instructions retired.
d5df0a
+	0x40 extra:pebs far_branch_pebs Far branch instructions retired.
d5df0a
+	0x4 extra:pebs all_branches_pebs All (macro) branch instructions retired.
d5df0a
+name:br_misp_retired type:exclusive default:all_branches
d5df0a
+	0x0 extra: all_branches All mispredicted macro branch instructions retired.
d5df0a
+	0x1 extra: conditional Mispredicted conditional branch instructions retired.
d5df0a
+	0x1 extra:pebs conditional_pebs Mispredicted conditional branch instructions retired.
d5df0a
+	0x20 extra: near_taken number of near branch instructions retired that were mispredicted and taken.
d5df0a
+	0x20 extra:pebs near_taken_pebs number of near branch instructions retired that were mispredicted and taken.
d5df0a
+	0x4 extra:pebs all_branches_pebs Mispredicted macro branch instructions retired.
d5df0a
+name:fp_arith_inst_retired type:exclusive default:0x1
d5df0a
+	0x1 extra: scalar_double Number of SSE/AVX computational scalar double precision floating-point instructions retired.  Each count represents 1 computation. Applies to SSE* and AVX* scalar double precision floating-point instructions: ADD SUB MUL DIV MIN MAX SQRT FM(N)ADD/SUB.  FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element.
d5df0a
+	0x2 extra: scalar_single Number of SSE/AVX computational scalar single precision floating-point instructions retired.  Each count represents 1 computation. Applies to SSE* and AVX* scalar single precision floating-point instructions: ADD SUB MUL DIV MIN MAX RCP RSQRT SQRT FM(N)ADD/SUB.  FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element.
d5df0a
+	0x4 extra: u128b_packed_double Number of SSE/AVX computational 128-bit packed double precision floating-point instructions retired.  Each count represents 2 computations. Applies to SSE* and AVX* packed double precision floating-point instructions: ADD SUB MUL DIV MIN MAX SQRT DPP FM(N)ADD/SUB.  DPP and FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element.
d5df0a
+	0x8 extra: u128b_packed_single Number of SSE/AVX computational 128-bit packed single precision floating-point instructions retired.  Each count represents 4 computations. Applies to SSE* and AVX* packed single precision floating-point instructions: ADD SUB MUL DIV MIN MAX RCP RSQRT SQRT DPP FM(N)ADD/SUB.  DPP and FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element.
d5df0a
+	0x10 extra: u256b_packed_double Number of SSE/AVX computational 256-bit packed double precision floating-point instructions retired.  Each count represents 4 computations. Applies to SSE* and AVX* packed double precision floating-point instructions: ADD SUB MUL DIV MIN MAX SQRT DPP FM(N)ADD/SUB.  DPP and FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element.
d5df0a
+	0x20 extra: u256b_packed_single Number of SSE/AVX computational 256-bit packed single precision floating-point instructions retired.  Each count represents 8 computations. Applies to SSE* and AVX* packed single precision floating-point instructions: ADD SUB MUL DIV MIN MAX RCP RSQRT SQRT DPP FM(N)ADD/SUB.  DPP and FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element.
d5df0a
+name:hle_retired type:exclusive default:start
d5df0a
+	0x1 extra: start Number of times an HLE execution started.
d5df0a
+	0x2 extra: commit Number of times an HLE execution successfully committed
d5df0a
+	0x4 extra: aborted Number of times an HLE execution aborted due to any reasons (multiple categories may count as one).
d5df0a
+	0x4 extra:pebs aborted_pebs Number of times an HLE execution aborted due to any reasons (multiple categories may count as one).
d5df0a
+	0x8 extra: aborted_misc1 Number of times an HLE execution aborted due to various memory events (e.g., read/write capacity and conflicts).
d5df0a
+	0x10 extra: aborted_misc2 Number of times an HLE execution aborted due to hardware timer expiration.
d5df0a
+	0x20 extra: aborted_misc3 Number of times an HLE execution aborted due to HLE-unfriendly instructions and certain unfriendly events (such as AD assists etc.).
d5df0a
+	0x40 extra: aborted_misc4 Number of times an HLE execution aborted due to incompatible memory type
d5df0a
+	0x80 extra: aborted_misc5 Number of times an HLE execution aborted due to unfriendly events (such as interrupts).
d5df0a
+name:rtm_retired type:exclusive default:start
d5df0a
+	0x1 extra: start Number of times an RTM execution started.
d5df0a
+	0x2 extra: commit Number of times an RTM execution successfully committed
d5df0a
+	0x4 extra: aborted Number of times an RTM execution aborted due to any reasons (multiple categories may count as one).
d5df0a
+	0x4 extra:pebs aborted_pebs Number of times an RTM execution aborted due to any reasons (multiple categories may count as one).
d5df0a
+	0x8 extra: aborted_misc1 Number of times an RTM execution aborted due to various memory events (e.g. read/write capacity and conflicts)
d5df0a
+	0x10 extra: aborted_misc2 Number of times an RTM execution aborted due to uncommon conditions.
d5df0a
+	0x20 extra: aborted_misc3 Number of times an RTM execution aborted due to HLE-unfriendly instructions
d5df0a
+	0x40 extra: aborted_misc4 Number of times an RTM execution aborted due to incompatible memory type
d5df0a
+	0x80 extra: aborted_misc5 Number of times an RTM execution aborted due to none of the previous 4 categories (e.g. interrupt)
d5df0a
+name:mem_inst_retired type:exclusive default:stlb_miss_loads
d5df0a
+	0x11 extra: stlb_miss_loads Number of load instructions retired with STLB miss
d5df0a
+	0x11 extra:pebs stlb_miss_loads_pebs Number of load instructions retired with STLB miss
d5df0a
+	0x12 extra: stlb_miss_stores Number of store instructions retired with STLB miss
d5df0a
+	0x12 extra:pebs stlb_miss_stores_pebs Number of store instructions retired with STLB miss
d5df0a
+	0x21 extra: lock_loads Number of lock load instructions retired
d5df0a
+	0x21 extra:pebs lock_loads_pebs Number of lock load instructions retired
d5df0a
+	0x41 extra: split_loads Number of load instructions retired with cache-line splits that may impact performance.
d5df0a
+	0x41 extra:pebs split_loads_pebs Number of load instructions retired with cache-line splits that may impact performance.
d5df0a
+	0x42 extra: split_stores Number of store instructions retired  with line-split
d5df0a
+	0x42 extra:pebs split_stores_pebs Number of store instructions retired  with line-split
d5df0a
+	0x81 extra: all_loads Number of load instructions retired
d5df0a
+	0x81 extra:pebs all_loads_pebs Number of load instructions retired
d5df0a
+	0x82 extra: all_stores Number of store instructions retired
d5df0a
+	0x82 extra:pebs all_stores_pebs Number of store instructions retired
d5df0a
+name:mem_load_retired type:exclusive default:l1_hit
d5df0a
+	0x1 extra: l1_hit Retired load instructions with L1 cache hits as data sources
d5df0a
+	0x1 extra:pebs l1_hit_pebs Retired load instructions with L1 cache hits as data sources
d5df0a
+	0x2 extra: l2_hit Retired load instructions with L2 cache hits as data sources
d5df0a
+	0x2 extra:pebs l2_hit_pebs Retired load instructions with L2 cache hits as data sources
d5df0a
+	0x4 extra: l3_hit Retired load instructions with L3 cache hits as data sources
d5df0a
+	0x4 extra:pebs l3_hit_pebs Retired load instructions with L3 cache hits as data sources
d5df0a
+	0x8 extra: l1_miss Retired load instructions missed L1 cache as data sources
d5df0a
+	0x8 extra:pebs l1_miss_pebs Retired load instructions missed L1 cache as data sources
d5df0a
+	0x10 extra: l2_miss Retired load instructions missed L2 cache as data sources
d5df0a
+	0x10 extra:pebs l2_miss_pebs Retired load instructions missed L2 cache as data sources
d5df0a
+	0x20 extra: l3_miss Retired load instructions missed L3 cache as data sources
d5df0a
+	0x20 extra:pebs l3_miss_pebs Retired load instructions missed L3 cache as data sources
d5df0a
+	0x40 extra: fb_hit Retired load instructions which data sources were load missed L1 but hit FB due to preceding miss to the same cache line with data not ready
d5df0a
+	0x40 extra:pebs fb_hit_pebs Retired load instructions which data sources were load missed L1 but hit FB due to preceding miss to the same cache line with data not ready
d5df0a
+name:mem_load_l3_hit_retired type:exclusive default:xsnp_miss
d5df0a
+	0x1 extra: xsnp_miss Retired load instructions which data sources were L3 hit and cross-core snoop missed in on-pkg core cache.
d5df0a
+	0x1 extra:pebs xsnp_miss_pebs Retired load instructions which data sources were L3 hit and cross-core snoop missed in on-pkg core cache.
d5df0a
+	0x2 extra: xsnp_hit Retired load instructions which data sources were L3 and cross-core snoop hits in on-pkg core cache
d5df0a
+	0x2 extra:pebs xsnp_hit_pebs Retired load instructions which data sources were L3 and cross-core snoop hits in on-pkg core cache
d5df0a
+	0x4 extra: xsnp_hitm Retired load instructions which data sources were HitM responses from shared L3
d5df0a
+	0x4 extra:pebs xsnp_hitm_pebs Retired load instructions which data sources were HitM responses from shared L3
d5df0a
+	0x8 extra: xsnp_none Retired load instructions which data sources were hits in L3 without snoops required
d5df0a
+	0x8 extra:pebs xsnp_none_pebs Retired load instructions which data sources were hits in L3 without snoops required
d5df0a
diff --git a/libop/op_cpu_type.c b/libop/op_cpu_type.c
d5df0a
index 24ed697..b1d5ecf 100644
d5df0a
--- a/libop/op_cpu_type.c
d5df0a
+++ b/libop/op_cpu_type.c
d5df0a
@@ -121,6 +121,7 @@ static struct cpu_descr const cpu_descrs[MAX_CPU_TYPE] = {
d5df0a
 	{ "APM X-Gene", "arm/armv8-xgene", CPU_ARM_V8_APM_XGENE, 6 },
d5df0a
 	{ "ARM Cortex-A57", "arm/armv8-ca57", CPU_ARM_V8_CA57, 6},
d5df0a
 	{ "ARM Cortex-A53", "arm/armv8-ca53", CPU_ARM_V8_CA53, 6},
d5df0a
+	{ "Intel Skylake microarchitecture", "i386/skylake", CPU_SKYLAKE, 4 },
d5df0a
 };
d5df0a
  
d5df0a
 static size_t const nr_cpu_descrs = sizeof(cpu_descrs) / sizeof(struct cpu_descr);
d5df0a
@@ -737,6 +738,7 @@ op_cpu op_cpu_base_type(op_cpu cpu_type)
d5df0a
 	case CPU_NEHALEM:
d5df0a
 	case CPU_HASWELL:
d5df0a
 	case CPU_BROADWELL:
d5df0a
+	case CPU_SKYLAKE:
d5df0a
 	case CPU_SILVERMONT:
d5df0a
 	case CPU_WESTMERE:
d5df0a
 	case CPU_SANDYBRIDGE:
d5df0a
diff --git a/libop/op_cpu_type.h b/libop/op_cpu_type.h
d5df0a
index 2bd00ce..9983f87 100644
d5df0a
--- a/libop/op_cpu_type.h
d5df0a
+++ b/libop/op_cpu_type.h
d5df0a
@@ -101,6 +101,7 @@ typedef enum {
d5df0a
 	CPU_ARM_V8_APM_XGENE, /* APM X-Gene */
d5df0a
 	CPU_ARM_V8_CA57, /* ARM Cortex-A57 */
d5df0a
 	CPU_ARM_V8_CA53, /* ARM Cortex-A53 */
d5df0a
+	CPU_SKYLAKE, /** < Intel Skylake microarchitecture */
d5df0a
 	MAX_CPU_TYPE
d5df0a
 } op_cpu;
d5df0a
 
d5df0a
diff --git a/libop/op_events.c b/libop/op_events.c
d5df0a
index 2badc8e..f58d243 100644
d5df0a
--- a/libop/op_events.c
d5df0a
+++ b/libop/op_events.c
d5df0a
@@ -1200,6 +1200,7 @@ void op_default_event(op_cpu cpu_type, struct op_default_event_descr * descr)
d5df0a
 		case CPU_NEHALEM:
d5df0a
 		case CPU_HASWELL:
d5df0a
 		case CPU_BROADWELL:
d5df0a
+		case CPU_SKYLAKE:
d5df0a
 		case CPU_SILVERMONT:
d5df0a
 		case CPU_WESTMERE:
d5df0a
 		case CPU_SANDYBRIDGE:
d5df0a
diff --git a/libop/op_hw_specific.h b/libop/op_hw_specific.h
d5df0a
index 8a7ed1c..994fec4 100644
d5df0a
--- a/libop/op_hw_specific.h
d5df0a
+++ b/libop/op_hw_specific.h
d5df0a
@@ -154,6 +154,9 @@ static inline op_cpu op_cpu_specific_type(op_cpu cpu_type)
d5df0a
 		case 0x4f:
d5df0a
 		case 0x56:
d5df0a
 			return CPU_BROADWELL;
d5df0a
+		case 0x4e:
d5df0a
+		case 0x5e:
d5df0a
+			return CPU_SKYLAKE;
d5df0a
 		case 0x37:
d5df0a
 		case 0x4d:
d5df0a
 		case 0x4c:
d5df0a
diff --git a/utils/ophelp.c b/utils/ophelp.c
d5df0a
index a80fec8..fdddddc 100644
d5df0a
--- a/utils/ophelp.c
d5df0a
+++ b/utils/ophelp.c
d5df0a
@@ -542,6 +542,7 @@ int main(int argc, char const * argv[])
d5df0a
 	case CPU_NEHALEM:
d5df0a
 	case CPU_HASWELL:
d5df0a
 	case CPU_BROADWELL:
d5df0a
+	case CPU_SKYLAKE:
d5df0a
 	case CPU_SILVERMONT:
d5df0a
 	case CPU_WESTMERE:
d5df0a
 	case CPU_SANDYBRIDGE:
d5df0a
-- 
d5df0a
2.4.3
d5df0a
d5df0a
From ccc38adf33e3ae845e0b7c4f8fe77beceaa7b930 Mon Sep 17 00:00:00 2001
d5df0a
From: Andi Kleen <ak@linux.intel.com>
d5df0a
Date: Mon, 6 Jul 2015 16:48:25 -0700
d5df0a
Subject: [PATCH 2/3] oprofile: Fixes for Skylake event lists
d5df0a
d5df0a
This fixes the review feedback for the Skylake event list.
d5df0a
d5df0a
- Fix event codes for INST_RETIRED, CPU_CLK_UNHALTED.
d5df0a
- Fix OFFCORE_REQUESTS_OUTSTANDING events
d5df0a
- Add br_inst_retired.all_branches_pebs
d5df0a
- Fill in correct default event
d5df0a
---
d5df0a
 events/i386/skylake/events     |  4 ++--
d5df0a
 events/i386/skylake/unit_masks | 25 +++++++++++++------------
d5df0a
 libop/op_events.c              |  5 ++++-
d5df0a
 3 files changed, 19 insertions(+), 15 deletions(-)
d5df0a
d5df0a
diff --git a/events/i386/skylake/events b/events/i386/skylake/events
d5df0a
index 28d6654..9a04a86 100644
d5df0a
--- a/events/i386/skylake/events
d5df0a
+++ b/events/i386/skylake/events
d5df0a
@@ -6,8 +6,6 @@
d5df0a
 # Note the minimum counts are not discovered experimentally and could be likely
d5df0a
 # lowered in many cases without ill effect.
d5df0a
 #
d5df0a
-event:0x00 counters:1 um:inst_retired minimum:2000003 name:inst_retired :
d5df0a
-event:0x00 counters:cpuid um:cpu_clk_unhalted minimum:2000003 name:cpu_clk_unhalted :
d5df0a
 event:0x03 counters:cpuid um:ld_blocks minimum:100003 name:ld_blocks :
d5df0a
 event:0x07 counters:cpuid um:ld_blocks_partial minimum:100003 name:ld_blocks_partial_address_alias :
d5df0a
 event:0x08 counters:cpuid um:dtlb_load_misses minimum:2000003 name:dtlb_load_misses :
d5df0a
@@ -16,6 +14,7 @@ event:0x0e counters:cpuid um:uops_issued minimum:2000003 name:uops_issued :
d5df0a
 event:0x14 counters:cpuid um:arith minimum:2000003 name:arith_divider_active :
d5df0a
 event:0x24 counters:cpuid um:l2_rqsts minimum:200003 name:l2_rqsts :
d5df0a
 event:0x2e counters:cpuid um:longest_lat_cache minimum:100003 name:longest_lat_cache :
d5df0a
+event:0x3c counters:cpuid um:cpu_clk_unhalted minimum:2000003 name:cpu_clk_unhalted :
d5df0a
 event:0x3c counters:cpuid um:cpu_clk_thread_unhalted minimum:2000003 name:cpu_clk_thread_unhalted :
d5df0a
 event:0x48 counters:cpuid um:l1d_pend_miss minimum:2000003 name:l1d_pend_miss :
d5df0a
 event:0x49 counters:cpuid um:dtlb_store_misses minimum:2000003 name:dtlb_store_misses :
d5df0a
@@ -44,6 +43,7 @@ event:0xb0 counters:cpuid um:offcore_requests minimum:100003 name:offcore_reques
d5df0a
 event:0xb1 counters:cpuid um:uops_executed minimum:2000003 name:uops_executed :
d5df0a
 event:0xb2 counters:cpuid um:offcore_requests_buffer minimum:2000003 name:offcore_requests_buffer_sq_full :
d5df0a
 event:0xbd counters:cpuid um:tlb_flush minimum:100007 name:tlb_flush :
d5df0a
+event:0xc0 counters:1 um:inst_retired minimum:2000003 name:inst_retired :
d5df0a
 event:0xc1 counters:cpuid um:other_assists minimum:100003 name:other_assists_any :
d5df0a
 event:0xc2 counters:cpuid um:uops_retired minimum:2000003 name:uops_retired :
d5df0a
 event:0xc3 counters:cpuid um:machine_clears minimum:100003 name:machine_clears :
d5df0a
diff --git a/events/i386/skylake/unit_masks b/events/i386/skylake/unit_masks
d5df0a
index 98ed65c..b505769 100644
d5df0a
--- a/events/i386/skylake/unit_masks
d5df0a
+++ b/events/i386/skylake/unit_masks
d5df0a
@@ -37,16 +37,6 @@ name:offcore_requests_buffer type:mandatory default:0x1
d5df0a
 	0x1 extra: sq_full Offcore requests buffer cannot take more entries for this thread core.
d5df0a
 name:other_assists type:mandatory default:0x3f
d5df0a
 	0x3f extra: any Number of times a microcode assist is invoked by HW other than FP-assist. Examples include AD (page Access Dirty) and AVX* related assists.
d5df0a
-name:inst_retired type:exclusive default:any
d5df0a
-	0x1 extra: any Instructions retired from execution.mem
d5df0a
-	0x0 extra: any_p Number of instructions retired. General Counter   - architectural event
d5df0a
-	0x1 extra:pebs prec_dist Precise instruction retired event with HW to reduce effect of PEBS shadow in IP distribution
d5df0a
-name:cpu_clk_unhalted type:exclusive default:thread
d5df0a
-	0x2 extra: thread Core cycles when the thread is not in halt state
d5df0a
-	0x3 extra: ref_tsc Reference cycles when the core is not in halt state.
d5df0a
-	0x0 extra: thread_p Thread cycles when thread is not in halt state
d5df0a
-	0x2 extra:any thread_any Core cycles when at least one thread on the physical core is not in halt state
d5df0a
-	0x0 extra:any thread_p_any Core cycles when at least one thread on the physical core is not in halt state
d5df0a
 name:ld_blocks type:exclusive default:0x2
d5df0a
 	0x2 extra: store_forward loads blocked by overlapping with store buffer that cannot be forwarded .
d5df0a
 	0x8 extra: no_sr The number of times that split load operations are temporarily blocked because all resources for handling the split accesses are in use
d5df0a
@@ -85,6 +75,12 @@ name:l2_rqsts type:exclusive default:0x21
d5df0a
 name:longest_lat_cache type:exclusive default:0x41
d5df0a
 	0x41 extra: miss Core-originated cacheable demand requests missed L3
d5df0a
 	0x4f extra: reference Core-originated cacheable demand requests that refer to L3
d5df0a
+name:cpu_clk_unhalted type:exclusive default:thread
d5df0a
+	0x2 extra: thread Core cycles when the thread is not in halt state
d5df0a
+	0x3 extra: ref_tsc Reference cycles when the core is not in halt state.
d5df0a
+	0x0 extra: thread_p Thread cycles when thread is not in halt state
d5df0a
+	0x2 extra:any thread_any Core cycles when at least one thread on the physical core is not in halt state
d5df0a
+	0x0 extra:any thread_p_any Core cycles when at least one thread on the physical core is not in halt state
d5df0a
 name:cpu_clk_thread_unhalted type:exclusive default:ref_xclk
d5df0a
 	0x1 extra: ref_xclk Reference cycles when the thread is unhalted (counts at 100 MHz rate)
d5df0a
 	0x2 extra: one_thread_active Count XClk pulses when this thread is unhalted and the other thread is halted.
d5df0a
@@ -119,8 +115,8 @@ name:rs_events type:exclusive default:empty_cycles
d5df0a
 	0x1 extra:cmask=1,inv,edge empty_end Counts end of periods where the Reservation Station (RS) was empty. Could be useful to precisely locate Frontend Latency Bound issues.
d5df0a
 name:offcore_requests_outstanding type:exclusive default:demand_data_rd
d5df0a
 	0x1 extra: demand_data_rd Offcore outstanding Demand Data Read transactions in uncore queue.
d5df0a
-	0x2 extra:cmask=1 demand_code_rd Cycles with offcore outstanding Code Reads transactions in the SuperQueue (SQ), queue to uncore, every cycle.
d5df0a
-	0x4 extra:cmask=1 demand_rfo Offcore outstanding demand rfo reads transactions in SuperQueue (SQ), queue to uncore, every cycle
d5df0a
+	0x2 extra: demand_code_rd Offcore outstanding Code Reads transactions in the SuperQueue (SQ), queue to uncore.
d5df0a
+	0x4 extra: demand_rfo Offcore outstanding demand rfo reads transactions in SuperQueue (SQ), queue to uncore, every cycle
d5df0a
 	0x8 extra: all_data_rd Offcore outstanding cacheable Core Data Read transactions in SuperQueue (SQ), queue to uncore
d5df0a
 	0x10 extra: l3_miss_demand_data_rd Counts number of Offcore outstanding Demand Data Read requests who miss L3 cache in the superQ every cycle.
d5df0a
 	0x1 extra:cmask=1 cycles_with_demand_data_rd Cycles when offcore outstanding Demand Data Read transactions are present in SuperQueue (SQ), queue to uncore
d5df0a
@@ -217,6 +213,10 @@ name:uops_executed type:exclusive default:thread
d5df0a
 name:tlb_flush type:exclusive default:0x1
d5df0a
 	0x1 extra: dtlb_thread DTLB flush attempts of the thread-specific entries
d5df0a
 	0x20 extra: stlb_any STLB flush attempts
d5df0a
+name:inst_retired type:exclusive default:any
d5df0a
+	0x1 extra: any Instructions retired from execution.mem
d5df0a
+	0x0 extra: any_p Number of instructions retired. General Counter   - architectural event
d5df0a
+	0x1 extra:pebs prec_dist Precise instruction retired event with HW to reduce effect of PEBS shadow in IP distribution
d5df0a
 name:uops_retired type:exclusive default:retire_slots
d5df0a
 	0x2 extra: retire_slots Retirement slots used.
d5df0a
 	0x1 extra:cmask=1,inv stall_cycles Cycles without actually retired uops.
d5df0a
@@ -231,6 +231,7 @@ name:br_inst_retired type:exclusive default:all_branches
d5df0a
 	0x1 extra:pebs conditional_pebs Conditional branch instructions retired.
d5df0a
 	0x2 extra: near_call Direct and indirect near call instructions retired.
d5df0a
 	0x2 extra:pebs near_call_pebs Direct and indirect near call instructions retired.
d5df0a
+	0x0 extra:pebs all_branches_pebs All (macro) branch instructions retired.
d5df0a
 	0x8 extra: near_return Return instructions retired.
d5df0a
 	0x8 extra:pebs near_return_pebs Return instructions retired.
d5df0a
 	0x10 extra: not_taken Not taken branch instructions retired.
d5df0a
diff --git a/libop/op_events.c b/libop/op_events.c
d5df0a
index f58d243..25f010e 100644
d5df0a
--- a/libop/op_events.c
d5df0a
+++ b/libop/op_events.c
d5df0a
@@ -1200,7 +1200,6 @@ void op_default_event(op_cpu cpu_type, struct op_default_event_descr * descr)
d5df0a
 		case CPU_NEHALEM:
d5df0a
 		case CPU_HASWELL:
d5df0a
 		case CPU_BROADWELL:
d5df0a
-		case CPU_SKYLAKE:
d5df0a
 		case CPU_SILVERMONT:
d5df0a
 		case CPU_WESTMERE:
d5df0a
 		case CPU_SANDYBRIDGE:
d5df0a
@@ -1213,6 +1212,10 @@ void op_default_event(op_cpu cpu_type, struct op_default_event_descr * descr)
d5df0a
 			descr->name = "CPU_CLK_UNHALTED";
d5df0a
 			break;
d5df0a
 
d5df0a
+		case CPU_SKYLAKE:
d5df0a
+			descr->name = "cpu_clk_unhalted";
d5df0a
+			break;
d5df0a
+
d5df0a
 		case CPU_RTC:
d5df0a
 			descr->name = "RTC_INTERRUPTS";
d5df0a
 			descr->count = 1024;
d5df0a
-- 
d5df0a
2.4.3
d5df0a
d5df0a
From cfb3ddbaae4ca2e073b5229bf6019da766eb8da9 Mon Sep 17 00:00:00 2001
d5df0a
From: Andi Kleen <ak@linux.intel.com>
d5df0a
Date: Tue, 7 Jul 2015 11:02:38 -0700
d5df0a
Subject: [PATCH 3/3] oprofile: Fix unit masks of fixed counters on Skylake
d5df0a
d5df0a
Fix another issue noticed by William Cohen.
d5df0a
d5df0a
The unit masks for the fixed counters were incorrect.
d5df0a
d5df0a
Note that the fixed counters exist in two copies, as perf aliases
d5df0a
them to the generic counter version codes.
d5df0a
---
d5df0a
 events/i386/skylake/unit_masks | 6 +++---
d5df0a
 1 file changed, 3 insertions(+), 3 deletions(-)
d5df0a
d5df0a
diff --git a/events/i386/skylake/unit_masks b/events/i386/skylake/unit_masks
d5df0a
index b505769..6e81a63 100644
d5df0a
--- a/events/i386/skylake/unit_masks
d5df0a
+++ b/events/i386/skylake/unit_masks
d5df0a
@@ -76,8 +76,8 @@ name:longest_lat_cache type:exclusive default:0x41
d5df0a
 	0x41 extra: miss Core-originated cacheable demand requests missed L3
d5df0a
 	0x4f extra: reference Core-originated cacheable demand requests that refer to L3
d5df0a
 name:cpu_clk_unhalted type:exclusive default:thread
d5df0a
-	0x2 extra: thread Core cycles when the thread is not in halt state
d5df0a
-	0x3 extra: ref_tsc Reference cycles when the core is not in halt state.
d5df0a
+	0x0 extra: thread Core cycles when the thread is not in halt state
d5df0a
+	0x1 extra: ref_tsc Reference cycles when the core is not in halt state.
d5df0a
 	0x0 extra: thread_p Thread cycles when thread is not in halt state
d5df0a
 	0x2 extra:any thread_any Core cycles when at least one thread on the physical core is not in halt state
d5df0a
 	0x0 extra:any thread_p_any Core cycles when at least one thread on the physical core is not in halt state
d5df0a
@@ -214,7 +214,7 @@ name:tlb_flush type:exclusive default:0x1
d5df0a
 	0x1 extra: dtlb_thread DTLB flush attempts of the thread-specific entries
d5df0a
 	0x20 extra: stlb_any STLB flush attempts
d5df0a
 name:inst_retired type:exclusive default:any
d5df0a
-	0x1 extra: any Instructions retired from execution.mem
d5df0a
+	0x0 extra: any Instructions retired from execution.mem
d5df0a
 	0x0 extra: any_p Number of instructions retired. General Counter   - architectural event
d5df0a
 	0x1 extra:pebs prec_dist Precise instruction retired event with HW to reduce effect of PEBS shadow in IP distribution
d5df0a
 name:uops_retired type:exclusive default:retire_slots
d5df0a
-- 
d5df0a
2.4.3
d5df0a
d5df0a
commit 635d1f59ff198a43deb9482cdec10795222e506a
d5df0a
Author: Andi Kleen <ak@linux.intel.com>
d5df0a
Date:   Fri Apr 15 13:14:51 2016 -0700
d5df0a
d5df0a
    Add model number of Skylake server to oprofile
d5df0a
    
d5df0a
    Just reuse the event list of Skylake client.
d5df0a
    
d5df0a
    Signed-off-by: Andi Kleen <ak@linux.intel.com>
d5df0a
d5df0a
diff --git a/libop/op_hw_specific.h b/libop/op_hw_specific.h
d5df0a
index 994fec4..a6180f4 100644
d5df0a
--- a/libop/op_hw_specific.h
d5df0a
+++ b/libop/op_hw_specific.h
d5df0a
@@ -156,6 +156,7 @@ static inline op_cpu op_cpu_specific_type(op_cpu cpu_type)
d5df0a
 			return CPU_BROADWELL;
d5df0a
 		case 0x4e:
d5df0a
 		case 0x5e:
d5df0a
+		case 0x55:
d5df0a
 			return CPU_SKYLAKE;
d5df0a
 		case 0x37:
d5df0a
 		case 0x4d:
d5df0a
commit 402cad1b6f5605ed854eb8b7b7376cafce3fb007
d5df0a
Author: Andi Kleen <ak@linux.intel.com>
d5df0a
Date:   Fri Apr 29 17:50:25 2016 -0700
d5df0a
d5df0a
    oprofile: Add model numbers for Kabylake CPUs
d5df0a
    
d5df0a
    The PMU is using the same events as Skylake, so no other changes.
d5df0a
    
d5df0a
    Signed-off-by: Andi Kleen <ak@linux.intel.com>
d5df0a
d5df0a
diff --git a/libop/op_hw_specific.h b/libop/op_hw_specific.h
d5df0a
index f4db8f5..2061760 100644
d5df0a
--- a/libop/op_hw_specific.h
d5df0a
+++ b/libop/op_hw_specific.h
d5df0a
@@ -157,6 +157,8 @@ static inline op_cpu op_cpu_specific_type(op_cpu cpu_type)
d5df0a
 		case 0x4e:
d5df0a
 		case 0x5e:
d5df0a
 		case 0x55:
d5df0a
+		case 0x8e:
d5df0a
+		case 0x9e:
d5df0a
 			return CPU_SKYLAKE;
d5df0a
 		case 0x37:
d5df0a
 		case 0x4d: