<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">Thank you both Nick and Rami. You helped me a lot !</div><div class="gmail_extra"><br clear="all"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><i>--<br></i>Airton Ishimori<i><br></i><br><div><div><br></div></div></div></div></div></div></div>
<br><div class="gmail_quote">On Mon, May 18, 2015 at 5:01 PM, Rami Rosen <span dir="ltr"><<a href="mailto:roszenrami@gmail.com" target="_blank">roszenrami@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi, Airton,<br>
<br>
This is simply a matter of setting dmesg to work with<br>
the level which you need in your setup.<br>
You should set "dmesg -n" to work with the pr_info() level.<br>
Pleas look in man dmesg, for the "-n, --console-level level" part.<br>
<br>
If you are in a haste and looking for immediate solution, you can also<br>
try pr_err() instead, as most distros do print such messages with<br>
dmesg without need for any special setup.<br>
<br>
Regards,<br>
Rami Rosen<br>
<a href="http://ramirose.wix.com/ramirosen" target="_blank">http://ramirose.wix.com/ramirosen</a><br>
<div><div><br>
On 18 May 2015 at 22:23, Airton Ishimori <<a href="mailto:nobumasa.bcc@gmail.com" target="_blank">nobumasa.bcc@gmail.com</a>> wrote:<br>
> Hello, everybody,<br>
><br>
> I'm trying to develop a new Ethernet driver (Realtek) for Linux kernel<br>
> 4.0.2.<br>
><br>
> [ 3.612938] r8169 Gigabit Ethernet driver 2.3LK-NAPI loaded<br>
><br>
> As part of my studies, I'm trying to trace the path for functions defined in<br>
> drivers/net/ethernet/realtek/r8169.c, net/core/dev.c and<br>
> net/core/dev_ioctl.c. I'm using "printks" for this purpose. For instance,<br>
> something like:<br>
><br>
> printk("TEST: __dev_set_promiscuity\n");<br>
><br>
> However, I'm not getting what's going on. I can set/unset the promiscuity<br>
> behaviour via ifconfig command.<br>
><br>
> [ 131.330091] device eth0 entered promiscuous mode<br>
> [ 170.619086] device eth0 left promiscuous mode<br>
><br>
> By looking at the dmesg output above, I thought the function that deals with<br>
> promiscuity was __dev_set_promiscuity() defined in net/core/dev.c, because<br>
> this function calls a function to print the message above:<br>
><br>
> pr_info("device %s %s promiscuous mode\n", dev->name, dev->flags &<br>
> IFF_PROMISC ? "entered" : "left");<br>
><br>
> But, when I tried to look for my printk message with dmesg after compiling<br>
> and running the kernel, I couldn't find it.<br>
><br>
> $ cd linux-4.0.2/<br>
> $ make net && make modules<br>
> $ sudo make modules_install && sudo make install<br>
><br>
> Can somebody help me to understand what's happening?<br>
><br>
> Thanks in advance,<br>
><br>
> --<br>
> Airton Ishimori<br>
><br>
><br>
</div></div><div><div>> _______________________________________________<br>
> Kernelnewbies mailing list<br>
> <a href="mailto:Kernelnewbies@kernelnewbies.org" target="_blank">Kernelnewbies@kernelnewbies.org</a><br>
> <a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
><br>
</div></div></blockquote></div><br></div></div>