Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 
0003 #include "req-gen/_begin.h"
0004 
0005 /*
0006  * Based on the document "getPerfCountInfo v1.07"
0007  */
0008 
0009 /*
0010  * #define REQUEST_NAME counter_request_name
0011  * #define REQUEST_NUM r_num
0012  * #define REQUEST_IDX_KIND starting_index_kind
0013  * #include I(REQUEST_BEGIN)
0014  * REQUEST(
0015  *  __field(...)
0016  *  __field(...)
0017  *  __array(...)
0018  *  __count(...)
0019  * )
0020  * #include I(REQUEST_END)
0021  *
0022  * - starting_index_kind is one of the following, depending on the event:
0023  *
0024  *   hw_chip_id: hardware chip id or -1 for current hw chip
0025  *   partition_id
0026  *   sibling_part_id,
0027  *   phys_processor_idx:
0028  *   0xffffffffffffffff: or -1, which means it is irrelavant for the event
0029  *
0030  * __count(offset, bytes, name):
0031  *  a counter that should be exposed via perf
0032  * __field(offset, bytes, name)
0033  *  a normal field
0034  * __array(offset, bytes, name)
0035  *  an array of bytes
0036  *
0037  *
0038  *  @bytes for __count, and __field _must_ be a numeral token
0039  *  in decimal, not an expression and not in hex.
0040  *
0041  *
0042  * TODO:
0043  *  - expose secondary index (if any counter ever uses it, only 0xA0
0044  *    appears to use it right now, and it doesn't have any counters)
0045  *  - embed versioning info
0046  *  - include counter descriptions
0047  */
0048 #define REQUEST_NAME dispatch_timebase_by_processor
0049 #define REQUEST_NUM 0x10
0050 #define REQUEST_IDX_KIND "phys_processor_idx=?"
0051 #include I(REQUEST_BEGIN)
0052 REQUEST(__count(0,  8,  processor_time_in_timebase_cycles)
0053     __field(0x8,    4,  hw_processor_id)
0054     __field(0xC,    2,  owning_part_id)
0055     __field(0xE,    1,  processor_state)
0056     __field(0xF,    1,  version)
0057     __field(0x10,   4,  hw_chip_id)
0058     __field(0x14,   4,  phys_module_id)
0059     __field(0x18,   4,  primary_affinity_domain_idx)
0060     __field(0x1C,   4,  secondary_affinity_domain_idx)
0061     __field(0x20,   4,  processor_version)
0062     __field(0x24,   2,  logical_processor_idx)
0063     __field(0x26,   2,  reserved)
0064     __field(0x28,   4,  processor_id_register)
0065     __field(0x2C,   4,  phys_processor_idx)
0066 )
0067 #include I(REQUEST_END)
0068 
0069 #define REQUEST_NAME entitled_capped_uncapped_donated_idle_timebase_by_partition
0070 #define REQUEST_NUM 0x20
0071 #define REQUEST_IDX_KIND "sibling_part_id=?"
0072 #include I(REQUEST_BEGIN)
0073 REQUEST(__field(0,  8,  partition_id)
0074     __count(0x8,    8,  entitled_cycles)
0075     __count(0x10,   8,  consumed_capped_cycles)
0076     __count(0x18,   8,  consumed_uncapped_cycles)
0077     __count(0x20,   8,  cycles_donated)
0078     __count(0x28,   8,  purr_idle_cycles)
0079 )
0080 #include I(REQUEST_END)
0081 
0082 /*
0083  * Not available for counter_info_version >= 0x8, use
0084  * run_instruction_cycles_by_partition(0x100) instead.
0085  */
0086 #define REQUEST_NAME run_instructions_run_cycles_by_partition
0087 #define REQUEST_NUM 0x30
0088 #define REQUEST_IDX_KIND "sibling_part_id=?"
0089 #include I(REQUEST_BEGIN)
0090 REQUEST(__field(0,  8,  partition_id)
0091     __count(0x8,    8,  instructions_completed)
0092     __count(0x10,   8,  cycles)
0093 )
0094 #include I(REQUEST_END)
0095 
0096 #define REQUEST_NAME system_performance_capabilities
0097 #define REQUEST_NUM 0x40
0098 #define REQUEST_IDX_KIND "starting_index=0xffffffff"
0099 #include I(REQUEST_BEGIN)
0100 REQUEST(__field(0,  1,  perf_collect_privileged)
0101     __field(0x1,    1,  capability_mask)
0102     __array(0x2,    0xE,    reserved)
0103 )
0104 #include I(REQUEST_END)
0105 
0106 #define REQUEST_NAME processor_bus_utilization_abc_links
0107 #define REQUEST_NUM 0x50
0108 #define REQUEST_IDX_KIND "hw_chip_id=?"
0109 #include I(REQUEST_BEGIN)
0110 REQUEST(__field(0,  4,  hw_chip_id)
0111     __array(0x4,    0xC,    reserved1)
0112     __count(0x10,   8,  total_link_cycles)
0113     __count(0x18,   8,  idle_cycles_for_a_link)
0114     __count(0x20,   8,  idle_cycles_for_b_link)
0115     __count(0x28,   8,  idle_cycles_for_c_link)
0116     __array(0x30,   0x20,   reserved2)
0117 )
0118 #include I(REQUEST_END)
0119 
0120 #define REQUEST_NAME processor_bus_utilization_wxyz_links
0121 #define REQUEST_NUM 0x60
0122 #define REQUEST_IDX_KIND "hw_chip_id=?"
0123 #include I(REQUEST_BEGIN)
0124 REQUEST(__field(0,  4,  hw_chip_id)
0125     __array(0x4,    0xC,    reserved1)
0126     __count(0x10,   8,  total_link_cycles)
0127     __count(0x18,   8,  idle_cycles_for_w_link)
0128     __count(0x20,   8,  idle_cycles_for_x_link)
0129     __count(0x28,   8,  idle_cycles_for_y_link)
0130     __count(0x30,   8,  idle_cycles_for_z_link)
0131     __array(0x38,   0x28,   reserved2)
0132 )
0133 #include I(REQUEST_END)
0134 
0135 #define REQUEST_NAME processor_bus_utilization_gx_links
0136 #define REQUEST_NUM 0x70
0137 #define REQUEST_IDX_KIND "hw_chip_id=?"
0138 #include I(REQUEST_BEGIN)
0139 REQUEST(__field(0,  4,  hw_chip_id)
0140     __array(0x4,    0xC,    reserved1)
0141     __count(0x10,   8,  gx0_in_address_cycles)
0142     __count(0x18,   8,  gx0_in_data_cycles)
0143     __count(0x20,   8,  gx0_in_retries)
0144     __count(0x28,   8,  gx0_in_bus_cycles)
0145     __count(0x30,   8,  gx0_in_cycles_total)
0146     __count(0x38,   8,  gx0_out_address_cycles)
0147     __count(0x40,   8,  gx0_out_data_cycles)
0148     __count(0x48,   8,  gx0_out_retries)
0149     __count(0x50,   8,  gx0_out_bus_cycles)
0150     __count(0x58,   8,  gx0_out_cycles_total)
0151     __count(0x60,   8,  gx1_in_address_cycles)
0152     __count(0x68,   8,  gx1_in_data_cycles)
0153     __count(0x70,   8,  gx1_in_retries)
0154     __count(0x78,   8,  gx1_in_bus_cycles)
0155     __count(0x80,   8,  gx1_in_cycles_total)
0156     __count(0x88,   8,  gx1_out_address_cycles)
0157     __count(0x90,   8,  gx1_out_data_cycles)
0158     __count(0x98,   8,  gx1_out_retries)
0159     __count(0xA0,   8,  gx1_out_bus_cycles)
0160     __count(0xA8,   8,  gx1_out_cycles_total)
0161 )
0162 #include I(REQUEST_END)
0163 
0164 #define REQUEST_NAME processor_bus_utilization_mc_links
0165 #define REQUEST_NUM 0x80
0166 #define REQUEST_IDX_KIND "hw_chip_id=?"
0167 #include I(REQUEST_BEGIN)
0168 REQUEST(__field(0,  4,  hw_chip_id)
0169     __array(0x4,    0xC,    reserved1)
0170     __count(0x10,   8,  mc0_frames)
0171     __count(0x18,   8,  mc0_reads)
0172     __count(0x20,   8,  mc0_write)
0173     __count(0x28,   8,  mc0_total_cycles)
0174     __count(0x30,   8,  mc1_frames)
0175     __count(0x38,   8,  mc1_reads)
0176     __count(0x40,   8,  mc1_writes)
0177     __count(0x48,   8,  mc1_total_cycles)
0178 )
0179 #include I(REQUEST_END)
0180 
0181 /* Processor_config (0x90) skipped, no counters */
0182 /* Current_processor_frequency (0x91) skipped, no counters */
0183 
0184 #define REQUEST_NAME processor_core_utilization
0185 #define REQUEST_NUM 0x94
0186 #define REQUEST_IDX_KIND "phys_processor_idx=?"
0187 #include I(REQUEST_BEGIN)
0188 REQUEST(__field(0,  4,  phys_processor_idx)
0189     __field(0x4,    4,  hw_processor_id)
0190     __count(0x8,    8,  cycles_across_any_thread)
0191     __count(0x10,   8,  timebase_at_collection)
0192     __count(0x18,   8,  purr_cycles)
0193     __count(0x20,   8,  sum_of_cycles_across_all_threads)
0194     __count(0x28,   8,  instructions_completed)
0195 )
0196 #include I(REQUEST_END)
0197 
0198 /* Processor_core_power_mode (0x95) skipped, no counters */
0199 /* Affinity_domain_information_by_virtual_processor (0xA0) skipped,
0200  *  no counters */
0201 /* Affinity_domain_information_by_domain (0xB0) skipped, no counters */
0202 /* Affinity_domain_information_by_partition (0xB1) skipped, no counters */
0203 /* Physical_memory_info (0xC0) skipped, no counters */
0204 /* Processor_bus_topology (0xD0) skipped, no counters */
0205 
0206 #define REQUEST_NAME partition_hypervisor_queuing_times
0207 #define REQUEST_NUM 0xE0
0208 #define REQUEST_IDX_KIND "partition_id=?"
0209 #include I(REQUEST_BEGIN)
0210 REQUEST(__field(0,  2, partition_id)
0211     __array(0x2,    6, reserved1)
0212     __count(0x8,    8, time_waiting_for_entitlement)
0213     __count(0x10,   8, times_waited_for_entitlement)
0214     __count(0x18,   8, time_waiting_for_phys_processor)
0215     __count(0x20,   8, times_waited_for_phys_processor)
0216     __count(0x28,   8, dispatches_on_home_core)
0217     __count(0x30,   8, dispatches_on_home_primary_affinity_domain)
0218     __count(0x38,   8, dispatches_on_home_secondary_affinity_domain)
0219     __count(0x40,   8, dispatches_off_home_secondary_affinity_domain)
0220     __count(0x48,   8, dispatches_on_dedicated_processor_donating_cycles)
0221 )
0222 #include I(REQUEST_END)
0223 
0224 #define REQUEST_NAME system_hypervisor_times
0225 #define REQUEST_NUM 0xF0
0226 #define REQUEST_IDX_KIND "starting_index=0xffffffff"
0227 #include I(REQUEST_BEGIN)
0228 REQUEST(__count(0,  8,  time_spent_to_dispatch_virtual_processors)
0229     __count(0x8,    8,  time_spent_processing_virtual_processor_timers)
0230     __count(0x10,   8,  time_spent_managing_partitions_over_entitlement)
0231     __count(0x18,   8,  time_spent_on_system_management)
0232 )
0233 #include I(REQUEST_END)
0234 
0235 #define REQUEST_NAME system_tlbie_count_and_time
0236 #define REQUEST_NUM 0xF4
0237 #define REQUEST_IDX_KIND "starting_index=0xffffffff"
0238 #include I(REQUEST_BEGIN)
0239 REQUEST(__count(0,  8,  tlbie_instructions_issued)
0240     /*
0241      * FIXME: The spec says the offset here is 0x10, which I suspect
0242      *    is wrong.
0243      */
0244     __count(0x8,    8,  time_spent_issuing_tlbies)
0245 )
0246 #include I(REQUEST_END)
0247 
0248 #define REQUEST_NAME partition_instruction_count_and_time
0249 #define REQUEST_NUM 0x100
0250 #define REQUEST_IDX_KIND "partition_id=?"
0251 #include I(REQUEST_BEGIN)
0252 REQUEST(__field(0,  2,  partition_id)
0253     __array(0x2,    0x6,    reserved1)
0254     __count(0x8,    8,  instructions_performed)
0255     __count(0x10,   8,  time_collected)
0256 )
0257 #include I(REQUEST_END)
0258 
0259 /* set_mmcrh (0x80001000) skipped, no counters */
0260 /* retrieve_hpmcx (0x80002000) skipped, no counters */
0261 
0262 #include "req-gen/_end.h"