[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4F3361D7.4020203@gmail.com>
Date: Wed, 08 Feb 2012 23:04:07 -0700
From: David Ahern <dsahern@...il.com>
To: Namhyung Kim <namhyung@...il.com>
CC: acme@...stprotocols.net, linux-kernel@...r.kernel.org,
mingo@...e.hu, peterz@...radead.org, fweisbec@...il.com,
paulus@...ba.org, tglx@...utronix.de
Subject: Re: [PATCH] perf tools: Allow multiple threads or processes in record,
stat, top
On 02/08/2012 10:36 PM, Namhyung Kim wrote:
> Oh, I meant this:
>
> static struct thread_map *thread_map__new_by_pid_str(const char *pid_str)
> {
> ...
> while (*str) {
> ...
> tmp = thread_map__new_by_pid(pid);
> ...
> }
> ...
> }
>
> static struct thread_map *thread_map__new_by_tid_str(const char *tid_str)
> {
> ...
> while (*str) {
> ...
> tmp = thread_map__new_by_tid(tid);
> ...
> }
> ...
> }
I'm still not seeing the code simplification here. For example,
new_by_tid(tid) allocates threads, sets the first element (it only
supports one) and returns it. In new_by_tid_str we loop over a CSV,
allocating/re-allocating on additional and then setting the current i-th
tid as opposed to the 0th element.
Similarly, for pid.
Personally, I liked my first patch better which dropped the current
tid/pid functions; they are only used by perf-test and it can be updated
to convert getpid() to a string and use the new API.
David
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists