<div dir="ltr"><div><div><div><div><div><div>Hi All,<br></div><br>Thank you for the replies. I understand that I can use netlink sockets. Also, i have gone through various other possible ways : <a href="http://people.ee.ethz.ch/~arkeller/linux/kernel_user_space_howto.html">http://people.ee.ethz.ch/~arkeller/linux/kernel_user_space_howto.html</a><br><br>I am looking for a simpler solution which uses existing information of sys entries. That is, I am looking for a sys entry which is incremented for every device wakeup or some other sys entry that I can use to get notified on wakeup.<br><br>Greg,<br>>><span class="im">
</span>Really? My device can "wakeup" thousands of times a second, what are<br>
you going to do with that type of information?<br></div><br>I am talking of device as a whole not individual devices in the device. In kernel log, we can see a print stating<br>"PM: suspend of devices complete after xxx msecs" --> <i>Prints from kernel/kernel/power/main.c</i><br><br></div>Similarly I get a print for resume stating<br>"PM: resume of devices complete after xxx msecs" --> <i>Prints from kernel/kernel/power/main.c</i></div>Ideally after the above print of resume i want my stats to be printed.. Programatically after dpm_resume_end().<br><br></div></div>Best Regards,<br>Manty<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 9, 2014 at 3:30 AM, Jinqiang Zeng <span dir="ltr"><<a href="mailto:jinqiangzeng@gmail.com" target="_blank">jinqiangzeng@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">2014-10-08 0:39 GMT-07:00 manty kuma <<a href="mailto:mantykuma@gmail.com">mantykuma@gmail.com</a>>:<br>
<span class="">> Hi,<br>
> I want a user process to be notified on device wakeup so that I can print<br>
> some related information.<br>
><br>
> Which framework to use for this?(events, .. ??)<br>
<br>
</span>You can use netlink and uevent to do this job.<br>
<br>
But just as Greg has pointed out, if your device notify frequently,<br>
your system will get slow down obviously.<br>
<span class="im HOEnZb"><br>
><br>
> One idea I get is to log the info into <debugfs> and poll(implement my poll)<br>
> on it for data. This is my last option.<br>
><br>
> Are there any better ways?<br>
><br>
> Best Regards,<br>
> Manty<br>
><br>
</span><div class="HOEnZb"><div class="h5">> _______________________________________________<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>