<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"> stderr = fopen("/dev/kmsg", "w+");<br> fprintf(stderr, "%s:%i %s ", __FILE__, __LINE__, __func__);<br></div><div><br></div><div>Call a driver. In the driver: <br></div><div> #undef pr_fmt<br> #define pr_fmt(fmt) "%s.c:%d %s " fmt, KBUILD_MODNAME, __LINE__, __func__<br> pr_debug("...");<br></div><div>or<br></div><div><div dir="ltr"> printk("%s:%i %s ", __FILE__, __LINE__, __func__);</div></div><div><br></div><div>then from UM: <br></div><div><div dir="ltr"> fprintf(stderr, "%s:%i %s ", __FILE__, __LINE__, __func__);<br></div><div><br></div><div>Thanks<br></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Feb 20, 2019 at 11:23 AM Lev Olshvang <<a href="mailto:levonshe@yandex.com">levonshe@yandex.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Can you please elaborate, what you are trying to synchronize, I suppose messages from your driver are uniquely identified?</div><div><br></div><div><br></div><div>19.02.2019, 19:42, "Constantine Shulyupin" <<a href="mailto:const@makelinux.co.il" target="_blank">const@makelinux.co.il</a>>:</div><blockquote type="cite"><div dir="ltr">I write to /dev/kmsg when it is need to synchronize UM and driver's logs. <br></div><br><div><div dir="ltr">On Tue, Feb 19, 2019 at 3:34 PM Lev Olshvang <<a href="mailto:levonshe@yandex.com" target="_blank">levonshe@yandex.com</a>> wrote:<br></div><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Kernel documentation describes interface</div><div><a href="https://www.kernel.org/doc/Documentation/ABI/testing/dev-kmsg" target="_blank">https://www.kernel.org/doc/Documentation/ABI/testing/dev-kmsg</a></div><div> </div><div>I wonder what kind of applications use it?</div><div>Why somebody need to use kmsg instead of syslog?</div><div> </div><div>Can anybody give example of such application?</div><div> </div><div>Regards,</div><div>Lev</div><div> </div><div> </div>
_______________________________________________<br>
Linux-il mailing list<br>
<a href="mailto:Linux-il@cs.huji.ac.il" target="_blank">Linux-il@cs.huji.ac.il</a><br>
<a href="http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il" rel="noreferrer" target="_blank">http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il</a><br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr"><div dir="ltr">Constantine Shulyupin<br><a href="http://www.MakeLinux.co.il/" target="_blank">http://www.MakeLinux.co.il/</a><br>Embedded Linux Systems<br>Tel Aviv<br></div></div>
</blockquote></blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr">Constantine Shulyupin<br><a href="http://www.MakeLinux.co.il/" target="_blank">http://www.MakeLinux.co.il/</a><br>Embedded Linux Systems<br>Tel Aviv<br></div></div></div>