Lines Matching full:sampling
3 * Performance event support for the System z CPU-measurement Sampling Facility
27 * At least one table is required for the sampling buffer structure.
48 /* Minimum and maximum sampling buffer sizes:
50 * This number represents the maximum size of the sampling buffer taking
52 * numbers apply to the basic-sampling function only.
54 * the diagnostic-sampling function is active.
56 * Sampling buffer size Buffer characteristics
88 /* CPU-measurement sampling information block */
90 /* CPU-measurement sampling control block */
92 struct sf_buffer sfb; /* Sampling buffer */
103 * sf_disable() - Switch off sampling facility
114 * sf_buffer_available() - Check for an allocated sampling buffer
122 * deallocate sampling facility buffer
145 /* If the origin is reached, sampling buffer is freed */ in free_sampling_buffer()
184 * Allocates new sample-data-blocks and adds them to the specified sampling
187 * Important: This modifies the sampling buffer and must be called when the
188 * sampling facility is disabled.
204 /* Append to the existing sampling buffer, overwriting the table-link in realloc_sampling_buffer()
212 * the sampling buffer origin. in realloc_sampling_buffer()
216 "sampling buffer is not linked: origin %#lx" in realloc_sampling_buffer()
264 /* Link sampling buffer to its origin */ in realloc_sampling_buffer()
277 * Allocates and initializes a sampling buffer structure using the
378 /* Calculate sampling buffers using 4K pages in allocate_buffers()
380 * 1. The sampling size is 32 bytes for basic sampling. This size in allocate_buffers()
382 * sampling uses auxlilary data buffer setup which provides the in allocate_buffers()
396 * 3. Use the sampling frequency as input. in allocate_buffers()
399 * SDBs to handle a higher sampling rate. in allocate_buffers()
411 /* If there is already a sampling buffer allocated, it is very likely in allocate_buffers()
412 * that the sampling facility is enabled too. If the event to be in allocate_buffers()
413 * initialized requires a greater sampling buffer, the allocation must in allocate_buffers()
414 * be postponed. Changing the sampling buffer requires the sampling in allocate_buffers()
441 /* Use a percentage-based approach to extend the sampling facility in compute_sfb_extent()
490 /* extend_sampling_buffer() - Extend sampling buffer
491 * @sfb: Sampling buffer structure (for local CPU)
494 * Use this function to extend the sampling buffer based on the overflow counter
497 * Important: This function disables the sampling facility in order to safely
498 * change the sampling buffer structure. Do not call this function
512 /* Disable the sampling facility to reset any states and also in extend_sampling_buffer()
517 /* Extend the sampling buffer. in extend_sampling_buffer()
557 pr_err("Switching off the sampling facility failed " in setup_pmc_cpu()
567 pr_err("Switching off the sampling facility failed " in setup_pmc_cpu()
666 * Obtain the PID from the basic-sampling data entry and in cpumsf_output_event_pid()
697 /* The min/max sampling rates specifies the valid range in getrate()
705 * sampling rate does not exceed this value. This also helps in getrate()
712 "Sampling rate exceeds maximum " in getrate()
720 /* The sampling information (si) contains information about the
721 * min/max sampling intervals and the CPU speed. So calculate the
722 * correct sampling interval and avoid the whole period adjust
725 * Since the CPU Measurement sampling facility can not handle frequency
726 * calculate the sampling interval when frequency is specified using
731 * set to the correct sampling rate.
772 /* Reserve CPU-measurement sampling facility */ in __hw_perf_event_init()
787 /* Access per-CPU sampling information (query sampling info) */ in __hw_perf_event_init()
791 * sampling info from the current CPU, otherwise use event->cpu to in __hw_perf_event_init()
793 * Later, cpuhw indicates whether to allocate sampling buffers for a in __hw_perf_event_init()
802 * sampling structure for accessing the CPU-specific QSI. in __hw_perf_event_init()
808 /* Check sampling facility authorization and, if not authorized, in __hw_perf_event_init()
818 pr_warn("CPU Measurement Facility sampling is temporarily not available\n"); in __hw_perf_event_init()
823 /* Always enable basic sampling */ in __hw_perf_event_init()
826 /* Check if diagnostic sampling is requested. Deny if the required in __hw_perf_event_init()
827 * sampling authorization is missing. in __hw_perf_event_init()
837 /* Check and set other sampling flags */ in __hw_perf_event_init()
853 /* Allocate the per-CPU sampling buffer using the CPU information in __hw_perf_event_init()
855 * CPU (event->cpu == -1; or cpuhw == NULL), allocate sampling in __hw_perf_event_init()
862 /* Event is not pinned, allocate sampling buffer on in __hw_perf_event_init()
873 /* If PID/TID sampling is active, replace the default overflow in __hw_perf_event_init()
874 * handler to extract and resolve the PIDs from the basic-sampling in __hw_perf_event_init()
896 /* No support for taken branch sampling */ in cpumsf_pmu_event_init()
908 /* Support sampling of CPU cycles in addition to the in cpumsf_pmu_event_init()
911 * sampling events only. in cpumsf_pmu_event_init()
953 /* Check whether to extent the sampling buffer. in cpumsf_pmu_enable()
955 * Two conditions trigger an increase of the sampling buffer for a in cpumsf_pmu_enable()
958 * 2. Sampling overflows that contribute to pending allocations. in cpumsf_pmu_enable()
960 * Note that the extend_sampling_buffer() function disables the sampling in cpumsf_pmu_enable()
961 * facility, but it can be fully re-enabled using sampling controls that in cpumsf_pmu_enable()
978 /* (Re)enable the PMU and sampling facility */ in cpumsf_pmu_enable()
985 pr_err("Loading sampling controls failed: op %i err %i\n", in cpumsf_pmu_enable()
1013 /* Switch off sampling activation control */ in cpumsf_pmu_disable()
1020 pr_err("Loading sampling controls failed: op %i err %i\n", in cpumsf_pmu_disable()
1028 /* TEAR/DEAR values are valid only if the sampling facility is in cpumsf_pmu_disable()
1030 * for a disabled sampling facility because cpumsf_pmu_enable() in cpumsf_pmu_disable()
1157 * Walks through a sample-data-block and collects sampling data entries that are
1158 * then pushed to the perf event subsystem. Depending on the sampling function,
1159 * there can be either basic-sampling or combined-sampling data entries. A
1160 * combined-sampling data entry consists of a basic- and a diagnostic-sampling
1161 * data entry. The sampling function is determined by the flags in the perf
1162 * event hardware structure. The function always works with a combined-sampling
1165 * Note that the implementation focuses on basic-sampling data entries and, if
1166 * such an entry is not valid, the entire combined-sampling data entry is
1207 " sampling data entry: te->f %i" in hw_collect_samples()
1213 * from a combined basic- and diagnostic-sampling. in hw_collect_samples()
1214 * If only basic-sampling is then active, entries are in hw_collect_samples()
1230 /* hw_perf_event_update() - Process sampling buffer
1234 * Processes the sampling buffer and create perf event samples.
1235 * The sampling buffer position are retrieved and saved in the TEAR_REG
1253 * AUX buffer is used when in diagnostic sampling mode. in hw_perf_event_update()
1278 * is reached, extend the sampling buffer. in hw_perf_event_update()
1366 * Finish sampling on the cpu. Called by cpumsf_pmu_del() with pmu
1402 * Start sampling on the CPU. Called by cpumsf_pmu_add() when an event
1581 * Measurement alert handler for diagnostic mode sampling.
1608 "diagnostic-sampling mode is full\n", in hw_collect_aux()
1689 * aux_buffer_setup() - Setup AUX buffer for diagnostic mode sampling
1715 "maximum sampling buffer limit\n", in aux_buffer_setup()
1720 "minimum sampling buffer limit\n", in aux_buffer_setup()
1805 /* Check if the new sampling period/freqeuncy is appropriate.
1821 * sampling structure for accessing the CPU-specific QSI. in cpumsf_pmu_check_period()
1843 /* Activate sampling control.
1844 * Next call of pmu_enable() starts sampling.
1864 /* Deactivate sampling control.
1865 * Next call of pmu_enable() stops sampling.
1903 /* Set up sampling controls. Always program the sampling register in cpumsf_pmu_add()
1905 * that is used by hw_perf_event_update() to store the sampling buffer in cpumsf_pmu_add()
1917 /* Ensure sampling functions are in the disabled state. If disabled, in cpumsf_pmu_add()
1918 * switch on sampling enable control. */ in cpumsf_pmu_add()
1971 * The availablitiy depends on the CPU_MF sampling facility authorization
1973 * time by the sampling facility device driver.
1975 * also turned off for diagnostic sampling.
1978 * level for diagnostic sampling and installs the attribute
1979 * file for diagnostic sampling if necessary.
2072 /* Sampling authorization change request */ in cpumf_measurement_alert()
2083 /* Invalid sampling buffer entry */ in cpumf_measurement_alert()
2085 pr_err("A sampling buffer entry is incorrect (alert=0x%x)\n", in cpumf_measurement_alert()
2147 pr_info("The sampling buffer limits have changed to: " in param_set_sfb_size()
2165 pr_err("Sampling facility support for perf is not available: " in pr_cpumsf_err()
2193 /* Sampling of diagnostic data authorized, in init_cpum_sampling_pmu()