From: Alexander Shishkin <alexander.shishkin@linux.intel.com>
To: Chunyan Zhang <zhang.chunyan@linaro.org>,
rostedt@goodmis.org, mathieu.poirier@linaro.org,
mingo@redhat.com
Cc: mike.leach@arm.com, tor@ti.com, maxime.coquelin@st.com,
philippe.langlais@st.com, nicolas.guion@st.com,
zhang.lyra@gmail.com, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
felipe.balbi@linux.intel.com
Subject: Re: [PATCH V2 1/4] trace: Introduce an output interface from ftrace to STM
Date: Wed, 22 Jun 2016 08:56:04 +0300 [thread overview]
Message-ID: <87mvmdu5qj.fsf@ashishki-desk.ger.corp.intel.com> (raw)
In-Reply-To: <1466563613-31578-2-git-send-email-zhang.chunyan@linaro.org>
[adding Felipe for his sudden interest in the subject matter]
Chunyan Zhang <zhang.chunyan@linaro.org> writes:
> +static struct stm_ftrace *trace_output;
What you want is a possibility to have different ftrace outputs, not
different STM outputs for ftrace (again, STM core already does this).
In other words, here, you want to have the notion of "output" be
stm-agnostic, but be a generalized output driver object.
> +
> +void trace_func_to_stm(unsigned long ip, unsigned long parent_ip)
> +{
> + unsigned long ip_array[2] = {ip, parent_ip};
> +
> + if (trace_output)
> + trace_output->write(&trace_output->data, (char *)ip_array,
> + sizeof(unsigned long) * 2, STM_FTRACE_CHAN);
> +}
The ip+parent_ip pair is still not a useful output from ftrace
data. Moreover, doing this is basically like inventing another binary
protocol for ftrace data over stm, where ftrace is in and of itself
already a binary protocol, why not just use that? The decoder will
basically depend on the kernel binary from whence the traces are
coming, but this is a requirement even if we want to decypher the
ip+parent_ip data you're proposing.
We would need to take some time to think this through. What we might
consider is:
* bypassing ftrace ring buffer, sending data directly to an "output",
which has a drawback of ending up in a driver callback, which needs
to serialize on its driver stuff and write registers (I did try to
make stm_write as light as possible when I wrote it, though); the
good part is that data goes into the wire as soon as it is produced
instead of being buffered along the way;
* starting a work (or multiple works) that would traverse new data in
ftrace buffer and feed it to an "output", such as stm; this has a
problem of producers being potentially faster than consumers
(consider 'function' tracer, for example) and hogging the cpus by
simply exporting trace data; this also botches the stm timestamps,
which will then be representative of nothing in particular.
> +
> +void trace_add_output(struct stm_ftrace *stm)
> +{
> + trace_output = stm;
> +}
> +EXPORT_SYMBOL_GPL(trace_add_output);
> +
> +void trace_rm_output(void)
> +{
> + trace_output = NULL;
> +}
> +EXPORT_SYMBOL_GPL(trace_rm_output);
These, of course, only work because they are implicitly serialized on
stm core's link locks.
Regards,
--
Alex
next prev parent reply other threads:[~2016-06-22 6:01 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-22 2:46 [PATCH V2 0/4] Integration of function trace with System Trace IP blocks Chunyan Zhang
2016-06-22 2:46 ` [PATCH V2 1/4] trace: Introduce an output interface from ftrace to STM Chunyan Zhang
2016-06-22 5:56 ` Alexander Shishkin [this message]
2016-06-28 6:59 ` Chunyan Zhang
2016-06-22 2:46 ` [PATCH V2 2/4] STM Ftrace: Adding generic buffer interface driver Chunyan Zhang
2016-06-24 1:21 ` kbuild test robot
2016-06-24 2:18 ` kbuild test robot
2016-06-22 2:46 ` [PATCH V2 3/4] trace: duplicate function pointer to STM Chunyan Zhang
2016-06-22 2:46 ` [PATCH V2 4/4] stm: Mark the functions of writing buffer with notrace Chunyan Zhang
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=87mvmdu5qj.fsf@ashishki-desk.ger.corp.intel.com \
--to=alexander.shishkin@linux.intel.com \
--cc=felipe.balbi@linux.intel.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.poirier@linaro.org \
--cc=maxime.coquelin@st.com \
--cc=mike.leach@arm.com \
--cc=mingo@redhat.com \
--cc=nicolas.guion@st.com \
--cc=philippe.langlais@st.com \
--cc=rostedt@goodmis.org \
--cc=tor@ti.com \
--cc=zhang.chunyan@linaro.org \
--cc=zhang.lyra@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
all inboxes | Powered by JetHome®