Lines Matching +full:com +full:- +full:seq
1 // SPDX-License-Identifier: GPL-2.0-only
7 Copyright (C) 2001-2008, LINBIT Information Technologies GmbH.
8 Copyright (C) 1999-2008, Philipp Reisner <philipp.reisner@linbit.com>.
9 Copyright (C) 2002-2008, Lars Ellenberg <lars.ellenberg@linbit.com>.
26 static void seq_printf_with_thousands_grouping(struct seq_file *seq, long v) in seq_printf_with_thousands_grouping() argument
31 seq_printf(seq, "%ld,", v / 1000000); in seq_printf_with_thousands_grouping()
33 seq_printf(seq, "%03ld,%03ld", v/1000, v % 1000); in seq_printf_with_thousands_grouping()
35 seq_printf(seq, "%ld,%03ld", v/1000, v % 1000); in seq_printf_with_thousands_grouping()
37 seq_printf(seq, "%ld", v); in seq_printf_with_thousands_grouping()
46 typecheck(unsigned long, device->rs_total); in drbd_get_syncer_progress()
47 *rs_total = device->rs_total; in drbd_get_syncer_progress()
54 *bits_left = device->ov_left; in drbd_get_syncer_progress()
56 *bits_left = drbd_bm_total_weight(device) - device->rs_failed; in drbd_get_syncer_progress()
78 unsigned long tmp = 1000UL - left * 1000UL/total; in drbd_get_syncer_progress()
90 static void drbd_syncer_progress(struct drbd_device *device, struct seq_file *seq, in drbd_syncer_progress() argument
101 y = 20-x; in drbd_syncer_progress()
102 seq_puts(seq, "\t["); in drbd_syncer_progress()
104 seq_putc(seq, '='); in drbd_syncer_progress()
105 seq_putc(seq, '>'); in drbd_syncer_progress()
107 seq_putc(seq, '.'); in drbd_syncer_progress()
108 seq_puts(seq, "] "); in drbd_syncer_progress()
111 seq_puts(seq, "verified:"); in drbd_syncer_progress()
113 seq_puts(seq, "sync'ed:"); in drbd_syncer_progress()
114 seq_printf(seq, "%3u.%u%% ", res / 10, res % 10); in drbd_syncer_progress()
117 if (rs_total > (4UL << (30 - BM_BLOCK_SHIFT))) in drbd_syncer_progress()
118 seq_printf(seq, "(%lu/%lu)M", in drbd_syncer_progress()
122 seq_printf(seq, "(%lu/%lu)K", in drbd_syncer_progress()
126 seq_puts(seq, "\n\t"); in drbd_syncer_progress()
138 * at least (DRBD_SYNC_MARKS-2)*DRBD_SYNC_MARK_STEP old, and has at in drbd_syncer_progress()
140 /* ------------------------ ~18s average ------------------------ */ in drbd_syncer_progress()
141 i = (device->rs_last_mark + 2) % DRBD_SYNC_MARKS; in drbd_syncer_progress()
142 dt = (jiffies - device->rs_mark_time[i]) / HZ; in drbd_syncer_progress()
148 db = device->rs_mark_left[i] - rs_left; in drbd_syncer_progress()
151 seq_printf(seq, "finish: %lu:%02lu:%02lu", in drbd_syncer_progress()
155 seq_puts(seq, " speed: "); in drbd_syncer_progress()
156 seq_printf_with_thousands_grouping(seq, dbdt); in drbd_syncer_progress()
157 seq_puts(seq, " ("); in drbd_syncer_progress()
158 /* ------------------------- ~3s average ------------------------ */ in drbd_syncer_progress()
161 i = (device->rs_last_mark + DRBD_SYNC_MARKS-1) % DRBD_SYNC_MARKS; in drbd_syncer_progress()
162 dt = (jiffies - device->rs_mark_time[i]) / HZ; in drbd_syncer_progress()
165 db = device->rs_mark_left[i] - rs_left; in drbd_syncer_progress()
167 seq_printf_with_thousands_grouping(seq, dbdt); in drbd_syncer_progress()
168 seq_puts(seq, " -- "); in drbd_syncer_progress()
171 /* --------------------- long term average ---------------------- */ in drbd_syncer_progress()
174 dt = (jiffies - device->rs_start - device->rs_paused) / HZ; in drbd_syncer_progress()
177 db = rs_total - rs_left; in drbd_syncer_progress()
179 seq_printf_with_thousands_grouping(seq, dbdt); in drbd_syncer_progress()
180 seq_putc(seq, ')'); in drbd_syncer_progress()
184 seq_puts(seq, " want: "); in drbd_syncer_progress()
185 seq_printf_with_thousands_grouping(seq, device->c_sync_rate); in drbd_syncer_progress()
187 seq_printf(seq, " K/sec%s\n", stalled ? " (stalled)" : ""); in drbd_syncer_progress()
197 bit_pos = bm_bits - device->ov_left; in drbd_syncer_progress()
199 stop_sector = device->ov_stop_sector; in drbd_syncer_progress()
201 bit_pos = device->bm_resync_fo; in drbd_syncer_progress()
204 seq_printf(seq, in drbd_syncer_progress()
210 seq_printf(seq, " stop sector: %llu", stop_sector); in drbd_syncer_progress()
211 seq_putc(seq, '\n'); in drbd_syncer_progress()
215 int drbd_seq_show(struct seq_file *seq, void *v) in drbd_seq_show() argument
217 int i, prev_i = -1; in drbd_seq_show()
230 seq_printf(seq, "version: " REL_VERSION " (api:%d/proto:%d-%d)\n%s\n", in drbd_seq_show()
250 oos .. known out-of-sync kB in drbd_seq_show()
255 if (prev_i != i - 1) in drbd_seq_show()
256 seq_putc(seq, '\n'); in drbd_seq_show()
259 state = device->state; in drbd_seq_show()
265 seq_printf(seq, "%2d: cs:Unconfigured\n", i); in drbd_seq_show()
267 /* reset device->congestion_reason */ in drbd_seq_show()
269 nc = rcu_dereference(first_peer_device(device)->connection->net_conf); in drbd_seq_show()
270 wp = nc ? nc->wire_protocol - DRBD_PROT_A + 'A' : ' '; in drbd_seq_show()
271 seq_printf(seq, in drbd_seq_show()
282 state.aftr_isp ? 'a' : '-', in drbd_seq_show()
283 state.peer_isp ? 'p' : '-', in drbd_seq_show()
284 state.user_isp ? 'u' : '-', in drbd_seq_show()
285 device->congestion_reason ?: '-', in drbd_seq_show()
286 test_bit(AL_SUSPENDED, &device->flags) ? 's' : '-', in drbd_seq_show()
287 device->send_cnt/2, in drbd_seq_show()
288 device->recv_cnt/2, in drbd_seq_show()
289 device->writ_cnt/2, in drbd_seq_show()
290 device->read_cnt/2, in drbd_seq_show()
291 device->al_writ_cnt, in drbd_seq_show()
292 device->bm_writ_cnt, in drbd_seq_show()
293 atomic_read(&device->local_cnt), in drbd_seq_show()
294 atomic_read(&device->ap_pending_cnt) + in drbd_seq_show()
295 atomic_read(&device->rs_pending_cnt), in drbd_seq_show()
296 atomic_read(&device->unacked_cnt), in drbd_seq_show()
297 atomic_read(&device->ap_bio_cnt), in drbd_seq_show()
298 first_peer_device(device)->connection->epochs, in drbd_seq_show()
299 write_ordering_chars[device->resource->write_ordering] in drbd_seq_show()
301 seq_printf(seq, " oos:%llu\n", in drbd_seq_show()
309 drbd_syncer_progress(device, seq, state); in drbd_seq_show()
312 lc_seq_printf_stats(seq, device->resync); in drbd_seq_show()
313 lc_seq_printf_stats(seq, device->act_log); in drbd_seq_show()
318 seq_printf(seq, "\tblocked on activity log: %d\n", atomic_read(&device->ap_actlog_cnt)); in drbd_seq_show()