From: Tim C. <tim...@ya...> - 2006-01-22 04:46:35
|
I suspose thats possible. "ps ax" shows them as at least being started, and the very first thing they do is call klog_printk. The thread routine looks like this: static void tm_thread( void *arg ) { klog_printk( "hello from thread %d\n",(int)arg ); while( 1 ) { set_current_state( TASK_INTERRUPTIBLE ); schedule_timeout( 5 * HZ ); } } So one would expect that the klog_printk call would run, if indeed the thread gets run at all. tim Tom Zanussi <za...@us...> wrote: Tim Cullen writes: > Hi Tom > > Guess I forgot to mention that the klog daemon is running. Everything is the same in as the klog example from the relay-apps tarball. The only difference is that instead of using test-mod.ko to generate log data, I'm using my own module that calls klog_printk from a kernel thread started by kthread_create. > > On a maybe-related, maybe-not-related note I'm having the same problem with output from printk even though I've done a "echo 8 > /proc/sys/kernel/printk" as root before hand. > > very confusing... > Hmm, could it be possible that the kernel thread doesn't actually run? It sounds like the printk() or klog_printk() calls may not be getting executed for some reason... Tom > tim > > Tom Zanussi wrote: Tim Cullen writes: > > I got the klog example working with kernel 2.6.16-rc with test-mod.ko outputting 123 strings. That all works fine. However when I try using klog_printk from a kernel thread created by kthread_create the output never shows up anywhere. Anyone have ideas whats going on? > > > > Hi, > > Is the klog daemon running when the kernel thread is calling > klog_printk()? If the klog daemon isn't running, nothing gets logged. > > The reason logging doesn't happen if the daemon isn't running is that > the klog handler defined in klog-mod.c doesn't actually call > relay_write() unless 'logging' is true, and 'logging' isn't true until > the daemon tells it to turn logging on when it starts up, the idea > being that you normally wouldn't want to log anything unless there's a > reader to drain the channel. > > Hope that helps, > > Tom > > > > > > > --------------------------------- > > What are the most popular cars? Find out at Yahoo! AutosHi Tom Guess I forgot to mention that the klog daemon is running. Everything is the same in as the klog example from the relay-apps tarball. The only difference is that instead of using test-mod.ko to generate log data, I'm using my own module that calls klog_printk from a kernel thread started by kthread_create. On a maybe-related, maybe-not-related note I'm having the same problem with output from printk even though I've done a "echo 8 > /proc/sys/kernel/printk" as root before hand. very confusing... tim Tom Zanussi <za...@us...> wrote: Tim Cullen writes: > I got the klog example working with kernel 2.6.16-rc with test-mod.ko outputting 123 strings. That all works fine. However when I try using klog_printk from a kernel thread created by kthread! > _create > the output never shows up anywhere. Anyone have ideas whats going on? > Hi, Is the klog daemon running when the kernel thread is calling klog_printk()? If the klog daemon isn't running, nothing gets logged. The reason logging doesn't happen if the daemon isn't running is that the klog handler defined in klog-mod.c doesn't actually call relay_write() unless 'logging' is true, and 'logging' isn't true until the daemon tells it to turn logging on when it starts up, the idea being that you normally wouldn't want to log anything unless there's a reader to drain the channel. Hope that helps, Tom > --------------------------------- > What are the most popular cars? Find out at Yahoo! Autos -- Regards, Tom Zanussi IBM Linux Technology Center/RAS --------------------------------- Yahoo! Photos Showcase holiday pictures in hardcover Photo Books. You design it and well bind it! |