diff options
author | David Teigland <teigland@redhat.com> | 2008-12-09 15:12:21 -0500 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2008-12-23 11:18:17 -0500 |
commit | eeda418d8c2646f33f24e9ad33d86c239adc6de7 (patch) | |
tree | fecfb293e62cc043d57535481913b37347006a4c /fs/dlm/debug_fs.c | |
parent | fd22a51bcc0b7b76fc729b02316214fd979f9fe1 (diff) |
dlm: change lock time stamping
Use ktime instead of jiffies for timestamping lkb's. Also stamp the
time on every lkb whenever it's added to a resource queue, instead of
just stamping locks subject to timeouts. This will allow us to use
timestamps more widely for debugging all locks.
Signed-off-by: David Teigland <teigland@redhat.com>
Diffstat (limited to 'fs/dlm/debug_fs.c')
-rw-r--r-- | fs/dlm/debug_fs.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/dlm/debug_fs.c b/fs/dlm/debug_fs.c index 8fc24f4507a3..19e4f9eb44e1 100644 --- a/fs/dlm/debug_fs.c +++ b/fs/dlm/debug_fs.c | |||
@@ -162,21 +162,21 @@ static int print_resource(struct dlm_rsb *res, struct seq_file *s) | |||
162 | 162 | ||
163 | static void print_lock(struct seq_file *s, struct dlm_lkb *lkb, struct dlm_rsb *r) | 163 | static void print_lock(struct seq_file *s, struct dlm_lkb *lkb, struct dlm_rsb *r) |
164 | { | 164 | { |
165 | unsigned int waiting = 0; | 165 | u64 xid = 0; |
166 | uint64_t xid = 0; | 166 | u64 us; |
167 | 167 | ||
168 | if (lkb->lkb_flags & DLM_IFL_USER) { | 168 | if (lkb->lkb_flags & DLM_IFL_USER) { |
169 | if (lkb->lkb_ua) | 169 | if (lkb->lkb_ua) |
170 | xid = lkb->lkb_ua->xid; | 170 | xid = lkb->lkb_ua->xid; |
171 | } | 171 | } |
172 | 172 | ||
173 | if (lkb->lkb_timestamp) | 173 | /* microseconds since lkb was added to current queue */ |
174 | waiting = jiffies_to_msecs(jiffies - lkb->lkb_timestamp); | 174 | us = ktime_to_us(ktime_sub(ktime_get(), lkb->lkb_timestamp)); |
175 | 175 | ||
176 | /* id nodeid remid pid xid exflags flags sts grmode rqmode time_ms | 176 | /* id nodeid remid pid xid exflags flags sts grmode rqmode time_us |
177 | r_nodeid r_len r_name */ | 177 | r_nodeid r_len r_name */ |
178 | 178 | ||
179 | seq_printf(s, "%x %d %x %u %llu %x %x %d %d %d %u %u %d \"%s\"\n", | 179 | seq_printf(s, "%x %d %x %u %llu %x %x %d %d %d %llu %u %d \"%s\"\n", |
180 | lkb->lkb_id, | 180 | lkb->lkb_id, |
181 | lkb->lkb_nodeid, | 181 | lkb->lkb_nodeid, |
182 | lkb->lkb_remid, | 182 | lkb->lkb_remid, |
@@ -187,7 +187,7 @@ static void print_lock(struct seq_file *s, struct dlm_lkb *lkb, struct dlm_rsb * | |||
187 | lkb->lkb_status, | 187 | lkb->lkb_status, |
188 | lkb->lkb_grmode, | 188 | lkb->lkb_grmode, |
189 | lkb->lkb_rqmode, | 189 | lkb->lkb_rqmode, |
190 | waiting, | 190 | (unsigned long long)us, |
191 | r->res_nodeid, | 191 | r->res_nodeid, |
192 | r->res_length, | 192 | r->res_length, |
193 | r->res_name); | 193 | r->res_name); |