tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Memory leak in sys/external/bsd/ipf/netinet/ip_fil_netbsd.c:ipf_send_ip()?



On May 10, 15:04, Mouse wrote:
}
} >> you could also add a printf() to see if this code path is used.
} > I'm not familiar with where in kernel code you can add printf()s.
} 
} Is there anywhere you can't?
} 
} Well, OK, there are probably a few places.  printf in the serial port
} transmitter-empty interrupt when using serial console is probably a bad
} idea.  Maybe the TLB miss handler, on architectures where there is one.
} But, really, I've done printf debugging pretty close to everywhere in
} the kernel that isn't as obviously dangerous as those.  Some places
} will be performance issues, and there can be problems if you print more
} than tiny amounts at elevated IPL - for example, with a HZ of 100 and
} serial console at 9600 baud, you don't want to print more than a mean
} of 9.6 bytes per interrupt in the hardclock handler.  But for something
} like this?  I wouldn't hesitate.

     As an anecdote, I put debugging printf's into the sparc64
fdc(4) interrupt handler when trying to figure out the problem with
formatting.  This resulted in underrun errors from the chip and
formatting failed.  However, it was enough for me to figure out
what was going wrong.  Turns out, there was a misunderstanding in
how the chip works.  Fixing the problem made the driver much more
efficient and it spent far less time busy waiting in the interrupt
handler (for all operations).  Of course, now a days, not many
people care about floppies.

}-- End of excerpt from Mouse


Home | Main Index | Thread Index | Old Index