kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* pr_info in driver question
@ 2022-07-06  6:47 A mp
  2022-07-06  7:53 ` Denis Kirjanov
  0 siblings, 1 reply; 3+ messages in thread
From: A mp @ 2022-07-06  6:47 UTC (permalink / raw)
  To: kernelnewbies

Hi everyone,

My name is Andrew. 

Recently, I went through the Linux Foundations intro to kernel development course. As part of the course, it gets us to put a print statement inside of the uvcvideo driver, recompile the kernel and then load the module and check dmesg for the print statement.

After several attempts, I was unable to find this print statement inside of dmesg. I know that the modified drier was compiling successfully and my custom kernel was indeed installed but no idea about this pr_info statement. 

I tried this in Ubuntu and Fedora inside of virtualbox. Not sure if that would make any difference. 

Thanks,

Andrew.


_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

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

* Re: pr_info in driver question
  2022-07-06  6:47 pr_info in driver question A mp
@ 2022-07-06  7:53 ` Denis Kirjanov
       [not found]   ` <20220706075833.h7v7krobysyxqnat@mycloud>
  0 siblings, 1 reply; 3+ messages in thread
From: Denis Kirjanov @ 2022-07-06  7:53 UTC (permalink / raw)
  To: A mp, kernelnewbies



On 7/6/22 09:47, A mp wrote:
> Hi everyone,
> 
> My name is Andrew.
> 
> Recently, I went through the Linux Foundations intro to kernel development course. As part of the course, it gets us to put a print statement inside of the uvcvideo driver, recompile the kernel and then load the module and check dmesg for the print statement.
> 
> After several attempts, I was unable to find this print statement inside of dmesg. I know that the modified drier was compiling successfully and my custom kernel was indeed installed but no idea about this pr_info statement.
> 
> I tried this in Ubuntu and Fedora inside of virtualbox. Not sure if that would make any difference.

echo "7" > /proc/sys/kernel/printk

and make sure that you have your module listed in lsmod

> 
> Thanks,
> 
> Andrew.
> 
> 
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

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

* Re: pr_info in driver question
       [not found]   ` <20220706075833.h7v7krobysyxqnat@mycloud>
@ 2022-07-06  8:32     ` Denis Kirjanov
  0 siblings, 0 replies; 3+ messages in thread
From: Denis Kirjanov @ 2022-07-06  8:32 UTC (permalink / raw)
  To: A mp, kernelnewbies



On 7/6/22 10:58, A mp wrote:
> I believe I tried that, I seen a similar solution on stack overflow, something about changing the log level?

That should work since pr_info is just a macro:

/**
  * pr_info - Print an info-level message
  * @fmt: format string
  * @...: arguments for the format string
  *
  * This macro expands to a printk with KERN_INFO loglevel. It uses 
pr_fmt() to
  * generate the format string.
  */
#define pr_info(fmt, ...) \
         printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)


and you're setting the log level even higher to DEBUG.
cat /proc/sys/kernel/printk shows you the current log level


> 
> 
> Any other suggestions perhaps?
> 
> Thanks,
> 
> Andrew.
> On Wed, Jul 06, 2022 at 10:53:12AM +0300, Denis Kirjanov wrote:
>>
>>
>> On 7/6/22 09:47, A mp wrote:
>>> Hi everyone,
>>>
>>> My name is Andrew.
>>>
>>> Recently, I went through the Linux Foundations intro to kernel development course. As part of the course, it gets us to put a print statement inside of the uvcvideo driver, recompile the kernel and then load the module and check dmesg for the print statement.
>>>
>>> After several attempts, I was unable to find this print statement inside of dmesg. I know that the modified drier was compiling successfully and my custom kernel was indeed installed but no idea about this pr_info statement.
>>>
>>> I tried this in Ubuntu and Fedora inside of virtualbox. Not sure if that would make any difference.
>>
>> echo "7" > /proc/sys/kernel/printk
>>
>> and make sure that you have your module listed in lsmod
>>
>>>
>>> Thanks,
>>>
>>> Andrew.
>>>
>>>
>>> _______________________________________________
>>> Kernelnewbies mailing list
>>> Kernelnewbies@kernelnewbies.org
>>> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

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

end of thread, other threads:[~2022-07-06  8:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-06  6:47 pr_info in driver question A mp
2022-07-06  7:53 ` Denis Kirjanov
     [not found]   ` <20220706075833.h7v7krobysyxqnat@mycloud>
2022-07-06  8:32     ` Denis Kirjanov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).