From mboxrd@z Thu Jan 1 00:00:00 1970 From: bernd@petrovitsch.priv.at (Bernd Petrovitsch) Date: Tue, 03 Dec 2013 15:20:55 +0100 Subject: How can I 'getchar()' in module code? In-Reply-To: <44408.1386077884@turing-police.cc.vt.edu> References: <44408.1386077884@turing-police.cc.vt.edu> Message-ID: <1386080455.9055.28.camel@thorin> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org On Die, 2013-12-03 at 08:38 -0500, Valdis.Kletnieks at vt.edu wrote: > On Tue, 03 Dec 2013 20:35:41 +0800, said: > > For debugging purpose, I want something like 'getchar()' that can pause > > execution in the module code. Do any candidates I can choose? You do not want that - there is way too much parallelism and asynchronous stuff in the kernel. Debugging with getchar() and the like pretty much works only in single-threaded stuff .... > The problem is that pausing execution in module code is dangerous, as if > you hold any locks or anything like that, you can hang other threads or > even the whole machine. > > You probablhy want to be looking at the kgdb support, that is coded to > work around a lot of the issues and you get full GDB support not just a > getchar() pause. Or just use printk() to print interesting values in interesting cases. Bernd -- Bernd Petrovitsch Email : bernd at petrovitsch.priv.at LUGA : http://www.luga.at