-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This adds a tracepoint that can both observe the nbd request being sent to the server, as well as modify that request , e.g., setting a flag in the request that will cause the server to collect detailed tracing data. The struct request * being handled is included to permit correlation with the block tracepoints. Signed-off-by: Matt Mullins <mmullins@fb.com> Reviewed-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
- Loading branch information
Matt Mullins
authored and
Alexei Starovoitov
committed
Apr 27, 2019
1 parent
9df1c28
commit ea10672
Showing
3 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| /* SPDX-License-Identifier: GPL-2.0 */ | ||
| #undef TRACE_SYSTEM | ||
| #define TRACE_SYSTEM nbd | ||
|
|
||
| #if !defined(_TRACE_NBD_H) || defined(TRACE_HEADER_MULTI_READ) | ||
| #define _TRACE_NBD_H | ||
|
|
||
| #include <linux/tracepoint.h> | ||
|
|
||
| DECLARE_EVENT_CLASS(nbd_send_request, | ||
|
|
||
| TP_PROTO(struct nbd_request *nbd_request, int index, | ||
| struct request *rq), | ||
|
|
||
| TP_ARGS(nbd_request, index, rq), | ||
|
|
||
| TP_STRUCT__entry( | ||
| __field(struct nbd_request *, nbd_request) | ||
| __field(u64, dev_index) | ||
| __field(struct request *, request) | ||
| ), | ||
|
|
||
| TP_fast_assign( | ||
| __entry->nbd_request = 0; | ||
| __entry->dev_index = index; | ||
| __entry->request = rq; | ||
| ), | ||
|
|
||
| TP_printk("nbd%lld: request %p", __entry->dev_index, __entry->request) | ||
| ); | ||
|
|
||
| #ifdef DEFINE_EVENT_WRITABLE | ||
| #undef NBD_DEFINE_EVENT | ||
| #define NBD_DEFINE_EVENT(template, call, proto, args, size) \ | ||
| DEFINE_EVENT_WRITABLE(template, call, PARAMS(proto), \ | ||
| PARAMS(args), size) | ||
| #else | ||
| #undef NBD_DEFINE_EVENT | ||
| #define NBD_DEFINE_EVENT(template, call, proto, args, size) \ | ||
| DEFINE_EVENT(template, call, PARAMS(proto), PARAMS(args)) | ||
| #endif | ||
|
|
||
| NBD_DEFINE_EVENT(nbd_send_request, nbd_send_request, | ||
|
|
||
| TP_PROTO(struct nbd_request *nbd_request, int index, | ||
| struct request *rq), | ||
|
|
||
| TP_ARGS(nbd_request, index, rq), | ||
|
|
||
| sizeof(struct nbd_request) | ||
| ); | ||
|
|
||
| #endif | ||
|
|
||
| /* This part must be outside protection */ | ||
| #include <trace/define_trace.h> |