@@ -137,6 +137,27 @@ static inline char *get_synch_chars(struct lock_info *info, char buf[2])
137
137
return buf ;
138
138
}
139
139
140
+ static inline char * get_held_chars (struct held_lock * held , char buf [2 ])
141
+ {
142
+ char * ptr = buf ;
143
+
144
+ switch (held -> info -> type ) {
145
+ case SYNCH_TYPE_MUTEX :
146
+ break ;
147
+ case SYNCH_TYPE_RW :
148
+ * ptr = held -> rwlock_wr ? 'w' : 'r' ;
149
+ ptr ++ ;
150
+ break ;
151
+ case SYNCH_TYPE_COND :
152
+ break ;
153
+ }
154
+
155
+ /* null terminate for good measure */
156
+ * ptr = '\0' ;
157
+
158
+ return buf ;
159
+ }
160
+
140
161
static void print_invalid_call (const char * fxn , const struct lock_context * where )
141
162
{
142
163
panic ("lockdep: invalid call to %s at %s:%d" , fxn , where -> file ,
@@ -193,12 +214,14 @@ static void print_held_locks(struct held_lock *highlight)
193
214
struct lock_info * info = cur -> info ;
194
215
struct lock * lock = container_of (info , struct lock , info );
195
216
char synch_chars [2 ];
217
+ char held_chars [2 ];
196
218
197
- cmn_err (CE_CRIT , "lockdep: %s #%zd: %s (%p) %s <%s> acquired at %s:%d" ,
219
+ cmn_err (CE_CRIT , "lockdep: %s #%zd: %s (%p) %s <%s%s > acquired at %s:%d" ,
198
220
(cur == highlight ) ? "->" : " " ,
199
221
i , info -> name , lock ,
200
222
synch_type_str (info -> type ),
201
223
get_synch_chars (info , synch_chars ),
224
+ get_held_chars (cur , held_chars ),
202
225
cur -> where .file , cur -> where .line );
203
226
}
204
227
}
0 commit comments