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()
184 int out = 0; in stringify_lockname() local
192 out += scnprintf(buf + out, len - out, "%.*s%08x", in stringify_lockname()
193 OCFS2_DENTRY_LOCK_INO_START - 1, lockname, in stringify_lockname()
196 out += scnprintf(buf + out, len - out, "%.*s", in stringify_lockname()
198 return out; in stringify_lockname()
204 int out = 0; in stringify_nodemap() local
205 int i = -1; in stringify_nodemap()
208 out += scnprintf(buf + out, len - out, "%d ", i); in stringify_nodemap()
210 return out; in stringify_nodemap()
215 int out = 0; in dump_mle() local
218 if (mle->type == DLM_MLE_BLOCK) in dump_mle()
220 else if (mle->type == DLM_MLE_MASTER) in dump_mle()
225 out += stringify_lockname(mle->mname, mle->mnamelen, buf + out, len - out); in dump_mle()
226 out += scnprintf(buf + out, len - out, in dump_mle()
228 mle_type, mle->master, mle->new_master, in dump_mle()
229 !list_empty(&mle->hb_events), in dump_mle()
230 !!mle->inuse, in dump_mle()
231 kref_read(&mle->mle_refs)); in dump_mle()
233 out += scnprintf(buf + out, len - out, "Maybe="); in dump_mle()
234 out += stringify_nodemap(mle->maybe_map, O2NM_MAX_NODES, in dump_mle()
235 buf + out, len - out); in dump_mle()
236 out += scnprintf(buf + out, len - out, "\n"); in dump_mle()
238 out += scnprintf(buf + out, len - out, "Vote="); in dump_mle()
239 out += stringify_nodemap(mle->vote_map, O2NM_MAX_NODES, in dump_mle()
240 buf + out, len - out); in dump_mle()
241 out += scnprintf(buf + out, len - out, "\n"); in dump_mle()
243 out += scnprintf(buf + out, len - out, "Response="); in dump_mle()
244 out += stringify_nodemap(mle->response_map, O2NM_MAX_NODES, in dump_mle()
245 buf + out, len - out); in dump_mle()
246 out += scnprintf(buf + out, len - out, "\n"); in dump_mle()
248 out += scnprintf(buf + out, len - out, "Node="); in dump_mle()
249 out += stringify_nodemap(mle->node_map, O2NM_MAX_NODES, in dump_mle()
250 buf + out, len - out); in dump_mle()
251 out += scnprintf(buf + out, len - out, "\n"); in dump_mle()
253 out += scnprintf(buf + out, len - out, "\n"); in dump_mle()
255 return out; in dump_mle()
264 dump_mle(mle, buf, PAGE_SIZE - 1); in dlm_print_one_mle()
279 /* begin - utils funcs */
282 free_page((unsigned long)file->private_data); in debug_release()
289 return simple_read_from_buffer(buf, nbytes, ppos, file->private_data, in debug_read()
290 i_size_read(file->f_mapping->host)); in debug_read()
292 /* end - util funcs */
294 /* begin - purge list funcs */
298 int out = 0; in debug_purgelist_print() local
301 out += scnprintf(buf + out, len - out, in debug_purgelist_print()
302 "Dumping Purgelist for Domain: %s\n", dlm->name); in debug_purgelist_print()
304 spin_lock(&dlm->spinlock); in debug_purgelist_print()
305 list_for_each_entry(res, &dlm->purge_list, purge) { in debug_purgelist_print()
307 if (len - out < 100) in debug_purgelist_print()
309 spin_lock(&res->spinlock); in debug_purgelist_print()
310 out += stringify_lockname(res->lockname.name, in debug_purgelist_print()
311 res->lockname.len, in debug_purgelist_print()
312 buf + out, len - out); in debug_purgelist_print()
313 out += scnprintf(buf + out, len - out, "\t%ld\n", in debug_purgelist_print()
314 (jiffies - res->last_used)/HZ); in debug_purgelist_print()
315 spin_unlock(&res->spinlock); in debug_purgelist_print()
317 spin_unlock(&dlm->spinlock); in debug_purgelist_print()
319 out += scnprintf(buf + out, len - out, "Total on list: %lu\n", total); in debug_purgelist_print()
321 return out; in debug_purgelist_print()
326 struct dlm_ctxt *dlm = inode->i_private; in debug_purgelist_open()
333 i_size_write(inode, debug_purgelist_print(dlm, buf, PAGE_SIZE - 1)); in debug_purgelist_open()
335 file->private_data = buf; in debug_purgelist_open()
339 return -ENOMEM; in debug_purgelist_open()
348 /* end - purge list funcs */
350 /* begin - debug mle funcs */
355 int i, out = 0; in debug_mle_print() local
358 out += scnprintf(buf + out, len - out, in debug_mle_print()
359 "Dumping MLEs for Domain: %s\n", dlm->name); in debug_mle_print()
361 spin_lock(&dlm->master_lock); in debug_mle_print()
367 if (len - out < 200) in debug_mle_print()
369 out += dump_mle(mle, buf + out, len - out); in debug_mle_print()
374 spin_unlock(&dlm->master_lock); in debug_mle_print()
376 out += scnprintf(buf + out, len - out, in debug_mle_print()
378 return out; in debug_mle_print()
383 struct dlm_ctxt *dlm = inode->i_private; in debug_mle_open()
390 i_size_write(inode, debug_mle_print(dlm, buf, PAGE_SIZE - 1)); in debug_mle_open()
392 file->private_data = buf; in debug_mle_open()
396 return -ENOMEM; in debug_mle_open()
406 /* end - debug mle funcs */
408 /* begin - debug lockres funcs */
411 int out; in dump_lock() local
414 spin_lock(&lock->spinlock); in dump_lock()
415 out = scnprintf(buf, len, "LOCK:%d,%d,%d,%d,%d,%d:%lld,%d,%d,%d,%d,%d," in dump_lock()
418 list_type, lock->ml.type, lock->ml.convert_type, in dump_lock()
419 lock->ml.node, in dump_lock()
420 dlm_get_lock_cookie_node(be64_to_cpu(lock->ml.cookie)), in dump_lock()
421 dlm_get_lock_cookie_seq(be64_to_cpu(lock->ml.cookie)), in dump_lock()
422 !list_empty(&lock->ast_list), in dump_lock()
423 !list_empty(&lock->bast_list), in dump_lock()
424 lock->ast_pending, lock->bast_pending, in dump_lock()
425 lock->convert_pending, lock->lock_pending, in dump_lock()
426 lock->cancel_pending, lock->unlock_pending, in dump_lock()
427 kref_read(&lock->lock_refs)); in dump_lock()
428 spin_unlock(&lock->spinlock); in dump_lock()
430 return out; in dump_lock()
437 int out = 0; in dump_lockres() local
439 out += scnprintf(buf + out, len - out, "NAME:"); in dump_lockres()
440 out += stringify_lockname(res->lockname.name, res->lockname.len, in dump_lockres()
441 buf + out, len - out); in dump_lockres()
442 out += scnprintf(buf + out, len - out, "\n"); in dump_lockres()
445 out += scnprintf(buf + out, len - out, in dump_lockres()
448 res->owner, res->state, res->last_used, in dump_lockres()
449 !list_empty(&res->purge), in dump_lockres()
450 !list_empty(&res->dirty), in dump_lockres()
451 !list_empty(&res->recovering), in dump_lockres()
452 res->inflight_locks, res->migration_pending, in dump_lockres()
453 atomic_read(&res->asts_reserved), in dump_lockres()
454 kref_read(&res->refs)); in dump_lockres()
457 out += scnprintf(buf + out, len - out, "RMAP:"); in dump_lockres()
458 out += stringify_nodemap(res->refmap, O2NM_MAX_NODES, in dump_lockres()
459 buf + out, len - out); in dump_lockres()
460 out += scnprintf(buf + out, len - out, "\n"); in dump_lockres()
463 out += scnprintf(buf + out, len - out, "LVBX:"); in dump_lockres()
465 out += scnprintf(buf + out, len - out, in dump_lockres()
466 "%02x", (unsigned char)res->lvb[i]); in dump_lockres()
467 out += scnprintf(buf + out, len - out, "\n"); in dump_lockres()
470 list_for_each_entry(lock, &res->granted, list) in dump_lockres()
471 out += dump_lock(lock, 0, buf + out, len - out); in dump_lockres()
474 list_for_each_entry(lock, &res->converting, list) in dump_lockres()
475 out += dump_lock(lock, 1, buf + out, len - out); in dump_lockres()
478 list_for_each_entry(lock, &res->blocked, list) in dump_lockres()
479 out += dump_lock(lock, 2, buf + out, len - out); in dump_lockres()
481 out += scnprintf(buf + out, len - out, "\n"); in dump_lockres()
483 return out; in dump_lockres()
488 struct debug_lockres *dl = m->private; in lockres_seq_start()
489 struct dlm_ctxt *dlm = dl->dl_ctxt; in lockres_seq_start()
490 struct dlm_lock_resource *oldres = dl->dl_res; in lockres_seq_start()
494 spin_lock(&dlm->track_lock); in lockres_seq_start()
496 track_list = &oldres->tracking; in lockres_seq_start()
498 track_list = &dlm->tracking_list; in lockres_seq_start()
501 spin_unlock(&dlm->track_lock); in lockres_seq_start()
507 if (&iter->tracking != &dlm->tracking_list) { in lockres_seq_start()
513 spin_unlock(&dlm->track_lock); in lockres_seq_start()
518 dl->dl_res = res; in lockres_seq_start()
521 spin_lock(&res->spinlock); in lockres_seq_start()
522 dump_lockres(res, dl->dl_buf, dl->dl_len - 1); in lockres_seq_start()
523 spin_unlock(&res->spinlock); in lockres_seq_start()
545 seq_printf(s, "%s", dl->dl_buf); in lockres_seq_show()
559 struct dlm_ctxt *dlm = inode->i_private; in debug_lockres_open()
571 dl->dl_len = PAGE_SIZE; in debug_lockres_open()
572 dl->dl_buf = buf; in debug_lockres_open()
575 dl->dl_ctxt = dlm; in debug_lockres_open()
582 mlog_errno(-ENOMEM); in debug_lockres_open()
583 return -ENOMEM; in debug_lockres_open()
588 struct seq_file *seq = file->private_data; in debug_lockres_release()
589 struct debug_lockres *dl = (struct debug_lockres *)seq->private; in debug_lockres_release()
591 if (dl->dl_res) in debug_lockres_release()
592 dlm_lockres_put(dl->dl_res); in debug_lockres_release()
593 dlm_put(dl->dl_ctxt); in debug_lockres_release()
594 kfree(dl->dl_buf); in debug_lockres_release()
604 /* end - debug lockres funcs */
606 /* begin - debug state funcs */
609 int out = 0; in debug_state_print() local
615 spin_lock(&dlm->spinlock); in debug_state_print()
617 switch (dlm->dlm_state) { in debug_state_print()
631 out += scnprintf(buf + out, len - out, in debug_state_print()
633 dlm->name, dlm->key, dlm->dlm_locking_proto.pv_major, in debug_state_print()
634 dlm->dlm_locking_proto.pv_minor); in debug_state_print()
637 out += scnprintf(buf + out, len - out, in debug_state_print()
639 task_pid_nr(dlm->dlm_thread_task), dlm->node_num, state); in debug_state_print()
642 out += scnprintf(buf + out, len - out, in debug_state_print()
644 dlm->num_joins, dlm->joining_node); in debug_state_print()
647 out += scnprintf(buf + out, len - out, "Domain Map: "); in debug_state_print()
648 out += stringify_nodemap(dlm->domain_map, O2NM_MAX_NODES, in debug_state_print()
649 buf + out, len - out); in debug_state_print()
650 out += scnprintf(buf + out, len - out, "\n"); in debug_state_print()
653 out += scnprintf(buf + out, len - out, "Exit Domain Map: "); in debug_state_print()
654 out += stringify_nodemap(dlm->exit_domain_map, O2NM_MAX_NODES, in debug_state_print()
655 buf + out, len - out); in debug_state_print()
656 out += scnprintf(buf + out, len - out, "\n"); in debug_state_print()
659 out += scnprintf(buf + out, len - out, "Live Map: "); in debug_state_print()
660 out += stringify_nodemap(dlm->live_nodes_map, O2NM_MAX_NODES, in debug_state_print()
661 buf + out, len - out); in debug_state_print()
662 out += scnprintf(buf + out, len - out, "\n"); in debug_state_print()
665 out += scnprintf(buf + out, len - out, in debug_state_print()
667 atomic_read(&dlm->res_cur_count), in debug_state_print()
668 atomic_read(&dlm->res_tot_count)); in debug_state_print()
671 tot_mles += atomic_read(&dlm->mle_tot_count[i]); in debug_state_print()
674 cur_mles += atomic_read(&dlm->mle_cur_count[i]); in debug_state_print()
677 out += scnprintf(buf + out, len - out, in debug_state_print()
681 out += scnprintf(buf + out, len - out, in debug_state_print()
683 atomic_read(&dlm->mle_cur_count[DLM_MLE_BLOCK]), in debug_state_print()
684 atomic_read(&dlm->mle_tot_count[DLM_MLE_BLOCK])); in debug_state_print()
687 out += scnprintf(buf + out, len - out, in debug_state_print()
689 atomic_read(&dlm->mle_cur_count[DLM_MLE_MASTER]), in debug_state_print()
690 atomic_read(&dlm->mle_tot_count[DLM_MLE_MASTER])); in debug_state_print()
693 out += scnprintf(buf + out, len - out, in debug_state_print()
695 atomic_read(&dlm->mle_cur_count[DLM_MLE_MIGRATION]), in debug_state_print()
696 atomic_read(&dlm->mle_tot_count[DLM_MLE_MIGRATION])); in debug_state_print()
699 out += scnprintf(buf + out, len - out, in debug_state_print()
702 (list_empty(&dlm->dirty_list) ? "Empty" : "InUse"), in debug_state_print()
703 (list_empty(&dlm->purge_list) ? "Empty" : "InUse"), in debug_state_print()
704 (list_empty(&dlm->pending_asts) ? "Empty" : "InUse"), in debug_state_print()
705 (list_empty(&dlm->pending_basts) ? "Empty" : "InUse")); in debug_state_print()
708 out += scnprintf(buf + out, len - out, in debug_state_print()
709 "Purge Count: %d Refs: %d\n", dlm->purge_count, in debug_state_print()
710 kref_read(&dlm->dlm_refs)); in debug_state_print()
713 out += scnprintf(buf + out, len - out, in debug_state_print()
714 "Dead Node: %d\n", dlm->reco.dead_node); in debug_state_print()
717 if (dlm->reco.state == DLM_RECO_STATE_ACTIVE) in debug_state_print()
723 out += scnprintf(buf + out, len - out, in debug_state_print()
725 task_pid_nr(dlm->dlm_reco_thread_task), in debug_state_print()
726 dlm->reco.new_master, state); in debug_state_print()
729 out += scnprintf(buf + out, len - out, "Recovery Map: "); in debug_state_print()
730 out += stringify_nodemap(dlm->recovery_map, O2NM_MAX_NODES, in debug_state_print()
731 buf + out, len - out); in debug_state_print()
732 out += scnprintf(buf + out, len - out, "\n"); in debug_state_print()
735 out += scnprintf(buf + out, len - out, "Recovery Node State:\n"); in debug_state_print()
736 list_for_each_entry(node, &dlm->reco.node_data, list) { in debug_state_print()
737 switch (node->state) { in debug_state_print()
757 state = "FINALIZE-SENT"; in debug_state_print()
763 out += scnprintf(buf + out, len - out, "\t%u - %s\n", in debug_state_print()
764 node->node_num, state); in debug_state_print()
767 spin_unlock(&dlm->spinlock); in debug_state_print()
769 return out; in debug_state_print()
774 struct dlm_ctxt *dlm = inode->i_private; in debug_state_open()
781 i_size_write(inode, debug_state_print(dlm, buf, PAGE_SIZE - 1)); in debug_state_open()
783 file->private_data = buf; in debug_state_open()
787 return -ENOMEM; in debug_state_open()
796 /* end - debug state funcs */
803 dlm->dlm_debugfs_subroot, dlm, &debug_state_fops); in dlm_debug_init()
807 dlm->dlm_debugfs_subroot, dlm, &debug_lockres_fops); in dlm_debug_init()
811 dlm->dlm_debugfs_subroot, dlm, &debug_mle_fops); in dlm_debug_init()
815 dlm->dlm_debugfs_subroot, dlm, in dlm_debug_init()
819 /* subroot - domain dir */
822 dlm->dlm_debugfs_subroot = debugfs_create_dir(dlm->name, in dlm_create_debugfs_subroot()
828 debugfs_remove_recursive(dlm->dlm_debugfs_subroot); in dlm_destroy_debugfs_subroot()