What is the code execution sequence of the driver and its test program?
Source: Internet
Author: User
What is the code execution sequence of the driver and its test program? -- Linux general technology-Linux programming and kernel information. The following is a detailed description. For example, the driver code has a function:
Static ssize_t xx_write (struct file * filp, const char _ user * buf, size_t size, loff_t * ppos)
{
.................
Printk (KERN_EMERG "kernel write \ n ");
.................
}
Its test code has a corresponding test function:
Printf ("call xx_write function \ n ");
Fwrite (Buf, sizeof (Buf), 1, fp0 );
Q: Do I print the content in printf or the content of printk first when running the test code ??
I personally think that the content of printf should be printed first, because this sentence is run first, but the experiment result is the opposite ?? Why? Please answer.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.