stderr = fopen("/dev/kmsg", "w+");
fprintf(stderr, "%s:%i %s ", __FILE__, __LINE__, __func__);
Call a driver. In the driver:
#undef pr_fmt
#define pr_fmt(fmt)"%s.c:%d %s " fmt, KBUILD_MODNAME, __LINE__,
__func__
pr_debug("...");
or
printk("%s:%i %s ", __FILE__, __LINE__, __func__);
then from UM:
fprintf(stderr, "%s:%i %s ", __FILE__, __LINE__, __func__);
Thanks
On Wed, Feb 20, 2019 at 11:23 AM Lev Olshvang wrote:
> Can you please elaborate, what you are trying to synchronize, I suppose
> messages from your driver are uniquely identified?
>
>
> 19.02.2019, 19:42, "Constantine Shulyupin" :
>
> I write to /dev/kmsg when it is need to synchronize UM and driver's logs.
>
> On Tue, Feb 19, 2019 at 3:34 PM Lev Olshvang wrote:
>
> Kernel documentation describes interface
> https://www.kernel.org/doc/Documentation/ABI/testing/dev-kmsg
>
> I wonder what kind of applications use it?
> Why somebody need to use kmsg instead of syslog?
>
> Can anybody give example of such application?
>
> Regards,
> Lev
>
>
> ___
> Linux-il mailing list
> Linux-il@cs.huji.ac.il
> http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
>
>
>
> --
> Constantine Shulyupin
> http://www.MakeLinux.co.il/
> Embedded Linux Systems
> Tel Aviv
>
>
--
Constantine Shulyupin
http://www.MakeLinux.co.il/
Embedded Linux Systems
Tel Aviv
___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il