public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Dominik Klein <dk@in-telegence.net>
Cc: Tejun Heo <tj@kernel.org>, Vivek Goyal <vgoyal@redhat.com>,
	linux kernel mailing list <linux-kernel@vger.kernel.org>,
	libvir-list@redhat.com
Subject: Re: Is it a workqueue related issue in 2.6.37 (Was: Re: [libvirt] blkio cgroup [solved])
Date: Fri, 25 Feb 2011 14:53:08 -0500	[thread overview]
Message-ID: <20110225195307.GA23161@home.goodmis.org> (raw)
In-Reply-To: <4D67591F.10105@in-telegence.net>

On Fri, Feb 25, 2011 at 08:24:15AM +0100, Dominik Klein wrote:
> > Maybe watching what the workqueue is doing using the following trace
> > events could be helpful.
> > 
> > # grep workqueue /sys/kernel/debug/tracing/available_events
> > workqueue:workqueue_insertion
> > workqueue:workqueue_execution
> > workqueue:workqueue_creation
> > workqueue:workqueue_destruction
> 
> Since I've never done this before, I will tell you how I captured the
> trace so you know what I did and can see whether I did something wrong
> and can correct me if necessary.
> 
> echo blk > /sys/kernel/debug/tracing/current_tracer
> echo 1 > /sys/block/sdb/trace/enable
> echo workqueue_queue_work >> /sys/kernel/debug/tracing/set_event
> echo workqueue_activate_work >> /sys/kernel/debug/tracing/set_event
> echo workqueue_execute_start >> /sys/kernel/debug/tracing/set_event
> echo workqueue_execute_end >> /sys/kernel/debug/tracing/set_event
> cat /sys/kernel/debug/tracing/trace_pipe

Just an FYI,

If you download trace-cmd from:

git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git

You could do the following:

# trace-cmd record -p blk -e workqueue_queue_work -e workqueue_activate_work -e workqueue_execute_start -e workqueue_execute_end <cmd>

Where <cmd> could be 
sh -c "echo 1 > /sys/block/sdb/trace/enable; sleep 10"

This will create a trace.dat file that you can read with 
trace-cmd report

Another way, if you want to do more than just that echo is to use:

# trace-cmd start -p blk -e workqueue_queue_work -e workqueue_activate_work -e workqueue_execute_start -e workqueue_execute_end
# echo 1 > /sys/block/sdb/trace/enable
# <do anyting you want>
# trace-cmd stop
# trace-cmd extract

The start just enable ftrace (like you did with the echos).
The extract will create the trace.dat file from the ftrace ring buffers.
You could alse just cat trace_pipe, which would do the same, or you
could do the echos, and then the trace-cmd stop and extract to get the
file. It's your choice ;)

You can then gzip the trace.dat file and send it to others that can read
it as well, as all the information needed to read the trace is recorded
in the file.

You could even send the data over the network instead of writing the
trace.dat locally.

On another box:

$ trace-cmd listen -p 12345

Then on the target:

# trace-cmd record -N host:12345 ...

This will send the data to the listening host and the file will be
created on the host side.

One added benefit of having the trace.dat file. kernelshark can read it.

-- Steve



> 
> And that output i gzip'd.
> 
> This was taken with 2.6.37 plus the patch you mentioned on a Dell R815
> with 2 12 core AMD Opteron 6174 CPUs. If you need any more information,
> please let me know.
> 



  parent reply	other threads:[~2011-02-25 19:53 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20110218163137.GF26654@redhat.com>
     [not found] ` <4D621B9B.3070205@in-telegence.net>
     [not found]   ` <4D622002.2040604@in-telegence.net>
     [not found]     ` <4D6222A8.6090303@in-telegence.net>
     [not found]       ` <20110221184442.GM6428@redhat.com>
     [not found]         ` <4D63BA3B.7070809@in-telegence.net>
     [not found]           ` <20110222152426.GD28269@redhat.com>
     [not found]             ` <20110222190953.GF28269@redhat.com>
     [not found]               ` <4D650D7E.4050908@in-telegence.net>
     [not found]                 ` <4D662248.6040405@in-telegence.net>
2011-02-24 14:23                   ` Is it a workqueue related issue in 2.6.37 (Was: Re: [libvirt] blkio cgroup [solved]) Vivek Goyal
2011-02-24 14:31                     ` Tejun Heo
2011-02-24 14:58                       ` Dominik Klein
2011-02-24 15:17                         ` Tejun Heo
2011-02-25  7:24                           ` Dominik Klein
2011-02-25 11:29                             ` Tejun Heo
2011-02-25 11:46                               ` Dominik Klein
2011-02-25 13:18                                 ` Tejun Heo
2011-02-25 14:41                                   ` Dominik Klein
2011-02-25 14:55                                     ` Tejun Heo
2011-02-25 14:57                                   ` Vivek Goyal
2011-02-25 15:03                                     ` Tejun Heo
2011-02-25 15:11                                       ` Vivek Goyal
2011-02-25 15:15                                         ` Vivek Goyal
2011-02-25 16:03                                         ` Vivek Goyal
2011-02-25 16:09                                           ` Tejun Heo
2011-02-25 16:19                                             ` Vivek Goyal
2011-02-25 16:30                                             ` Vivek Goyal
2011-02-25 16:56                                               ` Dominik Klein
2011-02-25 19:53                             ` Steven Rostedt [this message]
2011-02-25 20:18                               ` Vivek Goyal
2011-02-26  2:47                                 ` 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=20110225195307.GA23161@home.goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=dk@in-telegence.net \
    --cc=libvir-list@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tj@kernel.org \
    --cc=vgoyal@redhat.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