From: Tim C. <tim...@ya...> - 2006-01-22 07:21:33
|
Thats correct. Even after you hit ctrl-c to stop the daemon you get nothing. Correct me if I'm wrong but I'm expecting the output to be in either /mnt/relay/klog/cpu0 or the file cpu0 that gets created in the klog source directory. tim Tom Zanussi <za...@us...> wrote: Tim Cullen writes: > 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. > Are you just doing that one klog_printk()? The output won't be seen by the daemon until a sub-buffer fills up or the buffer is flushed when you Ctrl-C to stop the daemon. You don't see any output even after you stop the daemon? I also wonder why even a printk() wouldn't be showing up, strange. Tom > tim > > Tom Zanussi 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 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!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-a > pps > 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 hav > e 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! -- Regards, Tom Zanussi IBM Linux Technology Center/RASN¬HYÞµéX¬²'²Þu¼¦[§Ü¨º Þ¦Øk¢è!W¬~é®åzk¶C£ å¡§m éÞÀ@^ÇÈ^§zØZ¶f¤zËj·!x2¢êå¢âë±æ¬É«,º·â a{ å,àHòÔ4¨m¶ÿ±éZ²ëjYwþÇ¥rgy$õÓ~7Ù¸môãÎjõÛ^¸Ú·¥k'ìuëÞf¢)à+-éZÉûz÷¥+-²Ê.Ç¢¸ëa¶Úlÿùb²Û,¢êÜyú+éÞ·ùb²Û?+-wèþ·¥k'ìuëÞ --------------------------------- Yahoo! Photos Ring in the New Year with Photo Calendars. Add photos, events, holidays, whatever. |