Omar Sandoval | 6c3b7af | 2018-09-27 15:55:55 -0700 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | #undef TRACE_SYSTEM |
| 3 | #define TRACE_SYSTEM kyber |
| 4 | |
| 5 | #if !defined(_TRACE_KYBER_H) || defined(TRACE_HEADER_MULTI_READ) |
| 6 | #define _TRACE_KYBER_H |
| 7 | |
| 8 | #include <linux/blkdev.h> |
| 9 | #include <linux/tracepoint.h> |
| 10 | |
| 11 | #define DOMAIN_LEN 16 |
| 12 | #define LATENCY_TYPE_LEN 8 |
| 13 | |
| 14 | TRACE_EVENT(kyber_latency, |
| 15 | |
| 16 | TP_PROTO(struct request_queue *q, const char *domain, const char *type, |
| 17 | unsigned int percentile, unsigned int numerator, |
| 18 | unsigned int denominator, unsigned int samples), |
| 19 | |
| 20 | TP_ARGS(q, domain, type, percentile, numerator, denominator, samples), |
| 21 | |
| 22 | TP_STRUCT__entry( |
| 23 | __field( dev_t, dev ) |
| 24 | __array( char, domain, DOMAIN_LEN ) |
| 25 | __array( char, type, LATENCY_TYPE_LEN ) |
| 26 | __field( u8, percentile ) |
| 27 | __field( u8, numerator ) |
| 28 | __field( u8, denominator ) |
| 29 | __field( unsigned int, samples ) |
| 30 | ), |
| 31 | |
| 32 | TP_fast_assign( |
Christoph Hellwig | d152c68 | 2021-08-16 15:46:24 +0200 | [diff] [blame] | 33 | __entry->dev = disk_devt(q->disk); |
Omar Sandoval | 18e962a | 2018-11-12 00:08:46 -0800 | [diff] [blame] | 34 | strlcpy(__entry->domain, domain, sizeof(__entry->domain)); |
| 35 | strlcpy(__entry->type, type, sizeof(__entry->type)); |
Omar Sandoval | 6c3b7af | 2018-09-27 15:55:55 -0700 | [diff] [blame] | 36 | __entry->percentile = percentile; |
| 37 | __entry->numerator = numerator; |
| 38 | __entry->denominator = denominator; |
| 39 | __entry->samples = samples; |
| 40 | ), |
| 41 | |
| 42 | TP_printk("%d,%d %s %s p%u %u/%u samples=%u", |
| 43 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->domain, |
| 44 | __entry->type, __entry->percentile, __entry->numerator, |
| 45 | __entry->denominator, __entry->samples) |
| 46 | ); |
| 47 | |
| 48 | TRACE_EVENT(kyber_adjust, |
| 49 | |
| 50 | TP_PROTO(struct request_queue *q, const char *domain, |
| 51 | unsigned int depth), |
| 52 | |
| 53 | TP_ARGS(q, domain, depth), |
| 54 | |
| 55 | TP_STRUCT__entry( |
| 56 | __field( dev_t, dev ) |
| 57 | __array( char, domain, DOMAIN_LEN ) |
| 58 | __field( unsigned int, depth ) |
| 59 | ), |
| 60 | |
| 61 | TP_fast_assign( |
Christoph Hellwig | d152c68 | 2021-08-16 15:46:24 +0200 | [diff] [blame] | 62 | __entry->dev = disk_devt(q->disk); |
Omar Sandoval | 18e962a | 2018-11-12 00:08:46 -0800 | [diff] [blame] | 63 | strlcpy(__entry->domain, domain, sizeof(__entry->domain)); |
Omar Sandoval | 6c3b7af | 2018-09-27 15:55:55 -0700 | [diff] [blame] | 64 | __entry->depth = depth; |
| 65 | ), |
| 66 | |
| 67 | TP_printk("%d,%d %s %u", |
| 68 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->domain, |
| 69 | __entry->depth) |
| 70 | ); |
| 71 | |
| 72 | TRACE_EVENT(kyber_throttled, |
| 73 | |
| 74 | TP_PROTO(struct request_queue *q, const char *domain), |
| 75 | |
| 76 | TP_ARGS(q, domain), |
| 77 | |
| 78 | TP_STRUCT__entry( |
| 79 | __field( dev_t, dev ) |
| 80 | __array( char, domain, DOMAIN_LEN ) |
| 81 | ), |
| 82 | |
| 83 | TP_fast_assign( |
Christoph Hellwig | d152c68 | 2021-08-16 15:46:24 +0200 | [diff] [blame] | 84 | __entry->dev = disk_devt(q->disk); |
Omar Sandoval | 18e962a | 2018-11-12 00:08:46 -0800 | [diff] [blame] | 85 | strlcpy(__entry->domain, domain, sizeof(__entry->domain)); |
Omar Sandoval | 6c3b7af | 2018-09-27 15:55:55 -0700 | [diff] [blame] | 86 | ), |
| 87 | |
| 88 | TP_printk("%d,%d %s", MAJOR(__entry->dev), MINOR(__entry->dev), |
| 89 | __entry->domain) |
| 90 | ); |
| 91 | |
| 92 | #define _TRACE_KYBER_H |
| 93 | #endif /* _TRACE_KYBER_H */ |
| 94 | |
| 95 | /* This part must be outside protection */ |
| 96 | #include <trace/define_trace.h> |