diff options
| author | Luke Parkin <luke.parkin@arm.com> | 2024-08-05 14:10:09 +0100 |
|---|---|---|
| committer | Sudeep Holla <sudeep.holla@arm.com> | 2024-08-09 14:21:11 +0100 |
| commit | 1b18d4295f9d1125bc7a799fc12924cd45fc04b1 (patch) | |
| tree | 8f63c8365dc2983529dcc8533ae52bd70de6b6ec /drivers/firmware/arm_scmi/common.h | |
| parent | 20c9234d623cc54caed843739c1f89b305eb3bfa (diff) | |
firmware: arm_scmi: Add support for debug metrics at the interface
Since SCMI involves interaction with the entity(software, firmware and/or
hardware) providing services or features, it is quite useful to track
certain metrics(for pure debugging purposes) like how many messages were
sent or received, were there any failures, what kind of failures, ..etc.
Add a new optional config option for the above purpose and the initial
support for counting such key debug metrics.
Signed-off-by: Luke Parkin <luke.parkin@arm.com>
Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Tested-by: Cristian Marussi <cristian.marussi@arm.com>
Message-Id: <20240805131013.587016-3-sudeep.holla@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Diffstat (limited to 'drivers/firmware/arm_scmi/common.h')
| -rw-r--r-- | drivers/firmware/arm_scmi/common.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/firmware/arm_scmi/common.h b/drivers/firmware/arm_scmi/common.h index 4b8c5250cdb5..d414b0a43b3b 100644 --- a/drivers/firmware/arm_scmi/common.h +++ b/drivers/firmware/arm_scmi/common.h @@ -301,6 +301,16 @@ extern const struct scmi_desc scmi_optee_desc; void scmi_rx_callback(struct scmi_chan_info *cinfo, u32 msg_hdr, void *priv); +enum debug_counters { + SCMI_DEBUG_COUNTERS_LAST +}; + +static inline void scmi_inc_count(atomic_t *arr, int stat) +{ + if (IS_ENABLED(CONFIG_ARM_SCMI_DEBUG_COUNTERS)) + atomic_inc(&arr[stat]); +} + enum scmi_bad_msg { MSG_UNEXPECTED = -1, MSG_INVALID = -2, |
