Re: [RFC PATCH 6/9] net: dsa: hellcreek: Add debugging mechanisms

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jun 18, 2020 at 08:40:26AM +0200, Kurt Kanzenbach wrote:
> The switch has registers which are useful for debugging issues:

debugfs is not particularly likes. Please try to find other means
where possible. Memory usage fits nicely into devlink. See mv88e6xxx
which exports the ATU fill for example. Are trace registers counters?

> +static int hellcreek_debugfs_init(struct hellcreek *hellcreek)
> +{
> +	struct dentry *file;
> +
> +	hellcreek->debug_dir = debugfs_create_dir(dev_name(hellcreek->dev),
> +						  NULL);
> +	if (!hellcreek->debug_dir)
> +		return -ENOMEM;

Just a general comment. You should not check the return value from any
debugfs call, since it is totally optional. It will also do the right
thing if the previous call has failed. There are numerous emails from
GregKH about this.

       Andrew



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux