linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Beau Belgrave <beaub@linux.microsoft.com>
To: Masami Hiramatsu <mhiramat@kernel.org>
Cc: rostedt@goodmis.org, linux-trace-devel@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v9 01/12] user_events: Add minimal support for trace_event into ftrace
Date: Mon, 17 Jan 2022 10:09:14 -0800	[thread overview]
Message-ID: <20220117180914.GA1789@kbox> (raw)
In-Reply-To: <20220118004517.b9dda3d98d6c5d6233ac8886@kernel.org>

On Tue, Jan 18, 2022 at 12:45:17AM +0900, Masami Hiramatsu wrote:
> Hi Beau,
> 
> On Tue, 11 Jan 2022 09:25:51 -0800
> Beau Belgrave <beaub@linux.microsoft.com> wrote:
> 
> > +static int user_event_show(struct seq_file *m, struct dyn_event *ev)
> > +{
> > +	struct user_event *user = container_of(ev, struct user_event, devent);
> > +	struct ftrace_event_field *field, *next;
> > +	struct list_head *head;
> > +	int depth = 0;
> > +
> > +	seq_printf(m, "%s%s", USER_EVENTS_PREFIX, EVENT_NAME(user));
> > +
> > +	head = trace_get_fields(&user->call);
> > +
> > +	list_for_each_entry_safe_reverse(field, next, head, link) {
> > +		if (depth == 0)
> > +			seq_puts(m, " ");
> > +		else
> > +			seq_puts(m, "; ");
> > +		seq_printf(m, "%s %s", field->type, field->name);
> > +		depth++;
> > +	}
> > +
> > +	seq_puts(m, "\n");
> > +
> > +	return 0;
> > +}
> 
> Let me confirm just one point. Your syntax supports
> 
> [__data_loc|__rel_loc] [unsigned] TYPE[\[LEN\]] NAME
> 
> or
> 
> struct TYPE NAME SIZE
> 
> for the fields, right? In that case, above seq_printf() seems not enough.

Yep, I see.

The non-struct cases work as expected from my testing:
echo 'u:test unsigned char msg[20]' > dynamic_events
cat dynamic_events
u:test unsigned char msg[20]

In the struct case you are right, it's missing the size. Good catch!
I'll fix this up!

Was there another case you had in mind that I might have missed beyond
the struct case?

I also would like, since I'm re-spinning, to fix a warning the intel bot
found related to the same code pulled from single_open, etc.

See https://lore.kernel.org/llvm/YeGk0nIH9x91k01I@archlinux-ax161/

> 
> Thank you,
> 
> 
> -- 
> Masami Hiramatsu <mhiramat@kernel.org>

Thanks,
-Beau

  reply	other threads:[~2022-01-17 18:09 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-11 17:25 [PATCH v9 00/12] user_events: Enable user processes to create and write to trace events Beau Belgrave
2022-01-11 17:25 ` [PATCH v9 01/12] user_events: Add minimal support for trace_event into ftrace Beau Belgrave
2022-01-17 15:45   ` Masami Hiramatsu
2022-01-17 18:09     ` Beau Belgrave [this message]
2022-01-18  1:02       ` Masami Hiramatsu
2022-01-11 17:25 ` [PATCH v9 02/12] user_events: Add print_fmt generation support for basic types Beau Belgrave
2022-01-11 17:25 ` [PATCH v9 03/12] user_events: Handle matching arguments from dyn_events Beau Belgrave
2022-01-11 17:25 ` [PATCH v9 04/12] user_events: Add basic perf and eBPF support Beau Belgrave
2022-01-11 17:25 ` [PATCH v9 05/12] user_events: Optimize writing events by only copying data once Beau Belgrave
2022-01-11 17:25 ` [PATCH v9 06/12] user_events: Validate user payloads for size and null termination Beau Belgrave
2022-01-11 17:25 ` [PATCH v9 07/12] user_events: Add self-test for ftrace integration Beau Belgrave
2022-01-11 17:25 ` [PATCH v9 08/12] user_events: Add self-test for dynamic_events integration Beau Belgrave
2022-01-11 17:25 ` [PATCH v9 09/12] user_events: Add self-test for perf_event integration Beau Belgrave
2022-01-11 17:26 ` [PATCH v9 10/12] user_events: Add self-test for validator boundaries Beau Belgrave
2022-01-11 17:26 ` [PATCH v9 11/12] user_events: Add sample code for typical usage Beau Belgrave
2022-01-11 17:26 ` [PATCH v9 12/12] user_events: Add documentation file Beau Belgrave

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=20220117180914.GA1789@kbox \
    --to=beaub@linux.microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=rostedt@goodmis.org \
    /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).