1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16#ifndef __LOCKING_LOCK_EVENTS_H
17#define __LOCKING_LOCK_EVENTS_H
18
19enum lock_events {
20
21#include "lock_events_list.h"
22
23 lockevent_num,
24 LOCKEVENT_reset_cnts = lockevent_num,
25};
26
27#ifdef CONFIG_LOCK_EVENT_COUNTS
28
29
30
31DECLARE_PER_CPU(unsigned long, lockevents[lockevent_num]);
32
33
34
35
36
37static inline void __lockevent_inc(enum lock_events event, bool cond)
38{
39 if (cond)
40 raw_cpu_inc(lockevents[event]);
41}
42
43#define lockevent_inc(ev) __lockevent_inc(LOCKEVENT_ ##ev, true)
44#define lockevent_cond_inc(ev, c) __lockevent_inc(LOCKEVENT_ ##ev, c)
45
46static inline void __lockevent_add(enum lock_events event, int inc)
47{
48 raw_cpu_add(lockevents[event], inc);
49}
50
51#define lockevent_add(ev, c) __lockevent_add(LOCKEVENT_ ##ev, c)
52
53#else
54
55#define lockevent_inc(ev)
56#define lockevent_add(ev, c)
57#define lockevent_cond_inc(ev, c)
58
59#endif
60#endif
61