Thread (1 message) 1 message, 1 author, 2013-11-08

How to find out which part of code is changing a particular data structure.

From: Valdis.Kletnieks at vt.edu <hidden>
Date: 2013-11-08 14:51:54

On Thu, 07 Nov 2013 23:23:18 -0800, kiran kumar said:
Can you define that location as read only(i.e constant)?. This is only for
debug prupose, later you can remove.
Note that this requires 2 things:

1) A kernel built with CONFIG_DEBUG_RODATA=y

2) The structure needs to have a compile-time initializer:

struct foo barbaz = { 5, 3, "quuz"};

Otherwise, your kernel will throw an oops when it tries to initialize
the structure at runtime (which is almost certainly *not* the time that
is causing the actual problem).

Simply declaring it as 'const struct' may or may not help - this will catch
at compile time lots of mistakes, but isn't guaranteed to stop all cases of
buggy uses of miscast pointers, etc....
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 865 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20131108/911e8537/attachment.bin 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help