From: Steven Rostedt <rostedt@goodmis.org>
To: Lv Ying <lvying6@huawei.com>
Cc: <linux-trace-users@vger.kernel.org>,
<linux-trace-devel@vger.kernel.org>,
"Fangxiuning (Jack, EulerOS)" <fangxiuning@huawei.com>
Subject: Re: How to solve the coupling between libtraceevent and kernel trace?
Date: Fri, 4 Aug 2023 12:15:31 -0400 [thread overview]
Message-ID: <20230804121531.06f7bf0e@gandalf.local.home> (raw)
In-Reply-To: <4767bcf3-589a-9dfb-5b45-9ac9279f08e6@huawei.com>
On Fri, 4 Aug 2023 17:52:48 +0800
Lv Ying <lvying6@huawei.com> wrote:
> Hi, all:
>
> I am a rasdaemon developer which depeneds on libtraceevent to parse
> kernel trace events. There is coupling between libtraceevnt and kernel
> trace, if something in libtraceevent and kernel does not match, which
> will cause libtraceevent parse wrong thing. e.g
> https://github.com/mchehab/rasdaemon/pull/98
>
> We also encounter similar problem:
> * libtrace(old) KBUFFER_TYPE_TIME_STAMP size = 12
> * kernel(new) KBUFFER_TYPE_TIME_STAMP size = 8
> Such mismatch will cause strange behavior when parsing trace events.
So what happened was the old 12 byte version of TIME_STAMP was never
actually implemented in the kernel. When we finally got around to
implementing it, we only needed 8 bytes for it, so it became 8 bytes.
I made the mistake of adding that code in kbuffer.c before it was ever
implemented in the kernel and said it would be 12 bytes.
>
> So if libtraceevent is released out of(independent) kernel, how does
> libtraceevnt to keep compatible with the running kernel(maybe not the
> newest)?
>
Now that it has been implemented, it's not going to change. 8 bytes is now
an API. Any more updates should not cause a problem with libtraceevent as
there's many more tools that depend on it working. And the fact that it is
no longer in the kernel, guarantees more that the interface will remain
stable.
rasdaemon should be using the external libtraceevent library because it
will be able to get more information out of any new data. Newer kernels
should not break existing libtracevent, but it may just skip over new
features.
-- Steve
next prev parent reply other threads:[~2023-08-04 16:15 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-04 9:52 How to solve the coupling between libtraceevent and kernel trace? Lv Ying
2023-08-04 16:15 ` Steven Rostedt [this message]
2023-08-05 3:49 ` Lv Ying
2023-08-05 3:57 ` Lv Ying
2023-08-08 1:09 ` Steven Rostedt
2023-08-08 2:36 ` Lv Ying
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230804121531.06f7bf0e@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=fangxiuning@huawei.com \
--cc=linux-trace-devel@vger.kernel.org \
--cc=linux-trace-users@vger.kernel.org \
--cc=lvying6@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).