Lines Matching +full:out +full:-

1 // SPDX-License-Identifier: GPL-2.0-or-later
35 spin_lock(&res->spinlock); in dlm_print_one_lock_resource()
37 spin_unlock(&res->spinlock); in dlm_print_one_lock_resource()
43 assert_spin_locked(&res->spinlock); in dlm_print_lockres_refmap()
48 bit = find_next_bit(res->refmap, O2NM_MAX_NODES, bit); in dlm_print_lockres_refmap()
54 printk("], inflight=%u\n", res->inflight_locks); in dlm_print_lockres_refmap()
59 spin_lock(&lock->spinlock); in __dlm_print_lock()
64 lock->ml.type, lock->ml.convert_type, lock->ml.node, in __dlm_print_lock()
65 dlm_get_lock_cookie_node(be64_to_cpu(lock->ml.cookie)), in __dlm_print_lock()
66 dlm_get_lock_cookie_seq(be64_to_cpu(lock->ml.cookie)), in __dlm_print_lock()
67 kref_read(&lock->lock_refs), in __dlm_print_lock()
68 (list_empty(&lock->ast_list) ? 'y' : 'n'), in __dlm_print_lock()
69 (lock->ast_pending ? 'y' : 'n'), in __dlm_print_lock()
70 (list_empty(&lock->bast_list) ? 'y' : 'n'), in __dlm_print_lock()
71 (lock->bast_pending ? 'y' : 'n'), in __dlm_print_lock()
72 (lock->convert_pending ? 'y' : 'n'), in __dlm_print_lock()
73 (lock->lock_pending ? 'y' : 'n'), in __dlm_print_lock()
74 (lock->cancel_pending ? 'y' : 'n'), in __dlm_print_lock()
75 (lock->unlock_pending ? 'y' : 'n')); in __dlm_print_lock()
77 spin_unlock(&lock->spinlock); in __dlm_print_lock()
85 assert_spin_locked(&res->spinlock); in __dlm_print_one_lock_resource()
87 stringify_lockname(res->lockname.name, res->lockname.len, in __dlm_print_one_lock_resource()
90 buf, res->owner, res->state); in __dlm_print_one_lock_resource()
92 res->last_used, kref_read(&res->refs), in __dlm_print_one_lock_resource()
93 list_empty(&res->purge) ? "no" : "yes"); in __dlm_print_one_lock_resource()
96 list_empty(&res->dirty) ? "no" : "yes", in __dlm_print_one_lock_resource()
97 list_empty(&res->recovering) ? "no" : "yes", in __dlm_print_one_lock_resource()
98 res->migration_pending ? "yes" : "no"); in __dlm_print_one_lock_resource()
100 res->inflight_locks, atomic_read(&res->asts_reserved)); in __dlm_print_one_lock_resource()
103 list_for_each_entry(lock, &res->granted, list) { in __dlm_print_one_lock_resource()
107 list_for_each_entry(lock, &res->converting, list) { in __dlm_print_one_lock_resource()
111 list_for_each_entry(lock, &res->blocked, list) { in __dlm_print_one_lock_resource()
118 dlm_print_one_lock_resource(lockid->lockres); in dlm_print_one_lock()
171 [DLM_DENIED_NOLOCKS] = "request denied, out of system resources",
237 int out = 0; in stringify_lockname() local
245 out += scnprintf(buf + out, len - out, "%.*s%08x", in stringify_lockname()
246 OCFS2_DENTRY_LOCK_INO_START - 1, lockname, in stringify_lockname()
249 out += scnprintf(buf + out, len - out, "%.*s", in stringify_lockname()
251 return out; in stringify_lockname()
257 int out = 0; in stringify_nodemap() local
258 int i = -1; in stringify_nodemap()
261 out += scnprintf(buf + out, len - out, "%d ", i); in stringify_nodemap()
263 return out; in stringify_nodemap()
268 int out = 0; in dump_mle() local
271 if (mle->type == DLM_MLE_BLOCK) in dump_mle()
273 else if (mle->type == DLM_MLE_MASTER) in dump_mle()
278 out += stringify_lockname(mle->mname, mle->mnamelen, buf + out, len - out); in dump_mle()
279 out += scnprintf(buf + out, len - out, in dump_mle()
281 mle_type, mle->master, mle->new_master, in dump_mle()
282 !list_empty(&mle->hb_events), in dump_mle()
283 !!mle->inuse, in dump_mle()
284 kref_read(&mle->mle_refs)); in dump_mle()
286 out += scnprintf(buf + out, len - out, "Maybe="); in dump_mle()
287 out += stringify_nodemap(mle->maybe_map, O2NM_MAX_NODES, in dump_mle()
288 buf + out, len - out); in dump_mle()
289 out += scnprintf(buf + out, len - out, "\n"); in dump_mle()
291 out += scnprintf(buf + out, len - out, "Vote="); in dump_mle()
292 out += stringify_nodemap(mle->vote_map, O2NM_MAX_NODES, in dump_mle()
293 buf + out, len - out); in dump_mle()
294 out += scnprintf(buf + out, len - out, "\n"); in dump_mle()
296 out += scnprintf(buf + out, len - out, "Response="); in dump_mle()
297 out += stringify_nodemap(mle->response_map, O2NM_MAX_NODES, in dump_mle()
298 buf + out, len - out); in dump_mle()
299 out += scnprintf(buf + out, len - out, "\n"); in dump_mle()
301 out += scnprintf(buf + out, len - out, "Node="); in dump_mle()
302 out += stringify_nodemap(mle->node_map, O2NM_MAX_NODES, in dump_mle()
303 buf + out, len - out); in dump_mle()
304 out += scnprintf(buf + out, len - out, "\n"); in dump_mle()
306 out += scnprintf(buf + out, len - out, "\n"); in dump_mle()
308 return out; in dump_mle()
317 dump_mle(mle, buf, PAGE_SIZE - 1); in dlm_print_one_mle()
332 /* begin - utils funcs */
335 free_page((unsigned long)file->private_data); in debug_release()
342 return simple_read_from_buffer(buf, nbytes, ppos, file->private_data, in debug_read()
343 i_size_read(file->f_mapping->host)); in debug_read()
345 /* end - util funcs */
347 /* begin - purge list funcs */
351 int out = 0; in debug_purgelist_print() local
354 out += scnprintf(buf + out, len - out, in debug_purgelist_print()
355 "Dumping Purgelist for Domain: %s\n", dlm->name); in debug_purgelist_print()
357 spin_lock(&dlm->spinlock); in debug_purgelist_print()
358 list_for_each_entry(res, &dlm->purge_list, purge) { in debug_purgelist_print()
360 if (len - out < 100) in debug_purgelist_print()
362 spin_lock(&res->spinlock); in debug_purgelist_print()
363 out += stringify_lockname(res->lockname.name, in debug_purgelist_print()
364 res->lockname.len, in debug_purgelist_print()
365 buf + out, len - out); in debug_purgelist_print()
366 out += scnprintf(buf + out, len - out, "\t%ld\n", in debug_purgelist_print()
367 (jiffies - res->last_used)/HZ); in debug_purgelist_print()
368 spin_unlock(&res->spinlock); in debug_purgelist_print()
370 spin_unlock(&dlm->spinlock); in debug_purgelist_print()
372 out += scnprintf(buf + out, len - out, "Total on list: %lu\n", total); in debug_purgelist_print()
374 return out; in debug_purgelist_print()
379 struct dlm_ctxt *dlm = inode->i_private; in debug_purgelist_open()
386 i_size_write(inode, debug_purgelist_print(dlm, buf, PAGE_SIZE - 1)); in debug_purgelist_open()
388 file->private_data = buf; in debug_purgelist_open()
392 return -ENOMEM; in debug_purgelist_open()
401 /* end - purge list funcs */
403 /* begin - debug mle funcs */
408 int i, out = 0; in debug_mle_print() local
411 out += scnprintf(buf + out, len - out, in debug_mle_print()
412 "Dumping MLEs for Domain: %s\n", dlm->name); in debug_mle_print()
414 spin_lock(&dlm->master_lock); in debug_mle_print()
420 if (len - out < 200) in debug_mle_print()
422 out += dump_mle(mle, buf + out, len - out); in debug_mle_print()
427 spin_unlock(&dlm->master_lock); in debug_mle_print()
429 out += scnprintf(buf + out, len - out, in debug_mle_print()
431 return out; in debug_mle_print()
436 struct dlm_ctxt *dlm = inode->i_private; in debug_mle_open()
443 i_size_write(inode, debug_mle_print(dlm, buf, PAGE_SIZE - 1)); in debug_mle_open()
445 file->private_data = buf; in debug_mle_open()
449 return -ENOMEM; in debug_mle_open()
459 /* end - debug mle funcs */
461 /* begin - debug lockres funcs */
464 int out; in dump_lock() local
467 spin_lock(&lock->spinlock); in dump_lock()
468 out = scnprintf(buf, len, "LOCK:%d,%d,%d,%d,%d,%d:%lld,%d,%d,%d,%d,%d," in dump_lock()
471 list_type, lock->ml.type, lock->ml.convert_type, in dump_lock()
472 lock->ml.node, in dump_lock()
473 dlm_get_lock_cookie_node(be64_to_cpu(lock->ml.cookie)), in dump_lock()
474 dlm_get_lock_cookie_seq(be64_to_cpu(lock->ml.cookie)), in dump_lock()
475 !list_empty(&lock->ast_list), in dump_lock()
476 !list_empty(&lock->bast_list), in dump_lock()
477 lock->ast_pending, lock->bast_pending, in dump_lock()
478 lock->convert_pending, lock->lock_pending, in dump_lock()
479 lock->cancel_pending, lock->unlock_pending, in dump_lock()
480 kref_read(&lock->lock_refs)); in dump_lock()
481 spin_unlock(&lock->spinlock); in dump_lock()
483 return out; in dump_lock()
490 int out = 0; in dump_lockres() local
492 out += scnprintf(buf + out, len - out, "NAME:"); in dump_lockres()
493 out += stringify_lockname(res->lockname.name, res->lockname.len, in dump_lockres()
494 buf + out, len - out); in dump_lockres()
495 out += scnprintf(buf + out, len - out, "\n"); in dump_lockres()
498 out += scnprintf(buf + out, len - out, in dump_lockres()
501 res->owner, res->state, res->last_used, in dump_lockres()
502 !list_empty(&res->purge), in dump_lockres()
503 !list_empty(&res->dirty), in dump_lockres()
504 !list_empty(&res->recovering), in dump_lockres()
505 res->inflight_locks, res->migration_pending, in dump_lockres()
506 atomic_read(&res->asts_reserved), in dump_lockres()
507 kref_read(&res->refs)); in dump_lockres()
510 out += scnprintf(buf + out, len - out, "RMAP:"); in dump_lockres()
511 out += stringify_nodemap(res->refmap, O2NM_MAX_NODES, in dump_lockres()
512 buf + out, len - out); in dump_lockres()
513 out += scnprintf(buf + out, len - out, "\n"); in dump_lockres()
516 out += scnprintf(buf + out, len - out, "LVBX:"); in dump_lockres()
518 out += scnprintf(buf + out, len - out, in dump_lockres()
519 "%02x", (unsigned char)res->lvb[i]); in dump_lockres()
520 out += scnprintf(buf + out, len - out, "\n"); in dump_lockres()
523 list_for_each_entry(lock, &res->granted, list) in dump_lockres()
524 out += dump_lock(lock, 0, buf + out, len - out); in dump_lockres()
527 list_for_each_entry(lock, &res->converting, list) in dump_lockres()
528 out += dump_lock(lock, 1, buf + out, len - out); in dump_lockres()
531 list_for_each_entry(lock, &res->blocked, list) in dump_lockres()
532 out += dump_lock(lock, 2, buf + out, len - out); in dump_lockres()
534 out += scnprintf(buf + out, len - out, "\n"); in dump_lockres()
536 return out; in dump_lockres()
541 struct debug_lockres *dl = m->private; in lockres_seq_start()
542 struct dlm_ctxt *dlm = dl->dl_ctxt; in lockres_seq_start()
543 struct dlm_lock_resource *oldres = dl->dl_res; in lockres_seq_start()
547 spin_lock(&dlm->track_lock); in lockres_seq_start()
549 track_list = &oldres->tracking; in lockres_seq_start()
551 track_list = &dlm->tracking_list; in lockres_seq_start()
554 spin_unlock(&dlm->track_lock); in lockres_seq_start()
560 if (&iter->tracking != &dlm->tracking_list) { in lockres_seq_start()
566 spin_unlock(&dlm->track_lock); in lockres_seq_start()
571 dl->dl_res = res; in lockres_seq_start()
574 spin_lock(&res->spinlock); in lockres_seq_start()
575 dump_lockres(res, dl->dl_buf, dl->dl_len - 1); in lockres_seq_start()
576 spin_unlock(&res->spinlock); in lockres_seq_start()
598 seq_printf(s, "%s", dl->dl_buf); in lockres_seq_show()
612 struct dlm_ctxt *dlm = inode->i_private; in debug_lockres_open()
624 dl->dl_len = PAGE_SIZE; in debug_lockres_open()
625 dl->dl_buf = buf; in debug_lockres_open()
628 dl->dl_ctxt = dlm; in debug_lockres_open()
635 mlog_errno(-ENOMEM); in debug_lockres_open()
636 return -ENOMEM; in debug_lockres_open()
641 struct seq_file *seq = file->private_data; in debug_lockres_release()
642 struct debug_lockres *dl = (struct debug_lockres *)seq->private; in debug_lockres_release()
644 if (dl->dl_res) in debug_lockres_release()
645 dlm_lockres_put(dl->dl_res); in debug_lockres_release()
646 dlm_put(dl->dl_ctxt); in debug_lockres_release()
647 kfree(dl->dl_buf); in debug_lockres_release()
657 /* end - debug lockres funcs */
659 /* begin - debug state funcs */
662 int out = 0; in debug_state_print() local
668 spin_lock(&dlm->spinlock); in debug_state_print()
670 switch (dlm->dlm_state) { in debug_state_print()
684 out += scnprintf(buf + out, len - out, in debug_state_print()
686 dlm->name, dlm->key, dlm->dlm_locking_proto.pv_major, in debug_state_print()
687 dlm->dlm_locking_proto.pv_minor); in debug_state_print()
690 out += scnprintf(buf + out, len - out, in debug_state_print()
692 task_pid_nr(dlm->dlm_thread_task), dlm->node_num, state); in debug_state_print()
695 out += scnprintf(buf + out, len - out, in debug_state_print()
697 dlm->num_joins, dlm->joining_node); in debug_state_print()
700 out += scnprintf(buf + out, len - out, "Domain Map: "); in debug_state_print()
701 out += stringify_nodemap(dlm->domain_map, O2NM_MAX_NODES, in debug_state_print()
702 buf + out, len - out); in debug_state_print()
703 out += scnprintf(buf + out, len - out, "\n"); in debug_state_print()
706 out += scnprintf(buf + out, len - out, "Exit Domain Map: "); in debug_state_print()
707 out += stringify_nodemap(dlm->exit_domain_map, O2NM_MAX_NODES, in debug_state_print()
708 buf + out, len - out); in debug_state_print()
709 out += scnprintf(buf + out, len - out, "\n"); in debug_state_print()
712 out += scnprintf(buf + out, len - out, "Live Map: "); in debug_state_print()
713 out += stringify_nodemap(dlm->live_nodes_map, O2NM_MAX_NODES, in debug_state_print()
714 buf + out, len - out); in debug_state_print()
715 out += scnprintf(buf + out, len - out, "\n"); in debug_state_print()
718 out += scnprintf(buf + out, len - out, in debug_state_print()
720 atomic_read(&dlm->res_cur_count), in debug_state_print()
721 atomic_read(&dlm->res_tot_count)); in debug_state_print()
724 tot_mles += atomic_read(&dlm->mle_tot_count[i]); in debug_state_print()
727 cur_mles += atomic_read(&dlm->mle_cur_count[i]); in debug_state_print()
730 out += scnprintf(buf + out, len - out, in debug_state_print()
734 out += scnprintf(buf + out, len - out, in debug_state_print()
736 atomic_read(&dlm->mle_cur_count[DLM_MLE_BLOCK]), in debug_state_print()
737 atomic_read(&dlm->mle_tot_count[DLM_MLE_BLOCK])); in debug_state_print()
740 out += scnprintf(buf + out, len - out, in debug_state_print()
742 atomic_read(&dlm->mle_cur_count[DLM_MLE_MASTER]), in debug_state_print()
743 atomic_read(&dlm->mle_tot_count[DLM_MLE_MASTER])); in debug_state_print()
746 out += scnprintf(buf + out, len - out, in debug_state_print()
748 atomic_read(&dlm->mle_cur_count[DLM_MLE_MIGRATION]), in debug_state_print()
749 atomic_read(&dlm->mle_tot_count[DLM_MLE_MIGRATION])); in debug_state_print()
752 out += scnprintf(buf + out, len - out, in debug_state_print()
755 (list_empty(&dlm->dirty_list) ? "Empty" : "InUse"), in debug_state_print()
756 (list_empty(&dlm->purge_list) ? "Empty" : "InUse"), in debug_state_print()
757 (list_empty(&dlm->pending_asts) ? "Empty" : "InUse"), in debug_state_print()
758 (list_empty(&dlm->pending_basts) ? "Empty" : "InUse")); in debug_state_print()
761 out += scnprintf(buf + out, len - out, in debug_state_print()
762 "Purge Count: %d Refs: %d\n", dlm->purge_count, in debug_state_print()
763 kref_read(&dlm->dlm_refs)); in debug_state_print()
766 out += scnprintf(buf + out, len - out, in debug_state_print()
767 "Dead Node: %d\n", dlm->reco.dead_node); in debug_state_print()
770 if (dlm->reco.state == DLM_RECO_STATE_ACTIVE) in debug_state_print()
776 out += scnprintf(buf + out, len - out, in debug_state_print()
778 task_pid_nr(dlm->dlm_reco_thread_task), in debug_state_print()
779 dlm->reco.new_master, state); in debug_state_print()
782 out += scnprintf(buf + out, len - out, "Recovery Map: "); in debug_state_print()
783 out += stringify_nodemap(dlm->recovery_map, O2NM_MAX_NODES, in debug_state_print()
784 buf + out, len - out); in debug_state_print()
785 out += scnprintf(buf + out, len - out, "\n"); in debug_state_print()
788 out += scnprintf(buf + out, len - out, "Recovery Node State:\n"); in debug_state_print()
789 list_for_each_entry(node, &dlm->reco.node_data, list) { in debug_state_print()
790 switch (node->state) { in debug_state_print()
810 state = "FINALIZE-SENT"; in debug_state_print()
816 out += scnprintf(buf + out, len - out, "\t%u - %s\n", in debug_state_print()
817 node->node_num, state); in debug_state_print()
820 spin_unlock(&dlm->spinlock); in debug_state_print()
822 return out; in debug_state_print()
827 struct dlm_ctxt *dlm = inode->i_private; in debug_state_open()
834 i_size_write(inode, debug_state_print(dlm, buf, PAGE_SIZE - 1)); in debug_state_open()
836 file->private_data = buf; in debug_state_open()
840 return -ENOMEM; in debug_state_open()
849 /* end - debug state funcs */
856 dlm->dlm_debugfs_subroot, dlm, &debug_state_fops); in dlm_debug_init()
860 dlm->dlm_debugfs_subroot, dlm, &debug_lockres_fops); in dlm_debug_init()
864 dlm->dlm_debugfs_subroot, dlm, &debug_mle_fops); in dlm_debug_init()
868 dlm->dlm_debugfs_subroot, dlm, in dlm_debug_init()
872 /* subroot - domain dir */
875 dlm->dlm_debugfs_subroot = debugfs_create_dir(dlm->name, in dlm_create_debugfs_subroot()
881 debugfs_remove_recursive(dlm->dlm_debugfs_subroot); in dlm_destroy_debugfs_subroot()