문제

I am using a command in the proc file system which is the following

echo 0 > /proc/sys/net/ipv4/ip_forward

Note: I don't want to know the basic of the command written above, I want what all happens when it goes inside the kernel. As, I want to implement one of the /proc file.

Now if I want to trace the code right from when the 0 is echoed in the file-system then how to go about it. I mean if I want to trace what happens when I do this.

I want to see where in the kernel code this 0 is accepted and in which value does it get stored inorder to make the changes. Please, can somebody tell what all happens when you call this command. I want in detail explain. I don't want the description of the command.

Any related article on how it changes the kernel parameters is also fine. I have read this but, not explained there. http://www.linuxjournal.com/article/8381 Thanks

도움이 되었습니까?

해결책

search through linux tree (especially network stack) for create_proc_entry function. Figure out what file creates ip_forward (it must be in ip4v drivers) from name passed to create_proc_entry. When you find the file, look at where proc_dir_entry structure is created and what functions are assigned to its read_proc, write_proc members.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top