Linux CXL
 help / color / mirror / Atom feed
From: Alison Schofield <alison.schofield@intel.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Ira Weiny <ira.weiny@intel.com>,
	Dave Jiang <dave.jiang@intel.com>,
	linux-cxl@vger.kernel.org, dan.j.williams@intel.com,
	vishal.l.verma@intel.com
Subject: Re: [PATCH v3 01/10] cxl: add helper function to parse trace event to json object
Date: Mon, 14 Nov 2022 12:44:51 -0800	[thread overview]
Message-ID: <Y3Kow67Pr1aVoIey@aschofie-mobl2> (raw)
In-Reply-To: <20221114123238.3263ab61@gandalf.local.home>

On Mon, Nov 14, 2022 at 12:32:38PM -0500, Steven Rostedt wrote:
> On Fri, 4 Nov 2022 11:56:46 -0700
> Ira Weiny <ira.weiny@intel.com> wrote:
> 
> > > Ira figured out that you can you can use __field_struct() to accommodate
> > > uuid_t. Here's what he changed below:  
> > 
> > I guess this is a hack.  I looked into creating a new entry specifier and saw
> > that __field_struct did what I needed.
> > 
> > It all seems to work fine until Alison pointed out this morning that trace-cmd
> > can't seem to parse this.
> > 
> > :-/
> 
> If it works in a trace file, it should work in trace-cmd. If it does not,
> then trace-cmd needs to be fixed (unless it needs more information from the
> kernel, which it might).
> 
> > 
> > So now I'm not sure what is technically correct.  I've never used trace-cmd
> > before and this all works fine on the cmd line and with this monitor command.
> > 
> > Is this messing up trace-cmd?
> 
> If you see an issue, would you be able to send me a trace.dat file that
> includes the failed parsing?
> 
> That is:
> 
>  trace-cmd record -e <your-event>
> 
> Do something to trigger your event.
> 
> Then send me the produced trace.dat file that fails to parse from the
>  trace-cmd report.

Hi Steve,

I tried to use the uuid_t type in another TRACE event (cxl_poison), and
ran into the problem mentioned above.

It seems to be a problem in libtraceevent (or a user error ;))

When we have:
	TP_STRUCT__entry
		__field_struct(uuid_t, hdr_uuid)

	TP__fast_assign
		memcpy(&__entry->hdr.uuid, &(hdr).id, sizeof(uuid_t));

	TP_printk("uuid= %pU",  &__entry->hdr.uuid)

Libtraceevent fails to handle that "&" in "&__entry->hrd.uuid" when
creating the pretty print string. It fails in process_op() and then
later in pretty_print() prefaces the string w '[[FAILED TO PARSE]"
follwed by the raw values.

If I omit that '&', it works. But - I get unacceptable compiler
warnings from the kernel build - trying to assign to %p.

So, it's really not 'trace-cmd' per se that is failing, that is
just where the failure is visible.

The 'other' way that we view these CXL events are through monitor
and ndctl, where we pull the fields directly from the event, and
don't care about that TP_printk string. uuid_t works fine in that
case.

CXL events were not the first to use uuid_t. I see events/afs.h
using it also. I don't see a difference in their syntax, that would
makes it work there, while CXL fails. Maybe you do.

I don't have the environment up at the moment, so I'm just spewing
from notes and memory. If you need actual duplication, ask me again.

Thanks for helping w this Steve!

Alison

-- Steve



> 
> Thanks!
> 
> -- Steve

  reply	other threads:[~2022-11-14 20:44 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-02 21:20 [PATCH v3 00/10] cxl: add monitor support for trace events Dave Jiang
2022-11-02 21:20 ` [PATCH v3 01/10] cxl: add helper function to parse trace event to json object Dave Jiang
2022-11-03  5:48   ` Steven Rostedt
2022-11-03 16:15     ` Dave Jiang
2022-11-04 18:56       ` Ira Weiny
2022-11-14 17:32         ` Steven Rostedt
2022-11-14 20:44           ` Alison Schofield [this message]
2022-11-14 20:53             ` Steven Rostedt
2022-11-02 21:20 ` [PATCH v3 02/10] cxl: add helper to parse through all current events Dave Jiang
2022-11-02 21:20 ` [PATCH v3 03/10] cxl: add common function to enable event trace Dave Jiang
2022-11-03  6:00   ` Steven Rostedt
2022-11-03 16:21     ` Dave Jiang
2022-11-02 21:20 ` [PATCH v3 04/10] cxl: add common function to disable " Dave Jiang
2022-11-03  6:02   ` Steven Rostedt
2022-11-03 16:30     ` Dave Jiang
2022-11-02 21:20 ` [PATCH v3 05/10] cxl: add monitor function for event trace events Dave Jiang
2022-11-03  6:06   ` Steven Rostedt
2022-11-03 16:34     ` Dave Jiang
2022-11-02 21:20 ` [PATCH v3 06/10] cxl: add logging functions for monitor Dave Jiang
2022-11-02 21:20 ` [PATCH v3 07/10] cxl: add monitor command to cxl Dave Jiang
2022-11-02 21:20 ` [PATCH v3 08/10] cxl: add an optional pid check to event parsing Dave Jiang
2022-11-03  6:08   ` Steven Rostedt
2022-11-03 15:57     ` Alison Schofield
2022-11-02 21:20 ` [PATCH v3 09/10] cxl: add systemd service for monitor Dave Jiang
2022-11-02 21:21 ` [PATCH v3 10/10] cxl: add man page documentation " Dave Jiang

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=Y3Kow67Pr1aVoIey@aschofie-mobl2 \
    --to=alison.schofield@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=ira.weiny@intel.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=vishal.l.verma@intel.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