Re: writes to /dev/kmsg

Constantine Shulyupin <[email protected]> Wed, 20 Feb 2019 11:43:40 +0200
Newsgroups gmane.linux.region.israel
Message-ID <CAE7jHC9d74Bw-bQLSaYE1Q9nVQtAPep46j7qN4WbQax4mzAH-g@mail.gmail.com>
        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 <levonshe-zJpx2rpV7r/[email protected]> 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" <[email protected]>:
>
> 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 <levonshe-zJpx2rpV7r/[email protected]> 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
> [email protected]
> 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
[email protected]
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il