简体   繁体   中英

How can I track when memcpy() is called in Linux Kernel?

I am trying to track some dirty page in page cache in Android 5.1.1 with Kernel 3.4. My device is Nexus 7 2013 with processor Qualcomm Snapdragon S4 Pro APQ8064.

I know a process can (1)write to page cache from its buffer or (2)it can use Mmap to map page cache directly to its virtual address space. In(1), some function will be called like generic_perform_write. But in (2), does the process use memcpy() to write to page cache?

Moreover, there is a lot of definition of "memcpy" in kernel source code which is really confusing. How can I track when a process writes to page cache with Mmap instead of using its buffer. And how can I classify many memcpy defined in Kernel source code?

One more question, when I looking at the writeback function, I found some file which is written back to disk, has inode number as 0. I am also really confused with that too. I think inode number should start at 1. Thank you for any help.

The best way is doing profiling and the memcpy is totally architecture specific. And to your problem you could check mm/mmap.c----->mmap_pgoff API.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM