/** * DOC: npu_busy_time_us * * npu_busy_time_us is the time that the device spent executing jobs. * The time is counted when and only when there are jobs submitted to firmware. * * This time can be used to measure the utilization of NPU, either by calculating * npu_busy_time_us difference between two timepoints (i.e. measuring the time * that the NPU was active during some workload) or monitoring utilization percentage * by reading npu_busy_time_us periodically. * * When reading the value periodically, it shouldn't be read too often as it may have * an impact on job submission performance. Recommended period is 1 second.
*/ static ssize_t
npu_busy_time_us_show(struct device *dev, struct device_attribute *attr, char *buf)
{ struct drm_device *drm = dev_get_drvdata(dev); struct ivpu_device *vdev = to_ivpu_device(drm);
ktime_t total, now = 0;
mutex_lock(&vdev->submitted_jobs_lock);
total = vdev->busy_time; if (!xa_empty(&vdev->submitted_jobs_xa))
now = ktime_sub(ktime_get(), vdev->busy_start_ts);
mutex_unlock(&vdev->submitted_jobs_lock);
/** * DOC: npu_current_frequency_mhz * * The npu_current_frequency_mhz shows current frequency in MHz of the NPU's * data processing unit
*/ static ssize_t
npu_current_frequency_mhz_show(struct device *dev, struct device_attribute *attr, char*buf)
{ struct drm_device *drm = dev_get_drvdata(dev); struct ivpu_device *vdev = to_ivpu_device(drm);
u32 freq = 0;
/* Read frequency only if device is active, otherwise frequency is 0 */ if (pm_runtime_get_if_active(vdev->drm.dev) > 0) {
freq = ivpu_hw_dpu_freq_get(vdev);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.