diff options
author | David Howells <dhowells@redhat.com> | 2017-11-02 11:27:51 -0400 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2017-11-13 10:38:19 -0500 |
commit | 2c099014a0a456012c1778e80adce839bf956b77 (patch) | |
tree | 1ea2a00f106f02853bdff8309fdb83c59c17377d | |
parent | 025db80c9e421efef11f2b83b7f78a11476f06db (diff) |
afs: Trace the sending of pages
Add a pair of tracepoints to log the sending of pages for an FS.StoreData
or FS.StoreData64 operation.
Tracepoint afs_send_pages notes each set of pages added to the operation.
There may be several of these per operation as we get up at most 8
contiguous pages in one go because the bvec we're using is on the stack.
Tracepoint afs_sent_pages notes the end of adding data from a whole run of
pages to the operation and the completion of the request phase.
Signed-off-by: David Howells <dhowells@redhat.com>
-rw-r--r-- | fs/afs/rxrpc.c | 3 | ||||
-rw-r--r-- | include/trace/events/afs.h | 61 |
2 files changed, 64 insertions, 0 deletions
diff --git a/fs/afs/rxrpc.c b/fs/afs/rxrpc.c index 59cc58022c4d..06a51d70b82b 100644 --- a/fs/afs/rxrpc.c +++ b/fs/afs/rxrpc.c | |||
@@ -303,6 +303,8 @@ static int afs_send_pages(struct afs_call *call, struct msghdr *msg) | |||
303 | 303 | ||
304 | do { | 304 | do { |
305 | afs_load_bvec(call, msg, bv, first, last, offset); | 305 | afs_load_bvec(call, msg, bv, first, last, offset); |
306 | trace_afs_send_pages(call, msg, first, last, offset); | ||
307 | |||
306 | offset = 0; | 308 | offset = 0; |
307 | bytes = msg->msg_iter.count; | 309 | bytes = msg->msg_iter.count; |
308 | nr = msg->msg_iter.nr_segs; | 310 | nr = msg->msg_iter.nr_segs; |
@@ -317,6 +319,7 @@ static int afs_send_pages(struct afs_call *call, struct msghdr *msg) | |||
317 | first += nr; | 319 | first += nr; |
318 | } while (first <= last); | 320 | } while (first <= last); |
319 | 321 | ||
322 | trace_afs_sent_pages(call, call->first, last, first, ret); | ||
320 | return ret; | 323 | return ret; |
321 | } | 324 | } |
322 | 325 | ||
diff --git a/include/trace/events/afs.h b/include/trace/events/afs.h index dd9d2600ee98..c780f4c39a53 100644 --- a/include/trace/events/afs.h +++ b/include/trace/events/afs.h | |||
@@ -320,6 +320,67 @@ TRACE_EVENT(afs_call_done, | |||
320 | __entry->rx_call) | 320 | __entry->rx_call) |
321 | ); | 321 | ); |
322 | 322 | ||
323 | TRACE_EVENT(afs_send_pages, | ||
324 | TP_PROTO(struct afs_call *call, struct msghdr *msg, | ||
325 | pgoff_t first, pgoff_t last, unsigned int offset), | ||
326 | |||
327 | TP_ARGS(call, msg, first, last, offset), | ||
328 | |||
329 | TP_STRUCT__entry( | ||
330 | __field(struct afs_call *, call ) | ||
331 | __field(pgoff_t, first ) | ||
332 | __field(pgoff_t, last ) | ||
333 | __field(unsigned int, nr ) | ||
334 | __field(unsigned int, bytes ) | ||
335 | __field(unsigned int, offset ) | ||
336 | __field(unsigned int, flags ) | ||
337 | ), | ||
338 | |||
339 | TP_fast_assign( | ||
340 | __entry->call = call; | ||
341 | __entry->first = first; | ||
342 | __entry->last = last; | ||
343 | __entry->nr = msg->msg_iter.nr_segs; | ||
344 | __entry->bytes = msg->msg_iter.count; | ||
345 | __entry->offset = offset; | ||
346 | __entry->flags = msg->msg_flags; | ||
347 | ), | ||
348 | |||
349 | TP_printk(" c=%p %lx-%lx-%lx b=%x o=%x f=%x", | ||
350 | __entry->call, | ||
351 | __entry->first, __entry->first + __entry->nr - 1, __entry->last, | ||
352 | __entry->bytes, __entry->offset, | ||
353 | __entry->flags) | ||
354 | ); | ||
355 | |||
356 | TRACE_EVENT(afs_sent_pages, | ||
357 | TP_PROTO(struct afs_call *call, pgoff_t first, pgoff_t last, | ||
358 | pgoff_t cursor, int ret), | ||
359 | |||
360 | TP_ARGS(call, first, last, cursor, ret), | ||
361 | |||
362 | TP_STRUCT__entry( | ||
363 | __field(struct afs_call *, call ) | ||
364 | __field(pgoff_t, first ) | ||
365 | __field(pgoff_t, last ) | ||
366 | __field(pgoff_t, cursor ) | ||
367 | __field(int, ret ) | ||
368 | ), | ||
369 | |||
370 | TP_fast_assign( | ||
371 | __entry->call = call; | ||
372 | __entry->first = first; | ||
373 | __entry->last = last; | ||
374 | __entry->cursor = cursor; | ||
375 | __entry->ret = ret; | ||
376 | ), | ||
377 | |||
378 | TP_printk(" c=%p %lx-%lx c=%lx r=%d", | ||
379 | __entry->call, | ||
380 | __entry->first, __entry->last, | ||
381 | __entry->cursor, __entry->ret) | ||
382 | ); | ||
383 | |||
323 | #endif /* _TRACE_AFS_H */ | 384 | #endif /* _TRACE_AFS_H */ |
324 | 385 | ||
325 | /* This part must be outside protection */ | 386 | /* This part must be outside protection */ |