lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zqop6qq0jibefw0g@bogus>
Date: Wed, 31 Jul 2024 13:11:22 +0100
From: Sudeep Holla <sudeep.holla@....com>
To: Luke Parkin <luke.parkin@....com>,
	Cristian Marussi <cristian.marussi@....com>
Cc: linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
	arm-scmi@...r.kernel.org, cristian.marussi@....com
Subject: Re: [PATCH v4 4/5] firmware: arm_scmi: Create debugfs files for
 counts

On Tue, Jul 30, 2024 at 10:33:41AM +0100, Luke Parkin wrote:
> Create debugfs files for the metrics in the debug_counters array
> 
> Signed-off-by: Luke Parkin <luke.parkin@....com>
> ---
> v3->v4
> Use new locations for debug array
> Use counter instead of stats
> v2->v3
> Add extra statistics also added in v3
> v1->v2
> Only create stats pointer if stats are enabled
> Move stats debugfs creation into a seperate helper function
> ---
>  drivers/firmware/arm_scmi/driver.c | 38 ++++++++++++++++++++++++++++++
>  1 file changed, 38 insertions(+)
> 
> diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c
> index 5acd3d324def..ec6434692d1a 100644
> --- a/drivers/firmware/arm_scmi/driver.c
> +++ b/drivers/firmware/arm_scmi/driver.c
> @@ -2847,6 +2847,41 @@ static int scmi_device_request_notifier(struct notifier_block *nb,
>  	return NOTIFY_OK;
>  }
>  
> +static void scmi_debugfs_counters_setup(struct scmi_debug_info *dbg,
> +					struct dentry *trans)
> +{
> +	struct dentry *counters;
> +
> +	counters = debugfs_create_dir("counters", trans);
> +
> +	debugfs_create_atomic_t("sent_ok", 0400, counters,
> +				&dbg->counters[SENT_OK]);
> +	debugfs_create_atomic_t("sent_fail", 0400, counters,
> +				&dbg->counters[SENT_FAIL]);
> +	debugfs_create_atomic_t("sent_fail_polling_unsupported", 0400, counters,
> +				&dbg->counters[SENT_FAIL_POLLING_UNSUPPORTED]);
> +	debugfs_create_atomic_t("sent_fail_channel_not_found", 0400, counters,
> +				&dbg->counters[SENT_FAIL_CHANNEL_NOT_FOUND]);
> +	debugfs_create_atomic_t("response_ok", 0400, counters,
> +				&dbg->counters[RESPONSE_OK]);
> +	debugfs_create_atomic_t("notif_ok", 0400, counters,
> +				&dbg->counters[NOTIF_OK]);
> +	debugfs_create_atomic_t("dlyd_resp_ok", 0400, counters,
> +				&dbg->counters[DLYD_RESPONSE_OK]);
> +	debugfs_create_atomic_t("xfers_resp_timeout", 0400, counters,
> +				&dbg->counters[XFERS_RESPONSE_TIMEOUT]);
> +	debugfs_create_atomic_t("response_polled_ok", 0400, counters,
> +				&dbg->counters[RESPONSE_POLLED_OK]);
> +	debugfs_create_atomic_t("err_msg_unexpected", 0400, counters,
> +				&dbg->counters[ERR_MSG_UNEXPECTED]);
> +	debugfs_create_atomic_t("err_msg_invalid", 0400, counters,
> +				&dbg->counters[ERR_MSG_INVALID]);
> +	debugfs_create_atomic_t("err_msg_nomem", 0400, counters,
> +				&dbg->counters[ERR_MSG_NOMEM]);
> +	debugfs_create_atomic_t("err_protocol", 0400, counters,
> +				&dbg->counters[ERR_PROTOCOL]);

Just curious and wonder if we can keep all these read-only and have another
debugfs file which is write only to just reset the counters ?

Cristian,

Thoughts ? Or am I missing somthing ?

-- 
Regards,
Sudeep

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