From: Andrew Morton <akpm@linux-foundation.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-kernel@vger.kernel.org, mingo@elte.hu,
peterz@infradead.org, fweisbec@gmail.com, tytso@mit.edu,
compudj@krystal.dyndns.org, tzanussi@gmail.com,
mhiramat@redhat.com, kosaki.motohiro@jp.fujitsu.com,
jbaron@redhat.com, fche@redhat.com, acme@redhat.com,
srostedt@redhat.com
Subject: Re: [PATCH 4/7] tracing: add format file to describe event struct fields
Date: Mon, 2 Mar 2009 13:11:09 -0800 [thread overview]
Message-ID: <20090302131109.24ab4c1d.akpm@linux-foundation.org> (raw)
In-Reply-To: <20090302203024.566861575@goodmis.org>
On Mon, 02 Mar 2009 15:29:29 -0500
Steven Rostedt <rostedt@goodmis.org> wrote:
> From: Steven Rostedt <srostedt@redhat.com>
>
> This patch adds the "format" file to the trace point event directory.
> This is based off of work by Tom Zanussi, in which a file is exported
> to be tread from user land such that a user space app may read the
s/tread/read/
> binary record stored in the ring buffer.
>
> ...
>
> --- a/kernel/trace/trace_events.c
> +++ b/kernel/trace/trace_events.c
> @@ -3,6 +3,9 @@
> *
> * Copyright (C) 2008 Red Hat Inc, Steven Rostedt <srostedt@redhat.com>
> *
> + * - Added format output of fields of the trace point.
> + * This was based off of work by Tom Zanussi <tzanussi@gmail.com>.
ick. "based on"
> + *
> */
>
> #include <linux/debugfs.h>
> @@ -444,6 +447,42 @@ event_available_types_read(struct file *filp, char __user *ubuf, size_t cnt,
> return simple_read_from_buffer(ubuf, cnt, ppos, buf, r);
> }
>
> +static ssize_t
> +event_format_read(struct file *filp, char __user *ubuf, size_t cnt,
> + loff_t *ppos)
> +{
> + struct ftrace_event_call *call = filp->private_data;
> + struct trace_seq *s;
> + char *buf;
> + int r;
> +
> + s = kmalloc(sizeof(*s), GFP_KERNEL);
> + if (!s)
> + return -ENOMEM;
> +
> + trace_seq_init(s);
> +
> + if (*ppos)
> + return 0;
Someone get this man a bucket!
> + r = call->show_format(s);
> + if (!r) {
> + /*
> + * ug! The format output is bigger than a PAGE!!
> + */
> + buf = "FORMAT TOO BIG\n";
> + r = simple_read_from_buffer(ubuf, cnt, ppos,
> + buf, strlen(buf));
> + goto out;
> + }
> +
> + r = simple_read_from_buffer(ubuf, cnt, ppos,
> + s->buffer, s->len);
> + out:
> + kfree(s);
> + return r;
> +}
next prev parent reply other threads:[~2009-03-02 21:13 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-02 20:29 [PATCH 0/7] [GIT PULL] trace event updates for tip Steven Rostedt
2009-03-02 20:29 ` [PATCH 1/7] tracing: add TRACE_FIELD_SPECIAL to record complex entries Steven Rostedt
2009-03-02 20:29 ` [PATCH 2/7] tracing: add protection around modify trace event fields Steven Rostedt
2009-03-02 20:29 ` [PATCH 3/7] tracing: make trace_seq_reset global and rename to trace_seq_init Steven Rostedt
2009-03-02 20:29 ` [PATCH 4/7] tracing: add format file to describe event struct fields Steven Rostedt
2009-03-02 21:11 ` Andrew Morton [this message]
2009-03-02 20:29 ` [PATCH 5/7] tracing: add ftrace headers to event format files Steven Rostedt
2009-03-02 20:29 ` [PATCH 6/7] tracing: add trace name and id to event formats Steven Rostedt
2009-03-02 20:29 ` [PATCH 7/7] tracing: add print format to event trace format files Steven Rostedt
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=20090302131109.24ab4c1d.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=acme@redhat.com \
--cc=compudj@krystal.dyndns.org \
--cc=fche@redhat.com \
--cc=fweisbec@gmail.com \
--cc=jbaron@redhat.com \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mhiramat@redhat.com \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=srostedt@redhat.com \
--cc=tytso@mit.edu \
--cc=tzanussi@gmail.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
Powered by JetHome