linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Tom Zanussi <tom.zanussi@linux.intel.com>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Clark Williams <williams@redhat.com>,
	Karim Yaghmour <karim.yaghmour@opersys.com>,
	Brendan Gregg <bgregg@netflix.com>,
	Joel Fernandes <joel@joelfernandes.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	Yann Ylavic <ylavic.dev@gmail.com>,
	linux-rt-users@vger.kernel.org
Subject: Re: [PATCH v2 10/14] tracing: Document trace_marker triggers
Date: Wed, 16 May 2018 09:55:34 -0400	[thread overview]
Message-ID: <20180516095534.676d7938@gandalf.local.home> (raw)
In-Reply-To: <1526334427.26800.15.camel@tzanussi-mobl.amr.corp.intel.com>

On Mon, 14 May 2018 16:47:07 -0500
Tom Zanussi <tom.zanussi@linux.intel.com> wrote:

> Hi Steve,
> 
> This is a nice new event feature - thanks for doing it!  Some minor typo
> comments below..

Can I get an Acked-by from you?



> > +3. User space creating a trigger
> > +--------------------------------
> > +
> > +Writing into /sys/kernel/tracing/trace_marker writes into the ftrace
> > +ring buffer. This can also act like an event, by writing into the trigger
> > +file located in /sys/kernel/tracing/events/ftrace/print/
> > +
> > +Modifying cyclictest to write into the trace_marker file before it sleeps
> > +and after it wakes up, something like this:
> > +
> > +static void traceputs(char *str)
> > +{
> > +	/* tracemark_fd is the trace_marker file descripto */
> >   
> 
> Should be 'descriptor'?

Fixed.



> > + # ./cyclictest -p80 -d0 -i250 -n -a -t --tracemark -b 1000
> > +
> > + -p80  : run threads at priority 80
> > + -d0   : have all threads run at the same interval
> > + -i250 : start the interval at 250 microseconds (all threads will do this)
> > + -n    : sleep with nanosleep
> > + -a    : affine all threads to a separate CPU
> > + -t    : one thread per available CPU
> > + --tracemark : enable trace mark writing
> > + -b 1000 : stop if any latency is greater than 1000 microseconds
> > +
> > +Note, the -b 1000 is used just to make --tracemark available.
> > +
> > +The we can see the histogram created by this with:
> > +  
> 
> 'Then we can..

Fixed


> > +The difference this time is that instead of using the trace_marker to start
> > +the latency, the sched_waking event is used, matching the common_pid for the
> > +trace_marker write with the pid that is being worken by sched_waking.
> >   
> 
> s/worken/woken ?

Fixed. (It's kind of like Borken)

> 
> > 
> > +
> > +After running cyclictest again with the same parameters, we now have:
> > +
> > + # cat events/synthetic/latency/hist
> > +# event histogram
> > +#
> > +# trigger info: hist:keys=lat,common_pid:vals=hitcount:sort=lat:size=2048 [active]
> > +#
> > +
> > +{ lat:          7, common_pid:       2302 } hitcount:        640
> >   
> 
> snip
> 
> > 
> > +{ lat:         61, common_pid:       2302 } hitcount:          1
> > +{ lat:        110, common_pid:       2302 } hitcount:          1
> > +
> > +Totals:
> > +    Hits: 89565
> > +    Entries: 158
> > +    Dropped: 0
> > +
> > +This doesn't tell us any information about how late cyclictest may have
> > +worken up, but it does show us a nice histogram of how long it took from
> > +the time that cyclictest was worken to the time it made it into user space.
> >   
> 
> A couple more that don't seem to be 'worken' ;-)

I have an itchy 'r' finger.

Thanks for the review, I just updated this.

Oh, I guess I think I prefer a "Reviewed-by" tag instead of Ack (gives
a stronger meaning).

-- Steve

  reply	other threads:[~2018-05-16 13:55 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-14 20:58 [PATCH v2 00/14] tracing: Add triggers to trace_marker writes Steven Rostedt
2018-05-14 20:58 ` [PATCH v2 01/14] tracing: Do not reference event data in post call triggers Steven Rostedt
2018-05-14 20:58 ` [PATCH v2 02/14] tracing: Add __find_event_file() to find event files without restrictions Steven Rostedt
2018-05-14 20:58 ` [PATCH v2 03/14] tracing: Have event_trace_init() called by trace_init_tracefs() Steven Rostedt
2018-05-14 20:58 ` [PATCH v2 04/14] tracing: Add brackets in ftrace event dynamic arrays Steven Rostedt
2018-05-14 20:58 ` [PATCH v2 05/14] tracing: Do not show filter file for ftrace internal events Steven Rostedt
2018-05-16  9:10   ` Namhyung Kim
2018-05-16 10:44     ` Steven Rostedt
2018-05-14 20:58 ` [PATCH v2 06/14] tracing: Add trigger file for trace_markers tracefs/ftrace/print Steven Rostedt
2018-05-14 20:58 ` [PATCH v2 07/14] tracing: Have zero size length in filter logic be full string Steven Rostedt
2018-05-14 20:58 ` [PATCH v2 08/14] tracing: Prevent further users of zero size static arrays in trace events Steven Rostedt
2018-05-14 20:58 ` [PATCH v2 09/14] tracing: Allow histogram triggers to access ftrace internal events Steven Rostedt
2018-05-14 20:58 ` [PATCH v2 10/14] tracing: Document trace_marker triggers Steven Rostedt
2018-05-14 21:47   ` Tom Zanussi
2018-05-16 13:55     ` Steven Rostedt [this message]
2018-05-16 15:22       ` Tom Zanussi
2018-05-16 15:26         ` Steven Rostedt
2018-05-14 20:58 ` [PATCH v2 11/14] ftrace/selftest: Have the reset_trigger code be a bit more careful Steven Rostedt
2018-05-16 12:53   ` Masami Hiramatsu
2018-05-16 14:00     ` Steven Rostedt
2018-05-16 23:15       ` Masami Hiramatsu
2018-05-14 20:58 ` [PATCH v2 12/14] ftrace/selftest: Fix reset_trigger() to handle triggers with filters Steven Rostedt
2018-05-16 12:56   ` Masami Hiramatsu
2018-05-16 14:04     ` Steven Rostedt
2018-05-14 20:58 ` [PATCH v2 13/14] tracing/selftest: Add selftests to test trace_marker histogram triggers Steven Rostedt
2018-05-16 13:07   ` Masami Hiramatsu
2018-05-16 14:06     ` Steven Rostedt
2018-05-14 20:58 ` [PATCH v2 14/14] tracing/selftest: Add test to test hist trigger between kernel event and trace_marker Steven Rostedt
2018-05-16  9:11   ` Namhyung Kim
2018-05-16 14:09     ` 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=20180516095534.676d7938@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=bgregg@netflix.com \
    --cc=joel@joelfernandes.org \
    --cc=karim.yaghmour@opersys.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=tom.zanussi@linux.intel.com \
    --cc=williams@redhat.com \
    --cc=ylavic.dev@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;
as well as URLs for NNTP newsgroup(s).