All of lore.kernel.org
 help / color / mirror / Atom feed
* about pr_debug
@ 2014-06-25  6:09 lx
  2014-06-25  6:34 ` Real Name
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: lx @ 2014-06-25  6:09 UTC (permalink / raw)
  To: kernelnewbies

hi all:
       I'm confused with pr_debug. My codes is:
###########################################
#include <linux/module.h>
#include <linux/kernel.h>

static int __init init_page_dir(void)
{
    pr_debug("Hello world\n");
    return 0;
}

static void __exit exit_page_dir(void)
{
    pr_debug("\nGoodbye now...\n\n");
}

MODULE_LICENSE("GPL");
module_init(init_page_dir);
module_exit(exit_page_dir);
###########################################
I make it, and insmod it. But the messages of "Hello world" don't show.

So, My question is If i want to fix it , I should set the
*DEFAULT_MESSAGE_LOGLEVEL
and *
*rebuild the kernel ?*

My kernel version is:2.6.18
OS is: centOS

Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140625/9f0112f3/attachment.html 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* about pr_debug
  2014-06-25  6:09 about pr_debug lx
@ 2014-06-25  6:34 ` Real Name
  2014-06-25  6:48 ` Varka Bhadram
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: Real Name @ 2014-06-25  6:34 UTC (permalink / raw)
  To: kernelnewbies

On Wed, Jun 25, 2014 at 02:09:40PM +0800, lx wrote:
> hi all:
>        I'm confused with pr_debug. My codes is:
> ###########################################
> #include <linux/module.h>
> #include <linux/kernel.h>
> 
> static int __init init_page_dir(void)
> {
>     pr_debug("Hello world\n");
>     return 0;
> }
> 
> static void __exit exit_page_dir(void)
> {
>     pr_debug("\nGoodbye now...\n\n");
> }
> 
> MODULE_LICENSE("GPL");
> module_init(init_page_dir);
> module_exit(exit_page_dir);
> ###########################################
> I make it, and insmod it. But the messages of "Hello world" don't show.
> 
> So, My question is If i want to fix it , I should set the
> *DEFAULT_MESSAGE_LOGLEVEL
> and *
> *rebuild the kernel ?*
>

https://www.kernel.org/doc/local/pr_debug.txt

> My kernel version is:2.6.18
> OS is: centOS
> 
> Thank you.

> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 9+ messages in thread

* about pr_debug
  2014-06-25  6:09 about pr_debug lx
  2014-06-25  6:34 ` Real Name
@ 2014-06-25  6:48 ` Varka Bhadram
  2014-06-25  8:20   ` Bjørn Mork
  2014-06-25  6:55 ` anish singh
  2014-06-25  7:38 ` Pranay Srivastava
  3 siblings, 1 reply; 9+ messages in thread
From: Varka Bhadram @ 2014-06-25  6:48 UTC (permalink / raw)
  To: kernelnewbies

refer this :https://www.kernel.org/doc/local/pr_debug.txt

On 06/25/2014 11:39 AM, lx wrote:
> hi all:
>        I'm confused with pr_debug. My codes is:
> ###########################################
> #include <linux/module.h>
> #include <linux/kernel.h>
>
> static int __init init_page_dir(void)
> {
>     pr_debug("Hello world\n");
>     return 0;
> }
>
> static void __exit exit_page_dir(void)
> {
>     pr_debug("\nGoodbye now...\n\n");
> }
>
> MODULE_LICENSE("GPL");
> module_init(init_page_dir);
> module_exit(exit_page_dir);
> ###########################################
> I make it, and insmod it. But the messages of "Hello world" don't show.
>
> So, My question is If i want to fix it , I should set the 
> /DEFAULT_MESSAGE_LOGLEVEL and /
> /rebuild the kernel ?/
>
> My kernel version is:2.6.18
> OS is: centOS
>
> Thank you.
>
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140625/af7d4414/attachment.html 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* about pr_debug
  2014-06-25  6:09 about pr_debug lx
  2014-06-25  6:34 ` Real Name
  2014-06-25  6:48 ` Varka Bhadram
