<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">Hi, Saket, </div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">Thanks for the tip!</div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><i>--<br></i>Airton Ishimori<i><br></i><div><div><br></div></div></div></div></div></div></div></div></div></div></div>
<br><div class="gmail_quote">On Tue, May 19, 2015 at 2:53 AM, Saket Sinha <span dir="ltr"><<a href="mailto:saket.sinha89@gmail.com" target="_blank">saket.sinha89@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 ,<br>
<br>
If you want to go further than just the printks, you can setup a<br>
qemu setup and attach gdb to it.<br>
Then you can even set breakpoints to analyze it.<br>
<br>
Let me know if you have any issues with the setup.<br>
<br>
Regards,<br>
Saket Sinha<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
On Tue, May 19, 2015 at 11:18 AM, anish singh<br>
<<a href="mailto:anish198519851985@gmail.com">anish198519851985@gmail.com</a>> wrote:<br>
><br>
><br>
> On Mon, May 18, 2015 at 12:23 PM, Airton Ishimori <<a href="mailto:nobumasa.bcc@gmail.com">nobumasa.bcc@gmail.com</a>><br>
> wrote:<br>
>><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<br>
>> in 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<br>
>> with promiscuity was __dev_set_promiscuity() defined in net/core/dev.c,<br>
>> because 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>
><br>
> There are only two reasons why your printk is not coming<br>
> 1. Your printk is not executing.<br>
> 2. Your driver is not getting installed.<br>
> Have you verified both of these points?<br>
>><br>
>><br>
>> Thanks in advance,<br>
>><br>
>> --<br>
>> Airton Ishimori<br>
>><br>
>><br>
>> _______________________________________________<br>
>> Kernelnewbies mailing list<br>
>> <a href="mailto:Kernelnewbies@kernelnewbies.org">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>
><br>
><br>
> _______________________________________________<br>
> Kernelnewbies mailing list<br>
> <a href="mailto:Kernelnewbies@kernelnewbies.org">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>