On Thu, Jun 16, 2011 at 2:42 PM, Bernard Metzler <b...@zurich.ibm.com> wrote:
> ---
>  drivers/infiniband/hw/siw/siw_main.c |  603 
> ++++++++++++++++++++++++++++++++++
>  1 files changed, 603 insertions(+), 0 deletions(-)
>  create mode 100644 drivers/infiniband/hw/siw/siw_main.c
>
> diff --git a/drivers/infiniband/hw/siw/siw_main.c 
> b/drivers/infiniband/hw/siw/siw_main.c
> [ ... ]
> +static ssize_t show_stats(struct device *dev,
> +                         struct device_attribute *attr, char *buf)
> +{
> +       struct siw_dev *siw_dev = container_of(dev, struct siw_dev,
> +                                              ofa_dev.dev);
> +
> +       return sprintf(buf, "Allocated SIW Objects:\n"
> +#if DPRINT_MASK > 0
> +                       "Global     :\t%s: %d\n"
> +#endif
> +                       "Device %s:\t"
> +                       "%s: %d, %s: %d, %s: %d, %s: %d, %s: %d, %s: %d\n",
> +#if DPRINT_MASK > 0
> +                       "WQEs", atomic_read(&siw_num_wqe),
> +#endif
> +                       siw_dev->ofa_dev.name,
> +                       "PDs", atomic_read(&siw_dev->num_pd),
> +                       "QPs", atomic_read(&siw_dev->num_qp),
> +                       "CQs", atomic_read(&siw_dev->num_cq),
> +                       "SRQs", atomic_read(&siw_dev->num_srq),
> +                       "MRs", atomic_read(&siw_dev->num_mem),
> +                       "CEPs", atomic_read(&siw_dev->num_cep));
> +}

The rules for sysfs, documented in Documentation/ABI/README, are:
- One value per file.
- All new sysfs attributes must be documented in Documentation/ABI.

An alternative to following the above rules is moving attributes from
sysfs to debugfs.

Bart.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to