~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/trace/events/wbt.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 #undef TRACE_SYSTEM
  3 #define TRACE_SYSTEM wbt
  4 
  5 #if !defined(_TRACE_WBT_H) || defined(TRACE_HEADER_MULTI_READ)
  6 #define _TRACE_WBT_H
  7 
  8 #include <linux/tracepoint.h>
  9 #include "../../../block/blk-wbt.h"
 10 
 11 /**
 12  * wbt_stat - trace stats for blk_wb
 13  * @stat: array of read/write stats
 14  */
 15 TRACE_EVENT(wbt_stat,
 16 
 17         TP_PROTO(struct backing_dev_info *bdi, struct blk_rq_stat *stat),
 18 
 19         TP_ARGS(bdi, stat),
 20 
 21         TP_STRUCT__entry(
 22                 __array(char, name, 32)
 23                 __field(s64, rmean)
 24                 __field(u64, rmin)
 25                 __field(u64, rmax)
 26                 __field(s64, rnr_samples)
 27                 __field(s64, rtime)
 28                 __field(s64, wmean)
 29                 __field(u64, wmin)
 30                 __field(u64, wmax)
 31                 __field(s64, wnr_samples)
 32                 __field(s64, wtime)
 33         ),
 34 
 35         TP_fast_assign(
 36                 strscpy(__entry->name, bdi_dev_name(bdi),
 37                         ARRAY_SIZE(__entry->name));
 38                 __entry->rmean          = stat[0].mean;
 39                 __entry->rmin           = stat[0].min;
 40                 __entry->rmax           = stat[0].max;
 41                 __entry->rnr_samples    = stat[0].nr_samples;
 42                 __entry->wmean          = stat[1].mean;
 43                 __entry->wmin           = stat[1].min;
 44                 __entry->wmax           = stat[1].max;
 45                 __entry->wnr_samples    = stat[1].nr_samples;
 46         ),
 47 
 48         TP_printk("%s: rmean=%llu, rmin=%llu, rmax=%llu, rsamples=%llu, "
 49                   "wmean=%llu, wmin=%llu, wmax=%llu, wsamples=%llu",
 50                   __entry->name, __entry->rmean, __entry->rmin, __entry->rmax,
 51                   __entry->rnr_samples, __entry->wmean, __entry->wmin,
 52                   __entry->wmax, __entry->wnr_samples)
 53 );
 54 
 55 /**
 56  * wbt_lat - trace latency event
 57  * @lat: latency trigger
 58  */
 59 TRACE_EVENT(wbt_lat,
 60 
 61         TP_PROTO(struct backing_dev_info *bdi, unsigned long lat),
 62 
 63         TP_ARGS(bdi, lat),
 64 
 65         TP_STRUCT__entry(
 66                 __array(char, name, 32)
 67                 __field(unsigned long, lat)
 68         ),
 69 
 70         TP_fast_assign(
 71                 strscpy(__entry->name, bdi_dev_name(bdi),
 72                         ARRAY_SIZE(__entry->name));
 73                 __entry->lat = div_u64(lat, 1000);
 74         ),
 75 
 76         TP_printk("%s: latency %lluus", __entry->name,
 77                         (unsigned long long) __entry->lat)
 78 );
 79 
 80 /**
 81  * wbt_step - trace wb event step
 82  * @msg: context message
 83  * @step: the current scale step count
 84  * @window: the current monitoring window
 85  * @bg: the current background queue limit
 86  * @normal: the current normal writeback limit
 87  * @max: the current max throughput writeback limit
 88  */
 89 TRACE_EVENT(wbt_step,
 90 
 91         TP_PROTO(struct backing_dev_info *bdi, const char *msg,
 92                  int step, unsigned long window, unsigned int bg,
 93                  unsigned int normal, unsigned int max),
 94 
 95         TP_ARGS(bdi, msg, step, window, bg, normal, max),
 96 
 97         TP_STRUCT__entry(
 98                 __array(char, name, 32)
 99                 __field(const char *, msg)
100                 __field(int, step)
101                 __field(unsigned long, window)
102                 __field(unsigned int, bg)
103                 __field(unsigned int, normal)
104                 __field(unsigned int, max)
105         ),
106 
107         TP_fast_assign(
108                 strscpy(__entry->name, bdi_dev_name(bdi),
109                         ARRAY_SIZE(__entry->name));
110                 __entry->msg    = msg;
111                 __entry->step   = step;
112                 __entry->window = div_u64(window, 1000);
113                 __entry->bg     = bg;
114                 __entry->normal = normal;
115                 __entry->max    = max;
116         ),
117 
118         TP_printk("%s: %s: step=%d, window=%luus, background=%u, normal=%u, max=%u",
119                   __entry->name, __entry->msg, __entry->step, __entry->window,
120                   __entry->bg, __entry->normal, __entry->max)
121 );
122 
123 /**
124  * wbt_timer - trace wb timer event
125  * @status: timer state status
126  * @step: the current scale step count
127  * @inflight: tracked writes inflight
128  */
129 TRACE_EVENT(wbt_timer,
130 
131         TP_PROTO(struct backing_dev_info *bdi, unsigned int status,
132                  int step, unsigned int inflight),
133 
134         TP_ARGS(bdi, status, step, inflight),
135 
136         TP_STRUCT__entry(
137                 __array(char, name, 32)
138                 __field(unsigned int, status)
139                 __field(int, step)
140                 __field(unsigned int, inflight)
141         ),
142 
143         TP_fast_assign(
144                 strscpy(__entry->name, bdi_dev_name(bdi),
145                         ARRAY_SIZE(__entry->name));
146                 __entry->status         = status;
147                 __entry->step           = step;
148                 __entry->inflight       = inflight;
149         ),
150 
151         TP_printk("%s: status=%u, step=%d, inflight=%u", __entry->name,
152                   __entry->status, __entry->step, __entry->inflight)
153 );
154 
155 #endif /* _TRACE_WBT_H */
156 
157 /* This part must be outside protection */
158 #include <trace/define_trace.h>
159 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php