Lines Matching full:sampling

3  * Performance event support for the System z CPU-measurement Sampling Facility
28 * At least one table is required for the sampling buffer structure.
49 /* Minimum and maximum sampling buffer sizes:
51 * This number represents the maximum size of the sampling buffer taking
53 * numbers apply to the basic-sampling function only.
55 * the diagnostic-sampling function is active.
57 * Sampling buffer size Buffer characteristics
89 /* CPU-measurement sampling information block */
91 /* CPU-measurement sampling control block */
93 struct sf_buffer sfb; /* Sampling buffer */
103 /* Sampling control helper functions */
155 * sf_disable() - Switch off sampling facility
166 * sf_buffer_available() - Check for an allocated sampling buffer
174 * deallocate sampling facility buffer
197 /* If the origin is reached, sampling buffer is freed */ in free_sampling_buffer()
237 * Allocates new sample-data-blocks and adds them to the specified sampling
240 * Important: This modifies the sampling buffer and must be called when the
241 * sampling facility is disabled.
257 /* Append to the existing sampling buffer, overwriting the table-link in realloc_sampling_buffer()
265 * the sampling buffer origin. in realloc_sampling_buffer()
269 "sampling buffer is not linked: origin %#lx" in realloc_sampling_buffer()
317 /* Link sampling buffer to its origin */ in realloc_sampling_buffer()
330 * Allocates and initializes a sampling buffer structure using the
431 /* Calculate sampling buffers using 4K pages in allocate_buffers()
433 * 1. The sampling size is 32 bytes for basic sampling. This size in allocate_buffers()
435 * sampling uses auxlilary data buffer setup which provides the in allocate_buffers()
449 * 3. Use the sampling frequency as input. in allocate_buffers()
452 * SDBs to handle a higher sampling rate. in allocate_buffers()
464 /* If there is already a sampling buffer allocated, it is very likely in allocate_buffers()
465 * that the sampling facility is enabled too. If the event to be in allocate_buffers()
466 * initialized requires a greater sampling buffer, the allocation must in allocate_buffers()
467 * be postponed. Changing the sampling buffer requires the sampling in allocate_buffers()
494 /* Use a percentage-based approach to extend the sampling facility in compute_sfb_extent()
543 /* extend_sampling_buffer() - Extend sampling buffer
544 * @sfb: Sampling buffer structure (for local CPU)
547 * Use this function to extend the sampling buffer based on the overflow counter
550 * Important: This function disables the sampling facility in order to safely
551 * change the sampling buffer structure. Do not call this function
565 /* Disable the sampling facility to reset any states and also in extend_sampling_buffer()
570 /* Extend the sampling buffer. in extend_sampling_buffer()
618 pr_err("Switching off the sampling facility failed with rc %i\n", err); in setup_pmc_cpu()
708 * Obtain the PID from the basic-sampling data entry and in cpumsf_output_event_pid()
740 /* The min/max sampling rates specifies the valid range in getrate()
748 * sampling rate does not exceed this value. This also helps in getrate()
755 "Sampling rate exceeds maximum " in getrate()
763 /* The sampling information (si) contains information about the
764 * min/max sampling intervals and the CPU speed. So calculate the
765 * correct sampling interval and avoid the whole period adjust
768 * Since the CPU Measurement sampling facility can not handle frequency
769 * calculate the sampling interval when frequency is specified using
774 * set to the correct sampling rate.
815 /* Reserve CPU-measurement sampling facility */ in __hw_perf_event_init()
830 /* Access per-CPU sampling information (query sampling info) */ in __hw_perf_event_init()
834 * sampling info from the current CPU, otherwise use event->cpu to in __hw_perf_event_init()
836 * Later, cpuhw indicates whether to allocate sampling buffers for a in __hw_perf_event_init()
845 * sampling structure for accessing the CPU-specific QSI. in __hw_perf_event_init()
851 /* Check sampling facility authorization and, if not authorized, in __hw_perf_event_init()
861 pr_warn("CPU Measurement Facility sampling is temporarily not available\n"); in __hw_perf_event_init()
866 /* Always enable basic sampling */ in __hw_perf_event_init()
869 /* Check if diagnostic sampling is requested. Deny if the required in __hw_perf_event_init()
870 * sampling authorization is missing. in __hw_perf_event_init()
892 /* Allocate the per-CPU sampling buffer using the CPU information in __hw_perf_event_init()
894 * CPU (event->cpu == -1; or cpuhw == NULL), allocate sampling in __hw_perf_event_init()
901 /* Event is not pinned, allocate sampling buffer on in __hw_perf_event_init()
912 /* If PID/TID sampling is active, replace the default overflow in __hw_perf_event_init()
913 * handler to extract and resolve the PIDs from the basic-sampling in __hw_perf_event_init()
935 /* No support for taken branch sampling */ in cpumsf_pmu_event_init()
947 /* Support sampling of CPU cycles in addition to the in cpumsf_pmu_event_init()
950 * sampling events only. in cpumsf_pmu_event_init()
988 /* Check whether to extent the sampling buffer. in cpumsf_pmu_enable()
990 * Two conditions trigger an increase of the sampling buffer for a in cpumsf_pmu_enable()
993 * 2. Sampling overflows that contribute to pending allocations. in cpumsf_pmu_enable()
995 * Note that the extend_sampling_buffer() function disables the sampling in cpumsf_pmu_enable()
996 * facility, but it can be fully re-enabled using sampling controls that in cpumsf_pmu_enable()
1013 /* (Re)enable the PMU and sampling facility */ in cpumsf_pmu_enable()
1020 pr_err("Loading sampling controls failed: op 1 err %i\n", err); in cpumsf_pmu_enable()
1047 /* Switch off sampling activation control */ in cpumsf_pmu_disable()
1054 pr_err("Loading sampling controls failed: op 2 err %i\n", err); in cpumsf_pmu_disable()
1061 /* TEAR/DEAR values are valid only if the sampling facility is in cpumsf_pmu_disable()
1063 * for a disabled sampling facility because cpumsf_pmu_enable() in cpumsf_pmu_disable()
1190 * Walks through a sample-data-block and collects sampling data entries that are
1191 * then pushed to the perf event subsystem. Depending on the sampling function,
1192 * there can be either basic-sampling or combined-sampling data entries. A
1193 * combined-sampling data entry consists of a basic- and a diagnostic-sampling
1194 * data entry. The sampling function is determined by the flags in the perf
1195 * event hardware structure. The function always works with a combined-sampling
1198 * Note that the implementation focuses on basic-sampling data entries and, if
1199 * such an entry is not valid, the entire combined-sampling data entry is
1240 " sampling data entry: te->f %i" in hw_collect_samples()
1246 * from a combined basic- and diagnostic-sampling. in hw_collect_samples()
1247 * If only basic-sampling is then active, entries are in hw_collect_samples()
1263 /* hw_perf_event_update() - Process sampling buffer
1267 * Processes the sampling buffer and create perf event samples.
1268 * The sampling buffer position are retrieved and saved in the TEAR_REG
1284 * AUX buffer is used when in diagnostic sampling mode. in hw_perf_event_update()
1307 * is reached, extend the sampling buffer. in hw_perf_event_update()
1415 * Finish sampling on the cpu. Called by cpumsf_pmu_del() with pmu
1451 * Start sampling on the CPU. Called by cpumsf_pmu_add() when an event
1633 * Measurement alert handler for diagnostic mode sampling.
1660 "diagnostic-sampling mode is full\n", in hw_collect_aux()
1738 * aux_buffer_setup() - Setup AUX buffer for diagnostic mode sampling
1764 "maximum sampling buffer limit\n", in aux_buffer_setup()
1769 "minimum sampling buffer limit\n", in aux_buffer_setup()
1854 /* Check if the new sampling period/frequency is appropriate.
1870 * sampling structure for accessing the CPU-specific QSI. in cpumsf_pmu_check_period()
1892 /* Activate sampling control.
1893 * Next call of pmu_enable() starts sampling.
1909 /* Deactivate sampling control.
1910 * Next call of pmu_enable() stops sampling.
1950 /* Set up sampling controls. Always program the sampling register in cpumsf_pmu_add()
1952 * that is used by hw_perf_event_update() to store the sampling buffer in cpumsf_pmu_add()
1964 /* Ensure sampling functions are in the disabled state. If disabled, in cpumsf_pmu_add()
1965 * switch on sampling enable control. */ in cpumsf_pmu_add()
2018 * The availablitiy depends on the CPU_MF sampling facility authorization
2020 * time by the sampling facility device driver.
2022 * also turned off for diagnostic sampling.
2025 * level for diagnostic sampling and installs the attribute
2026 * file for diagnostic sampling if necessary.
2119 /* Sampling authorization change request */ in cpumf_measurement_alert()
2130 /* Invalid sampling buffer entry */ in cpumf_measurement_alert()
2132 pr_err("A sampling buffer entry is incorrect (alert=0x%x)\n", in cpumf_measurement_alert()
2194 pr_info("The sampling buffer limits have changed to: " in param_set_sfb_size()
2212 pr_err("Sampling facility support for perf is not available: " in pr_cpumsf_err()
2240 /* Sampling of diagnostic data authorized, in init_cpum_sampling_pmu()