@ 2014-06-25  6:55 ` anish singh
  2014-06-25  7:38 ` Pranay Srivastava
  3 siblings, 0 replies; 9+ messages in thread
From: anish singh @ 2014-06-25  6:55 UTC (permalink / raw)
  To: kernelnewbies

On Tue, Jun 24, 2014 at 11:09 PM, lx <lxlenovostar@gmail.com> wrote:

> hi all:
>        I'm confused with pr_debug. My codes is:
> ###########################################
> #include <linux/module.h>
> #include <linux/kernel.h>
>
> static int __init init_page_dir(void)
> {
>     pr_debug("Hello world\n");
>
use printk or do echo "file_name +p" >
/sys/kernel/debug/dyanmic_debug/control

>     return 0;
> }
>
> static void __exit exit_page_dir(void)
> {
>     pr_debug("\nGoodbye now...\n\n");
> }
>
> MODULE_LICENSE("GPL");
> module_init(init_page_dir);
> module_exit(exit_page_dir);
> ###########################################
> I make it, and insmod it. But the messages of "Hello world" don't show.
>
> So, My question is If i want to fix it , I should set the *DEFAULT_MESSAGE_LOGLEVEL
> and *
> *rebuild the kernel ?*
>
> My kernel version is:2.6.18
> OS is: centOS
>
> Thank you.
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140624/938f1f0c/attachment.html 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* about pr_debug
  2014-06-25  6:09 about pr_debug lx
                   ` (2 preceding siblings ...)
  2014-06-25  6:55 ` anish singh
@ 2014-06-25  7:38 ` Pranay Srivastava
  3 siblings, 0 replies; 9+ messages in thread
From: Pranay Srivastava @ 2014-06-25  7:38 UTC (permalink / raw)
  To: kernelnewbies

On Wed, Jun 25, 2014 at 11:39 AM, lx <lxlenovostar@gmail.com> wrote:
> hi all:
>        I'm confused with pr_debug. My codes is:
> ###########################################
> #include <linux/module.h>
> #include <linux/kernel.h>
>
> static int __init init_page_dir(void)
> {
>     pr_debug("Hello world\n");
>     return 0;
> }

Add ccflags-y += -DDEBUG in your Kbuild or Makefile that should work.

>
> static void __exit exit_page_dir(void)
> {
>     pr_debug("\nGoodbye now...\n\n");
> }
>
> MODULE_LICENSE("GPL");
> module_init(init_page_dir);
> module_exit(exit_page_dir);
> ###########################################
> I make it, and insmod it. But the messages of "Hello world" don't show.
>
> So, My question is If i want to fix it , I should set the
> DEFAULT_MESSAGE_LOGLEVEL and
> rebuild the kernel ?
>
> My kernel version is:2.6.18
> OS is: centOS
>
> Thank you.
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>



-- 
        ---P.K.S

^ permalink raw reply	[flat|nested] 9+ messages in thread

* about pr_debug
  2014-06-25  6:48 ` Varka Bhadram
@ 2014-06-25  8:20   ` Bjørn Mork
  2014-06-25  9:47     ` lx
  0 siblings, 1 reply; 9+ messages in thread
From: Bjørn Mork @ 2014-06-25  8:20 UTC (permalink / raw)
  To: kernelnewbies

Varka Bhadram <varkabhadram@gmail.com> writes:

> refer this :https://www.kernel.org/doc/local/pr_debug.txt

That seems a little outdated since it doesn't mention the extremely
useful dynamic debug feature.  So please read
https://www.kernel.org/doc/Documentation/dynamic-debug-howto.txt
as well.

The ability to dynamically switch on and off debug messages per callsite
is extremely useful.  And it also enables you to switch on some extra
info you often want, like function names, without having to explictly
put them into every format string.

I recommend setting CONFIG_DYNAMIC_DEBUG and taking a look at
/sys/kernel/debug/dynamic_debug/control if you ever do any kernel
development.



Bj?rn

