linux/drivers/accel/ivpu/ivpu_sysfs.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (C) 2024 Intel Corporation
 */

#include <linux/device.h>
#include <linux/err.h>

#include "ivpu_hw.h"
#include "ivpu_sysfs.h"

/*
 * 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)
{}

static DEVICE_ATTR_RO(npu_busy_time_us);

static struct attribute *ivpu_dev_attrs[] =;

static struct attribute_group ivpu_dev_attr_group =;

void ivpu_sysfs_init(struct ivpu_device *vdev)
{}