I want to add some printf
statements of my own in the BSD network stack. But after adding them I cannot see the messages coming up on the console of my machine. I tried to add some in the netisr ( sys/net/netisr.c ) . Cannot even find the already present printf
statements. A noob at kernel programming.
netsmp_lockinit(void *dummy)
{
printf("Function %s File %s : Line %d\n",__func__,__FILE__,__LINE__);
rw_init_flags(&Netstack, "netsmp", RW_NETLOCK);
}
The kernel can't use the C Standard I/O facilities. It must use a logging facility.
For example, sys/netinet/in.c
uses
log(LOG_INFO, "in_scrubprefix: err=%d, old prefix delete failed\n", error);
to communicate to the world outside what happened.