lkml.org 
[lkml]   [2013]   [Jun]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 06/19] perf ftrace: Add support for --pid option
On 6/26/13 11:23 PM, Namhyung Kim wrote:
> On Wed, 26 Jun 2013 11:12:19 -0600, David Ahern wrote:
>> On 6/26/13 1:14 AM, Namhyung Kim wrote:
>>> @@ -196,6 +222,8 @@ int cmd_ftrace(int argc, const char **argv, const char *prefix __maybe_unused)
>>> const struct option ftrace_options[] = {
>>> OPT_STRING('t', "tracer", &ftrace.tracer, "tracer",
>>> "tracer to use"),
>>> + OPT_STRING('p', "pid", &ftrace.target.tid, "pid",
>>> + "trace on existing process id"),
>>> OPT_INCR('v', "verbose", &verbose,
>>> "be more verbose"),
>>> OPT_END()
>>
>> You are calling it pid but assigning it as a tid which is inconsistent
>> with other perf commands. e.g., perf-record allows a list of pids (-p)
>> or tids (-t). Why not support that in perf-ftrace? And that leads to
>> the comment about consistency of options across perf commands: -t is
>> used here for tracer type to use.
>
> Sorry, I should've mentioned it.
>
> The pid filtering in ftrace is done via set_ftrace_pid file under the
> tracing debugfs directory. IIRC It only supports process filtering not
> thread filtering by iterating all threads in the kernel code. So --tid
> option cannot be implemented as other perf commands.
>
> So I chose not to and assigned -t option to --tracer.

Could that ever change? With the current code why call it pid in the
option but assign it to target.tid? Seems a like a source for confusion
later. Would be better to just assign to target.pid and let the
machinery do the right thing.

David



\
 
 \ /
  Last update: 2013-06-27 16:41    [W:0.335 / U:0.292 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site