fw_counters = kmalloc(struct_size(fw_counters, ae_counters, ae_count), GFP_KERNEL); if (!fw_counters) return ERR_PTR(-ENOMEM);
fw_counters->ae_count = ae_count;
return fw_counters;
}
/** * adf_fw_counters_get() - Return FW counters for the provided device. * @accel_dev: Pointer to a QAT acceleration device * * Allocates and returns a table of counters containing execution statistics * for each non-admin AE available through the supplied acceleration device. * The caller becomes the owner of such memory and is responsible for * the deallocation through a call to kfree(). * * Returns: a pointer to a dynamically allocated struct adf_fw_counters * on success, or a negative value on error.
*/ staticstruct adf_fw_counters *adf_fw_counters_get(struct adf_accel_dev *accel_dev)
{ struct adf_hw_device_data *hw_data = GET_HW_DATA(accel_dev); struct adf_fw_counters *fw_counters; unsignedlong ae_count; int ret;
if (!adf_dev_started(accel_dev)) {
dev_err(&GET_DEV(accel_dev), "QAT Device not started\n"); return ERR_PTR(-EFAULT);
}
/** * adf_fw_counters_dbgfs_add() - Create a debugfs file containing FW * execution counters. * @accel_dev: Pointer to a QAT acceleration device * * Function creates a file to display a table with statistics for the given * QAT acceleration device. The table stores device specific execution values * for each AE, such as the number of requests sent to the FW and responses * received from the FW. * * Return: void
*/ void adf_fw_counters_dbgfs_add(struct adf_accel_dev *accel_dev)
{
accel_dev->fw_cntr_dbgfile = debugfs_create_file("fw_counters", 0400,
accel_dev->debugfs_dir,
accel_dev,
&qat_fw_counters_fops);
}
/** * adf_fw_counters_dbgfs_rm() - Remove the debugfs file containing FW counters. * @accel_dev: Pointer to a QAT acceleration device. * * Function removes the file providing the table of statistics for the given * QAT acceleration device. * * Return: void
*/ void adf_fw_counters_dbgfs_rm(struct adf_accel_dev *accel_dev)
{
debugfs_remove(accel_dev->fw_cntr_dbgfile);
accel_dev->fw_cntr_dbgfile = NULL;
}
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.