1 /* SPDX-License-Identifier: GPL-2.0 */
3 #define TRACE_SYSTEM kyber
5 #if !defined(_TRACE_KYBER_H) || defined(TRACE_HEADER_MULTI_READ)
8 #include <linux/blkdev.h>
9 #include <linux/tracepoint.h>
12 #define LATENCY_TYPE_LEN 8
14 TRACE_EVENT(kyber_latency
,
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
),
20 TP_ARGS(q
, domain
, type
, percentile
, numerator
, denominator
, samples
),
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
)
33 __entry
->dev
= disk_devt(dev_to_disk(kobj_to_dev(q
->kobj
.parent
)));
34 strlcpy(__entry
->domain
, domain
, sizeof(__entry
->domain
));
35 strlcpy(__entry
->type
, type
, sizeof(__entry
->type
));
36 __entry
->percentile
= percentile
;
37 __entry
->numerator
= numerator
;
38 __entry
->denominator
= denominator
;
39 __entry
->samples
= samples
;
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
)
48 TRACE_EVENT(kyber_adjust
,
50 TP_PROTO(struct request_queue
*q
, const char *domain
,
53 TP_ARGS(q
, domain
, depth
),
57 __array( char, domain
, DOMAIN_LEN
)
58 __field( unsigned int, depth
)
62 __entry
->dev
= disk_devt(dev_to_disk(kobj_to_dev(q
->kobj
.parent
)));
63 strlcpy(__entry
->domain
, domain
, sizeof(__entry
->domain
));
64 __entry
->depth
= depth
;
67 TP_printk("%d,%d %s %u",
68 MAJOR(__entry
->dev
), MINOR(__entry
->dev
), __entry
->domain
,
72 TRACE_EVENT(kyber_throttled
,
74 TP_PROTO(struct request_queue
*q
, const char *domain
),
80 __array( char, domain
, DOMAIN_LEN
)
84 __entry
->dev
= disk_devt(dev_to_disk(kobj_to_dev(q
->kobj
.parent
)));
85 strlcpy(__entry
->domain
, domain
, sizeof(__entry
->domain
));
88 TP_printk("%d,%d %s", MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
92 #define _TRACE_KYBER_H
93 #endif /* _TRACE_KYBER_H */
95 /* This part must be outside protection */
96 #include <trace/define_trace.h>