Hi All,
In the Base_mappable class, in /fiasco/src/kern/mapping_tree.cpp file, what is type of the lock in this class, helping lock, spin lock or others?
And usually I find it is hard to identify the type of a lock. Could someone tell me how to figure out the lock's type?
Thank you very much. Yuxin
On Fri Aug 22, 2014 at 16:45:51 -0400, Yuxin Ren wrote:
In the Base_mappable class, in /fiasco/src/kern/mapping_tree.cpp file, what is type of the lock in this class, helping lock, spin lock or others?
Looks like it's a Helping_lock.
And usually I find it is hard to identify the type of a lock. Could someone tell me how to figure out the lock's type?
What I did just now: - Look up src/kern/mapping_tree.cpp, find class Base_mappable, find this line in the class: typedef ::Lock Lock; - Seeing that Lock is of type ::Lock - Searching for 'lock' within the file - Finding out that #include "lock.h" is the most obvious way to go on searching - Opening src/kern/lock.cpp - Seeing: typedef Helping_lock Lock; - Done
So the point with going further to lock.cpp may not be so obvious but generally it's just reading around in the code.
Adam
On Sun Aug 24, 2014 at 23:38:50 +0200, Adam Lackorzynski wrote:
On Fri Aug 22, 2014 at 16:45:51 -0400, Yuxin Ren wrote:
In the Base_mappable class, in /fiasco/src/kern/mapping_tree.cpp file, what is type of the lock in this class, helping lock, spin lock or others?
Looks like it's a Helping_lock.
And usually I find it is hard to identify the type of a lock. Could someone tell me how to figure out the lock's type?
So the point with going further to lock.cpp may not be so obvious but generally it's just reading around in the code.
For this one it wasn't obvious to me but generally gdb can do the reading for us: $ gdb fiasco.image (gdb) ptype Base_mappable::Lock type = class Helping_lock : private Switch_lock { ... } (gdb)
Adam
l4-hackers@os.inf.tu-dresden.de