public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Luigi Semenzato <semenzato@chromium.org>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	Paul Mackerras <paulus@samba.org>, Ingo Molnar <mingo@elte.hu>,
	Arnaldo Carvalho de Melo <acme@ghostprotocols.net>,
	Andrew Morton <akpm@linux-foundation.org>,
	Vasiliy Kulikov <segoon@openwall.com>,
	Stephen Wilson <wilsons@start.ca>,
	Oleg Nesterov <oleg@redhat.com>, Tejun Heo <tj@kernel.org>,
	Paul Gortmaker <paul.gortmaker@windriver.com>,
	Andi Kleen <ak@linux.intel.com>,
	Lucas De Marchi <lucas.demarchi@profusion.mobi>,
	Greg Kroah-Hartman <gregkh@suse.de>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	"Rafael J. Wysocki" <rjw@sisk.pl>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Namhyung Kim <namhyung@gmail.com>,
	Robert Richter <robert.richter@amd.com>,
	linux-kernel@vger.kernel.org, sonnyrao@chromium.org,
	olofj@chromium.org, eranian@google.com
Subject: Re: [PATCH] Perf: bug fix: distinguish between rename and exec
Date: Wed, 15 Feb 2012 11:55:47 -0700	[thread overview]
Message-ID: <4F3BFFB3.1040907@gmail.com> (raw)
In-Reply-To: <1329327045.2293.156.camel@twins>

On 2/15/12 10:30 AM, Peter Zijlstra wrote:
> On Wed, 2012-02-15 at 09:57 -0700, David Ahern wrote:
>>
>> I'm not Acme, but I do care. We use a lot of processes with named
>> threads that give users an idea about the function of a particular
>> thread.
>>
> But why would they care? If you're debugging its easy enough to see from
> the backtrace and if you're not, most tools like top/ps don't even show
> threads (by default).
>
> So who cares what threads are called.
>
> I realize I'm not going to convince anybody, but I genuinely don't see
> the point of naming threads.

Very subjective. How fast do you want your users/tech 
staff/developers/QA testers to make sense of what is going on? Which is 
more informative (process and thread names sanitized)

$ top -d5

top - 18:39:49 up 23:46,  1 user,  load average: 0.75, 0.37, 0.24
Cpu(s): 11.0%us, 19.0%sy,  0.0%ni, 47.8%id,  0.0%wa,  0.3%hi, 21.8%si, 
0.0%st

   PID USER   S %CPU %MEM    TIME+  COMMAND
  3830 root   S 62.4  1.1   1:16.68 myapp


Wow, myapp is sucking up CPU. I wonder what it's doing. 'H'.


With non-named threads:

top - 18:40:36 up 23:47,  1 user,  load average: 0.89, 0.47, 0.28
Cpu(s): 15.5%us, 22.4%sy,  0.0%ni, 45.7%id,  0.0%wa,  0.6%hi, 15.9%si, 
0.0%st

   PID USER  S %CPU %MEM    TIME+  COMMAND
  3891 root  S 44.8  1.1   0:12.39 myapp
  3879 root  R 14.6  1.1   0:26.07 myapp
  3893 root  S  8.7  1.1   0:08.62 myapp

Ok, so 3 threads are dominating the CPU. I guess I need to hook up gdb 
to find out which functional areas those threads are running. Or, for 
one product I worked on you have to know that the thread map is dumped 
to a file, get shell access, read it and mentally correlate lwps.

Or you can name the threads:

top - 18:40:36 up 23:47,  1 user,  load average: 0.89, 0.47, 0.28
Cpu(s): 15.5%us, 22.4%sy,  0.0%ni, 45.7%id,  0.0%wa,  0.6%hi, 15.9%si, 
0.0%st

   PID USER  S %CPU %MEM    TIME+  COMMAND
  3891 root  S 44.8  1.1   0:12.39 myapp:dispatch
  3879 root  R 14.6  1.1   0:26.07 myapp:my-mgr
  3893 root  S  8.7  1.1   0:08.62 myapp:worker

Sure process knowledge is needed but top gives a lot more information 
for named threads.

Even with perf having named threads makes the event dumps 100x more 
understandable because the comm name gives you a hint about what the 
task is does.

David

  reply	other threads:[~2012-02-15 18:55 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-14  4:56 [PATCH] Perf: bug fix: distinguish between rename and exec Luigi Semenzato
2012-02-15 12:48 ` Peter Zijlstra
2012-02-15 13:47   ` Arnaldo Carvalho de Melo
2012-02-15 17:07     ` Luigi Semenzato
2012-02-15 17:47       ` Arnaldo Carvalho de Melo
2012-03-02 13:44         ` Stephane Eranian
2012-03-02 14:47           ` Arnaldo Carvalho de Melo
2012-03-02 15:25             ` Stephane Eranian
2012-02-15 16:57   ` David Ahern
2012-02-15 17:22     ` Luigi Semenzato
2012-02-15 17:30       ` David Ahern
2012-02-15 17:30     ` Peter Zijlstra
2012-02-15 18:55       ` David Ahern [this message]
     [not found]   ` <CABPqkBTJHOsSfMBMW17reBObLW0bphWZo4AjVh_hTkv5tBHtDA@mail.gmail.com>
2012-02-15 18:07     ` Arnaldo Carvalho de Melo

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=4F3BFFB3.1040907@gmail.com \
    --to=dsahern@gmail.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@ghostprotocols.net \
    --cc=ak@linux.intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=ebiederm@xmission.com \
    --cc=eranian@google.com \
    --cc=fweisbec@gmail.com \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lucas.demarchi@profusion.mobi \
    --cc=mingo@elte.hu \
    --cc=namhyung@gmail.com \
    --cc=oleg@redhat.com \
    --cc=olofj@chromium.org \
    --cc=paul.gortmaker@windriver.com \
    --cc=paulus@samba.org \
    --cc=rjw@sisk.pl \
    --cc=robert.richter@amd.com \
    --cc=segoon@openwall.com \
    --cc=semenzato@chromium.org \
    --cc=sonnyrao@chromium.org \
    --cc=tj@kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=wilsons@start.ca \
    /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