Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/counter.h
Show First 20 Lines • Show All 66 Lines • ▼ Show 20 Lines | |||||
*/ | */ | ||||
struct counter_rate { | struct counter_rate { | ||||
counter_u64_t cr_rate; /* Events since last second */ | counter_u64_t cr_rate; /* Events since last second */ | ||||
volatile int cr_lock; /* Lock to clean the struct */ | volatile int cr_lock; /* Lock to clean the struct */ | ||||
int cr_ticks; /* Ticks on last clean */ | int cr_ticks; /* Ticks on last clean */ | ||||
int cr_over; /* Over limit since cr_ticks? */ | int cr_over; /* Over limit since cr_ticks? */ | ||||
}; | }; | ||||
int64_t counter_ratecheck(struct counter_rate *, int64_t); | int64_t counter_ratecheck(struct counter_rate *, int64_t, int64_t); | ||||
cy: counter_ratecheck() in ys/kern/subr_counter.c takes only two arguments. | |||||
Done Inline ActionsThis commit is changing that API and file to take 3 arguments. That's why it shows up in the diff. cem: This commit is changing that API and file to take 3 arguments. That's why it shows up in the… | |||||
Done Inline ActionsMy mistake. I missed that. cy: My mistake. I missed that. | |||||
#define COUNTER_U64_SYSINIT(c) \ | #define COUNTER_U64_SYSINIT(c) \ | ||||
SYSINIT(c##_counter_sysinit, SI_SUB_COUNTER, \ | SYSINIT(c##_counter_sysinit, SI_SUB_COUNTER, \ | ||||
SI_ORDER_ANY, counter_u64_sysinit, &c); \ | SI_ORDER_ANY, counter_u64_sysinit, &c); \ | ||||
SYSUNINIT(c##_counter_sysuninit, SI_SUB_COUNTER, \ | SYSUNINIT(c##_counter_sysuninit, SI_SUB_COUNTER, \ | ||||
SI_ORDER_ANY, counter_u64_sysuninit, &c) | SI_ORDER_ANY, counter_u64_sysuninit, &c) | ||||
#define COUNTER_U64_DEFINE_EARLY(c) \ | #define COUNTER_U64_DEFINE_EARLY(c) \ | ||||
counter_u64_t __read_mostly c = EARLY_COUNTER; \ | counter_u64_t __read_mostly c = EARLY_COUNTER; \ | ||||
COUNTER_U64_SYSINIT(c) | COUNTER_U64_SYSINIT(c) | ||||
void counter_u64_sysinit(void *); | void counter_u64_sysinit(void *); | ||||
void counter_u64_sysuninit(void *); | void counter_u64_sysuninit(void *); | ||||
#endif /* _KERNEL */ | #endif /* _KERNEL */ | ||||
#endif /* ! __SYS_COUNTER_H__ */ | #endif /* ! __SYS_COUNTER_H__ */ |
counter_ratecheck() in ys/kern/subr_counter.c takes only two arguments.