Thread (1 message) 1 message, 1 author, 2011-06-18

Re: [PATCH 04/14] SIWv2: Module initialization: siw_main.c

From: Bart Van Assche <hidden>
Date: 2011-06-18 17:39:11
Also in: linux-rdma

On Thu, Jun 16, 2011 at 2:42 PM, Bernard Metzler [off-list ref] wrote:
quoted hunk
---
 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 majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help