1 #ifndef _BCACHE_STATS_H_
2 #define _BCACHE_STATS_H_
4 struct cache_stat_collector
{
7 atomic_t cache_bypass_hits
;
8 atomic_t cache_bypass_misses
;
9 atomic_t cache_readaheads
;
10 atomic_t cache_miss_collisions
;
11 atomic_t sectors_bypassed
;
17 unsigned long cache_hits
;
18 unsigned long cache_misses
;
19 unsigned long cache_bypass_hits
;
20 unsigned long cache_bypass_misses
;
21 unsigned long cache_readaheads
;
22 unsigned long cache_miss_collisions
;
23 unsigned long sectors_bypassed
;
28 struct cache_accounting
{
30 struct timer_list timer
;
33 struct cache_stat_collector collector
;
35 struct cache_stats total
;
36 struct cache_stats five_minute
;
37 struct cache_stats hour
;
38 struct cache_stats day
;
45 void bch_cache_accounting_init(struct cache_accounting
*acc
,
46 struct closure
*parent
);
48 int bch_cache_accounting_add_kobjs(struct cache_accounting
*acc
,
49 struct kobject
*parent
);
51 void bch_cache_accounting_clear(struct cache_accounting
*acc
);
53 void bch_cache_accounting_destroy(struct cache_accounting
*acc
);
55 void bch_mark_cache_accounting(struct cache_set
*, struct bcache_device
*,
57 void bch_mark_cache_readahead(struct cache_set
*, struct bcache_device
*);
58 void bch_mark_cache_miss_collision(struct cache_set
*, struct bcache_device
*);
59 void bch_mark_sectors_bypassed(struct cache_set
*, struct cached_dev
*, int);
61 #endif /* _BCACHE_STATS_H_ */