2018-09-28 01:55:55 +03:00
/* SPDX-License-Identifier: GPL-2.0 */
# undef TRACE_SYSTEM
# define TRACE_SYSTEM kyber
# if !defined(_TRACE_KYBER_H) || defined(TRACE_HEADER_MULTI_READ)
# define _TRACE_KYBER_H
# include <linux/blkdev.h>
# include <linux/tracepoint.h>
# define DOMAIN_LEN 16
# define LATENCY_TYPE_LEN 8
TRACE_EVENT ( kyber_latency ,
2021-10-12 12:33:01 +03:00
TP_PROTO ( dev_t dev , const char * domain , const char * type ,
2018-09-28 01:55:55 +03:00
unsigned int percentile , unsigned int numerator ,
unsigned int denominator , unsigned int samples ) ,
2021-10-12 12:33:01 +03:00
TP_ARGS ( dev , domain , type , percentile , numerator , denominator , samples ) ,
2018-09-28 01:55:55 +03:00
TP_STRUCT__entry (
__field ( dev_t , dev )
__array ( char , domain , DOMAIN_LEN )
__array ( char , type , LATENCY_TYPE_LEN )
__field ( u8 , percentile )
__field ( u8 , numerator )
__field ( u8 , denominator )
__field ( unsigned int , samples )
) ,
TP_fast_assign (
2021-10-12 12:33:01 +03:00
__entry - > dev = dev ;
2018-11-12 11:08:46 +03:00
strlcpy ( __entry - > domain , domain , sizeof ( __entry - > domain ) ) ;
strlcpy ( __entry - > type , type , sizeof ( __entry - > type ) ) ;
2018-09-28 01:55:55 +03:00
__entry - > percentile = percentile ;
__entry - > numerator = numerator ;
__entry - > denominator = denominator ;
__entry - > samples = samples ;
) ,
TP_printk ( " %d,%d %s %s p%u %u/%u samples=%u " ,
MAJOR ( __entry - > dev ) , MINOR ( __entry - > dev ) , __entry - > domain ,
__entry - > type , __entry - > percentile , __entry - > numerator ,
__entry - > denominator , __entry - > samples )
) ;
TRACE_EVENT ( kyber_adjust ,
2021-10-12 12:33:01 +03:00
TP_PROTO ( dev_t dev , const char * domain , unsigned int depth ) ,
2018-09-28 01:55:55 +03:00
2021-10-12 12:33:01 +03:00
TP_ARGS ( dev , domain , depth ) ,
2018-09-28 01:55:55 +03:00
TP_STRUCT__entry (
__field ( dev_t , dev )
__array ( char , domain , DOMAIN_LEN )
__field ( unsigned int , depth )
) ,
TP_fast_assign (
2021-10-12 12:33:01 +03:00
__entry - > dev = dev ;
2018-11-12 11:08:46 +03:00
strlcpy ( __entry - > domain , domain , sizeof ( __entry - > domain ) ) ;
2018-09-28 01:55:55 +03:00
__entry - > depth = depth ;
) ,
TP_printk ( " %d,%d %s %u " ,
MAJOR ( __entry - > dev ) , MINOR ( __entry - > dev ) , __entry - > domain ,
__entry - > depth )
) ;
TRACE_EVENT ( kyber_throttled ,
2021-10-12 12:33:01 +03:00
TP_PROTO ( dev_t dev , const char * domain ) ,
2018-09-28 01:55:55 +03:00
2021-10-12 12:33:01 +03:00
TP_ARGS ( dev , domain ) ,
2018-09-28 01:55:55 +03:00
TP_STRUCT__entry (
__field ( dev_t , dev )
__array ( char , domain , DOMAIN_LEN )
) ,
TP_fast_assign (
2021-10-12 12:33:01 +03:00
__entry - > dev = dev ;
2018-11-12 11:08:46 +03:00
strlcpy ( __entry - > domain , domain , sizeof ( __entry - > domain ) ) ;
2018-09-28 01:55:55 +03:00
) ,
TP_printk ( " %d,%d %s " , MAJOR ( __entry - > dev ) , MINOR ( __entry - > dev ) ,
__entry - > domain )
) ;
# define _TRACE_KYBER_H
# endif /* _TRACE_KYBER_H */
/* This part must be outside protection */
# include <trace/define_trace.h>