Lines Matching +full:clock +full:- +full:duration +full:- +full:ns
1 /* SPDX-License-Identifier: GPL-2.0 */
3 * bch2_time_stats - collect statistics on events that have a duration, with nicely
6 * - percpu buffering of event collection: cheap enough to shotgun
10 * - number of events
11 * - maximum event duration ever seen
12 * - sum of all event durations
13 * - average event duration, standard and weighted
14 * - standard deviation of event durations, standard and weighted
18 * deviation and weighted standard deviation, to give an efficient-to-compute
19 * view of current behaviour versus. average behaviour - "did this event source
27 #include <linux/sched/clock.h>
41 const struct time_unit *bch2_pick_time_units(u64 ns);
44 * quantiles - do not use:
46 * Only enabled if bch2_time_stats->quantiles_enabled has been manually set - don't
100 return stats->have_quantiles in time_stats_to_quantiles()
101 ? &container_of(stats, struct bch2_time_stats_quantiles, stats)->quantiles in time_stats_to_quantiles()
109 * time_stats_update - collect a new event being tracked
111 * @stats - bch2_time_stats to update
112 * @start - start time of event, recorded with local_clock()
114 * The end duration of the event will be the current time
122 * track_event_change - track state change events
124 * @stats - bch2_time_stats to update
125 * @v - new state, true or false
132 if (v != !!stats->last_event_start) { in track_event_change()
134 bch2_time_stats_update(stats, stats->last_event_start); in track_event_change()
135 stats->last_event_start = 0; in track_event_change()
137 stats->last_event_start = local_clock() ?: 1; in track_event_change()
151 bch2_time_stats_exit(&statq->stats); in bch2_time_stats_quantiles_exit()
155 bch2_time_stats_init(&statq->stats); in bch2_time_stats_quantiles_init()
156 statq->stats.have_quantiles = true; in bch2_time_stats_quantiles_init()
157 memset(&statq->quantiles, 0, sizeof(statq->quantiles)); in bch2_time_stats_quantiles_init()