| .. | .. |
|---|
| 66 | 66 | .release = seq_release \ |
|---|
| 67 | 67 | }; |
|---|
| 68 | 68 | |
|---|
| 69 | | -#define DEBUGFS_FILE_CREATE(name) \ |
|---|
| 70 | | -do { \ |
|---|
| 71 | | - struct dentry *ent; \ |
|---|
| 72 | | - ent = debugfs_create_file(#name , 0400, ibd->qib_ibdev_dbg, \ |
|---|
| 73 | | - ibd, &_##name##_file_ops); \ |
|---|
| 74 | | - if (!ent) \ |
|---|
| 75 | | - pr_warn("create of " #name " failed\n"); \ |
|---|
| 76 | | -} while (0) |
|---|
| 77 | | - |
|---|
| 78 | 69 | static void *_opcode_stats_seq_start(struct seq_file *s, loff_t *pos) |
|---|
| 79 | 70 | { |
|---|
| 80 | 71 | struct qib_opcode_stats_perctx *opstats; |
|---|
| .. | .. |
|---|
| 249 | 240 | |
|---|
| 250 | 241 | void qib_dbg_ibdev_init(struct qib_ibdev *ibd) |
|---|
| 251 | 242 | { |
|---|
| 243 | + struct dentry *root; |
|---|
| 252 | 244 | char name[10]; |
|---|
| 253 | 245 | |
|---|
| 254 | 246 | snprintf(name, sizeof(name), "qib%d", dd_from_dev(ibd)->unit); |
|---|
| 255 | | - ibd->qib_ibdev_dbg = debugfs_create_dir(name, qib_dbg_root); |
|---|
| 256 | | - if (!ibd->qib_ibdev_dbg) { |
|---|
| 257 | | - pr_warn("create of %s failed\n", name); |
|---|
| 258 | | - return; |
|---|
| 259 | | - } |
|---|
| 260 | | - DEBUGFS_FILE_CREATE(opcode_stats); |
|---|
| 261 | | - DEBUGFS_FILE_CREATE(ctx_stats); |
|---|
| 262 | | - DEBUGFS_FILE_CREATE(qp_stats); |
|---|
| 247 | + root = debugfs_create_dir(name, qib_dbg_root); |
|---|
| 248 | + ibd->qib_ibdev_dbg = root; |
|---|
| 249 | + |
|---|
| 250 | + debugfs_create_file("opcode_stats", 0400, root, ibd, |
|---|
| 251 | + &_opcode_stats_file_ops); |
|---|
| 252 | + debugfs_create_file("ctx_stats", 0400, root, ibd, &_ctx_stats_file_ops); |
|---|
| 253 | + debugfs_create_file("qp_stats", 0400, root, ibd, &_qp_stats_file_ops); |
|---|
| 263 | 254 | } |
|---|
| 264 | 255 | |
|---|
| 265 | 256 | void qib_dbg_ibdev_exit(struct qib_ibdev *ibd) |
|---|
| .. | .. |
|---|
| 274 | 265 | void qib_dbg_init(void) |
|---|
| 275 | 266 | { |
|---|
| 276 | 267 | qib_dbg_root = debugfs_create_dir(QIB_DRV_NAME, NULL); |
|---|
| 277 | | - if (!qib_dbg_root) |
|---|
| 278 | | - pr_warn("init of debugfs failed\n"); |
|---|
| 279 | 268 | } |
|---|
| 280 | 269 | |
|---|
| 281 | 270 | void qib_dbg_exit(void) |
|---|