^ permalink raw reply	[flat|nested] 9+ messages in thread

* about pr_debug
  2014-06-25  8:20   ` Bjørn Mork
@ 2014-06-25  9:47     ` lx
  2014-06-25  9:50       ` Varka Bhadram
  0 siblings, 1 reply; 9+ messages in thread
From: lx @ 2014-06-25  9:47 UTC (permalink / raw)
  To: kernelnewbies

thank you.
But the Makefile is so simple and Not use "cc".
#################################
obj-m   := task_01.o

KDIR:=/lib/modules/`uname -r`/build
PWD:=$(shell pwd)

default:
    echo $KDIR
    $(MAKE) -C $(KDIR) M=$(PWD) modules
#################################

So, how to add "CFLAGS"?


2014-06-25 16:20 GMT+08:00 Bj?rn Mork <bjorn@mork.no>:

> Varka Bhadram <varkabhadram@gmail.com> writes:
>
> > refer this :https://www.kernel.org/doc/local/pr_debug.txt
>
> That seems a little outdated since it doesn't mention the extremely
> useful dynamic debug feature.  So please read
> https://www.kernel.org/doc/Documentation/dynamic-debug-howto.txt
> as well.
>
> The ability to dynamically switch on and off debug messages per callsite
> is extremely useful.  And it also enables you to switch on some extra
> info you often want, like function names, without having to explictly
> put them into every format string.
>
> I recommend setting CONFIG_DYNAMIC_DEBUG and taking a look at
> /sys/kernel/debug/dynamic_debug/control if you ever do any kernel
> development.
>
>
>
> Bj?rn
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140625/86c55029/attachment.html 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* about pr_debug
  2014-06-25  9:47     ` lx
@ 2014-06-25  9:50       ` Varka Bhadram
  2014-06-25  9:57         ` lx
  0 siblings, 1 reply; 9+ messages in thread
From: Varka Bhadram @ 2014-06-25  9:50 UTC (permalink / raw)
  To: kernelnewbies

On 06/25/2014 03:17 PM, lx wrote:
> thank you.
> But the Makefile is so simple and Not use "cc".
> #################################
> obj-m   := task_01.o
>
  CFLAGS_task_01.o := -DDEBUG

> KDIR:=/lib/modules/`uname -r`/build
> PWD:=$(shell pwd)
>
> default:
>     echo $KDIR
>     $(MAKE) -C $(KDIR) M=$(PWD) modules
> #################################
>
> So, how to add "CFLAGS"?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140625/bf9912aa/attachment.html 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* about pr_debug
  2014-06-25  9:50       ` Varka Bhadram
@ 2014-06-25  9:57         ` lx
  0 siblings, 0 replies; 9+ messages in thread
From: lx @ 2014-06-25  9:57 UTC (permalink / raw)
  To: kernelnewbies

Thank you. I fix it

EXTRA_CFLAGS += -DDEBUG


2014-06-25 17:50 GMT+08:00 Varka Bhadram <varkabhadram@gmail.com>:

>  On 06/25/2014 03:17 PM, lx wrote:
>
> thank you.
> But the Makefile is so simple and Not use "cc".
> #################################
>  obj-m   := task_01.o
>
>    CFLAGS_task_01.o := -DDEBUG
>
>   KDIR:=/lib/modules/`uname -r`/build
> PWD:=$(shell pwd)
>
>  default:
>     echo $KDIR
>     $(MAKE) -C $(KDIR) M=$(PWD) modules
>  #################################
>
>  So, how to add "CFLAGS"?
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140625/f8403e98/attachment.html 

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-06-25  9:57 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-25  6:09 about pr_debug lx
2014-06-25  6:34 ` Real Name
2014-06-25  6:48 ` Varka Bhadram
2014-06-25  8:20   ` Bjørn Mork
2014-06-25  9:47     ` lx
2014-06-25  9:50       ` Varka Bhadram
2014-06-25  9:57         ` lx
2014-06-25  6:55 ` anish singh
2014-06-25  7:38 ` Pranay Srivastava

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.