I'm doing kind of test, and I already have spent two weeks researching that topic + yocto.

What I'm trying to do:

I'm writing loadable kernel module which "watches" if address (for example, 0x12345, which i have to pass as a parameter or through sysfs) was read or written and prints kind of backtrace if it did (i don't know if dump_stack() will bear with it, because, i'm very new to kernel, still have to figure it out, depends on your anwers).

I researched some information about how lkm are written, but i have no idea where can i use and when have i pass address to lkm to watch it, all i do for now is writing hello modules and creating chrdev file in dev/ with passed parameters. In short, I have to figure out what kind of work can i do with such module (the one i have to write, not hello-modules).

Yes, I asked about it, but the answer was that i have to figure it out by myself, so i asked your help.

  • Are you asking how to use sysfs to read an address from the user or how to use hardware watchpoints to catch accesses to that address? – Mark Plotnick Feb 28 '18 at 19:34
  • The question is what can i debug with such module? @MarkPlotnick – B. Semchuk Feb 28 '18 at 20:10
  • @MarkPlotnick In fact, i care about both, but i can't understand for now where can this module be useful – B. Semchuk Feb 28 '18 at 20:17
  • This link has already something i need, so the question is, can i set an address instead of ksymbol? I think that one will surely help me go further. @MarkPlotnick – B. Semchuk Feb 28 '18 at 21:23
  • If your question is "why do people use watchpoints?", see this paper: kernel.org/doc/ols/2009/ols2009-pages-149-158.pdf – Mark Plotnick Mar 1 '18 at 20:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.