Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp575847ybt; Fri, 10 Jul 2020 07:15:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCnw+Syyn0YImjJFvYn5gdfoQM4RZUbKdTE35fW2v6F7ky8tcPktnBHswlusiXiKQjLOWW X-Received: by 2002:a17:906:4949:: with SMTP id f9mr38246792ejt.495.1594390527872; Fri, 10 Jul 2020 07:15:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594390527; cv=none; d=google.com; s=arc-20160816; b=MfBY7NkvV+buMTeoe6pjjQxfa/V6WZzURxAyadLCthTTkRzP5QHs+178Xv8dDfEdo1 OppE4BgRHhKbfJ6RcvT3BEwrqcHBNW/V+wK7+wA5spPCVJ1+nhYm/cbiiAxpTnbr/mhA 0vNTlM0H+opIOvQd1ibXFhHUlIUaDj5M4/a5Gqu96WagRfP5RKTSfUVZMvX6gyFoVrjd YDojRQ1ifVH4+FjT5MnZOCyzmof/Q1dQ56mXC4zGxYzM/2ojGT8JIFggkTCWq2TmCd8N fyxXpiJ6idkXzEveSRlU0Uk9FsfxJsuuJBAv0p5RF3mQCFraLEcvqveP7XG3zMrvJMdo YMtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=zCDDO19SFMMcZT0ta8wWRP3o4PUahr2b5mUeEJKiLxg=; b=ZKrBYnyXNqKxdcueB8uRU7MMWFZ3Yiw8wPeOjQ7J3j0wWTVSMNffTXF8IR4/9LM5X4 b0XB23MQOlARzwVfMZRBzrfEfU3SEHP13hWHm7pXhGBzx8PbNBsr3PFHJ/M4F7Ls/zfT ENjNDQnv59lYTjI/D5TaUTayryn3QAQ7wLeCeo8LWPFoUGOZU9912MaHmKT//raME6uQ BYOAhHvCWclyJqrKZ6vD6FmCTcKUa/9+hEO+FickOZi1rWV0/nPPs6/YGLZ5xTjESSzj 6coI0g13r6OHFHdEoEVB0CA6HpyuJ0PfkJ7iwHK5XNsXJuzu5xAgZ/jzhFrjp4FiIxWu q96g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a12si4736452edf.4.2020.07.10.07.15.04; Fri, 10 Jul 2020 07:15:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728043AbgGJOOT (ORCPT + 99 others); Fri, 10 Jul 2020 10:14:19 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:33056 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727107AbgGJOOT (ORCPT ); Fri, 10 Jul 2020 10:14:19 -0400 Received: by mail-wr1-f65.google.com with SMTP id f18so6141457wrs.0 for ; Fri, 10 Jul 2020 07:14:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zCDDO19SFMMcZT0ta8wWRP3o4PUahr2b5mUeEJKiLxg=; b=J0a79lq+vlhTVa9qaXK/3WTWaRDZFzfhw9rGtwL0MKTDBUXHRGZ0kHJlsAaN5p5MHR YKQGy6RnbwYCCvViebErT7KxLFDC+RbadNJdF079+KcE12nTm+mcnJqYdNz0+N1ebWWB 2WvVA3oOP3xVCuI3uv1PHnPzXZIl6RjG164BHH0bPCo8RO1CT3vLkqnuSlIRtFN4QUrH cv68oWMZJsIgS/kdLYgkAZXhuZb/NFZW7EKNDNZT+/hVE2zDh1XGZA0/X+Q1VfdEJNrs rgCsneLzHuyLrt88upWOUaStnT0uupPzeU7LoxVCv0h5tqeKvFfUraNTA5bjnk2BBOFM IUkw== X-Gm-Message-State: AOAM533UwvqKa94AYbma/h1pm6PY0GlB4SzaZi2uPpTgx8PqxlMIU8I1 HJhAK27Z1BKudTAXrf8m/Da2sypqUM5VCazE1dU= X-Received: by 2002:adf:fa8b:: with SMTP id h11mr68080481wrr.391.1594390456674; Fri, 10 Jul 2020 07:14:16 -0700 (PDT) MIME-Version: 1.0 References: <20200710134322.15400-1-changbin.du@gmail.com> <20200710134322.15400-2-changbin.du@gmail.com> In-Reply-To: <20200710134322.15400-2-changbin.du@gmail.com> From: Namhyung Kim Date: Fri, 10 Jul 2020 23:14:05 +0900 Message-ID: Subject: Re: [PATCH v4 01/17] perf ftrace: select function/function_graph tracer automatically To: Changbin Du Cc: Jiri Olsa , Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Steven Rostedt , linux-kernel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Fri, Jul 10, 2020 at 10:43 PM Changbin Du wrote: > > The '-g/-G' options have already implied function_graph tracer should be > used instead of function tracer. So the extra option '--tracer' can be > killed. > > This patch changes the behavior as below: > - By default, function tracer is used. > - If '-g' or '-G' option is on, then function_graph tracer is used. > - The perf configuration item 'ftrace.tracer' is marked as deprecated. > - The option '--tracer' is marked as deprecated. > > Here are some examples. > > This will start tracing all functions using function tracer: > $ sudo perf ftrace > > This will trace all functions using function graph tracer: > $ sudo perf ftrace -G If you removed the default value, this doesn't work, right? Thanks Namhyung > > This will trace function vfs_read using function graph tracer: > $ sudo perf ftrace -G vfs_read > > Signed-off-by: Changbin Du > > --- > v3: remove default '*' for -G/-T. > --- > tools/perf/Documentation/perf-config.txt | 5 ----- > tools/perf/Documentation/perf-ftrace.txt | 2 +- > tools/perf/builtin-ftrace.c | 15 ++++++++++----- > 3 files changed, 11 insertions(+), 11 deletions(-) > > diff --git a/tools/perf/Documentation/perf-config.txt b/tools/perf/Documentation/perf-config.txt > index c7d3df5798e2..a25fee7de3b2 100644 > --- a/tools/perf/Documentation/perf-config.txt > +++ b/tools/perf/Documentation/perf-config.txt > @@ -612,11 +612,6 @@ trace.*:: > "libbeauty", the default, to use the same argument beautifiers used in the > strace-like sys_enter+sys_exit lines. > > -ftrace.*:: > - ftrace.tracer:: > - Can be used to select the default tracer. Possible values are > - 'function' and 'function_graph'. > - > llvm.*:: > llvm.clang-path:: > Path to clang. If omit, search it from $PATH. > diff --git a/tools/perf/Documentation/perf-ftrace.txt b/tools/perf/Documentation/perf-ftrace.txt > index b80c84307dc9..952e46669168 100644 > --- a/tools/perf/Documentation/perf-ftrace.txt > +++ b/tools/perf/Documentation/perf-ftrace.txt > @@ -24,7 +24,7 @@ OPTIONS > > -t:: > --tracer=:: > - Tracer to use: function_graph or function. > + Tracer to use: function_graph or function. This option is deprecated. > > -v:: > --verbose=:: > diff --git a/tools/perf/builtin-ftrace.c b/tools/perf/builtin-ftrace.c > index 2bfc1b0db536..5f53da87040d 100644 > --- a/tools/perf/builtin-ftrace.c > +++ b/tools/perf/builtin-ftrace.c > @@ -27,7 +27,6 @@ > #include "util/cap.h" > #include "util/config.h" > > -#define DEFAULT_TRACER "function_graph" > > struct perf_ftrace { > struct evlist *evlist; > @@ -419,6 +418,7 @@ static int perf_ftrace_config(const char *var, const char *value, void *cb) > if (strcmp(var, "ftrace.tracer")) > return -1; > > + pr_warning("Configuration ftrace.tracer is deprecated\n"); > if (!strcmp(value, "function_graph") || > !strcmp(value, "function")) { > ftrace->tracer = value; > @@ -459,7 +459,7 @@ int cmd_ftrace(int argc, const char **argv) > { > int ret; > struct perf_ftrace ftrace = { > - .tracer = DEFAULT_TRACER, > + .tracer = "function", > .target = { .uid = UINT_MAX, }, > }; > const char * const ftrace_usage[] = { > @@ -469,7 +469,7 @@ int cmd_ftrace(int argc, const char **argv) > }; > const struct option ftrace_options[] = { > OPT_STRING('t', "tracer", &ftrace.tracer, "tracer", > - "tracer to use: function_graph(default) or function"), > + "tracer to use: function or function_graph (This option is deprecated)"), > OPT_STRING('p', "pid", &ftrace.target.pid, "pid", > "trace on existing process id"), > OPT_INCR('v', "verbose", &verbose, > @@ -479,11 +479,13 @@ int cmd_ftrace(int argc, const char **argv) > OPT_STRING('C', "cpu", &ftrace.target.cpu_list, "cpu", > "list of cpus to monitor"), > OPT_CALLBACK('T', "trace-funcs", &ftrace.filters, "func", > - "trace given functions only", parse_filter_func), > + "trace given functions using function tracer", > + parse_filter_func), > OPT_CALLBACK('N', "notrace-funcs", &ftrace.notrace, "func", > "do not trace given functions", parse_filter_func), > OPT_CALLBACK('G', "graph-funcs", &ftrace.graph_funcs, "func", > - "Set graph filter on given functions", parse_filter_func), > + "trace given functions using function_graph tracer", > + parse_filter_func), > OPT_CALLBACK('g', "nograph-funcs", &ftrace.nograph_funcs, "func", > "Set nograph filter on given functions", parse_filter_func), > OPT_INTEGER('D', "graph-depth", &ftrace.graph_depth, > @@ -505,6 +507,9 @@ int cmd_ftrace(int argc, const char **argv) > if (!argc && target__none(&ftrace.target)) > ftrace.target.system_wide = true; > > + if (!list_empty(&ftrace.graph_funcs) || !list_empty(&ftrace.nograph_funcs)) > + ftrace.tracer = "function_graph"; > + > ret = target__validate(&ftrace.target); > if (ret) { > char errbuf[512]; > -- > 2.25.1 >