aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2008-10-16 17:17:09 -0400
committerIngo Molnar <mingo@elte.hu>2008-10-20 09:43:10 -0400
commitc7e78cff6b7518212247fb20b1dc6411540dc9af (patch)
tree4152afb3e00df125303c4c603e01addc19059ac7 /include/linux
parent7317d7b87edb41a9135e30be1ec3f7ef817c53dd (diff)
lockstat: contend with points
We currently only provide points that have to wait on contention, also lists the points we have to wait for. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/lockdep.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h
index 0aa657aa8a1e..fc9f8e88123b 100644
--- a/include/linux/lockdep.h
+++ b/include/linux/lockdep.h
@@ -73,6 +73,8 @@ struct lock_class_key {
73 struct lockdep_subclass_key subkeys[MAX_LOCKDEP_SUBCLASSES]; 73 struct lockdep_subclass_key subkeys[MAX_LOCKDEP_SUBCLASSES];
74}; 74};
75 75
76#define LOCKSTAT_POINTS 4
77
76/* 78/*
77 * The lock-class itself: 79 * The lock-class itself:
78 */ 80 */
@@ -119,7 +121,8 @@ struct lock_class {
119 int name_version; 121 int name_version;
120 122
121#ifdef CONFIG_LOCK_STAT 123#ifdef CONFIG_LOCK_STAT
122 unsigned long contention_point[4]; 124 unsigned long contention_point[LOCKSTAT_POINTS];
125 unsigned long contending_point[LOCKSTAT_POINTS];
123#endif 126#endif
124}; 127};
125 128
@@ -144,6 +147,7 @@ enum bounce_type {
144 147
145struct lock_class_stats { 148struct lock_class_stats {
146 unsigned long contention_point[4]; 149 unsigned long contention_point[4];
150 unsigned long contending_point[4];
147 struct lock_time read_waittime; 151 struct lock_time read_waittime;
148 struct lock_time write_waittime; 152 struct lock_time write_waittime;
149 struct lock_time read_holdtime; 153 struct lock_time read_holdtime;
@@ -165,6 +169,7 @@ struct lockdep_map {
165 const char *name; 169 const char *name;
166#ifdef CONFIG_LOCK_STAT 170#ifdef CONFIG_LOCK_STAT
167 int cpu; 171 int cpu;
172 unsigned long ip;
168#endif 173#endif
169}; 174};
170 175
@@ -355,7 +360,7 @@ struct lock_class_key { };
355#ifdef CONFIG_LOCK_STAT 360#ifdef CONFIG_LOCK_STAT
356 361
357extern void lock_contended(struct lockdep_map *lock, unsigned long ip); 362extern void lock_contended(struct lockdep_map *lock, unsigned long ip);
358extern void lock_acquired(struct lockdep_map *lock); 363extern void lock_acquired(struct lockdep_map *lock, unsigned long ip);
359 364
360#define LOCK_CONTENDED(_lock, try, lock) \ 365#define LOCK_CONTENDED(_lock, try, lock) \
361do { \ 366do { \
@@ -363,13 +368,13 @@ do { \
363 lock_contended(&(_lock)->dep_map, _RET_IP_); \ 368 lock_contended(&(_lock)->dep_map, _RET_IP_); \
364 lock(_lock); \ 369 lock(_lock); \
365 } \ 370 } \
366 lock_acquired(&(_lock)->dep_map); \ 371 lock_acquired(&(_lock)->dep_map, _RET_IP_); \
367} while (0) 372} while (0)
368 373
369#else /* CONFIG_LOCK_STAT */ 374#else /* CONFIG_LOCK_STAT */
370 375
371#define lock_contended(lockdep_map, ip) do {} while (0) 376#define lock_contended(lockdep_map, ip) do {} while (0)
372#define lock_acquired(lockdep_map) do {} while (0) 377#define lock_acquired(lockdep_map, ip) do {} while (0)
373 378
374#define LOCK_CONTENDED(_lock, try, lock) \ 379#define LOCK_CONTENDED(_lock, try, lock) \
375 lock(_lock) 380 lock(_lock)