Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1112299ybt; Tue, 7 Jul 2020 08:04:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3ecWn8AEMdl4R8/PoCJRQrJtpetHVdBDCdBzo7qxuwytLeK5yx9pegrCtpVcF87foGhFW X-Received: by 2002:a05:6402:377:: with SMTP id s23mr63093957edw.200.1594134270139; Tue, 07 Jul 2020 08:04:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594134270; cv=none; d=google.com; s=arc-20160816; b=FjGI/cmUHYOosg27QMGpCuPXHo3VICN8w9TUGsygOQ6Xh6pbN1Y7dhi6CkybiS/Gb+ 7HIjW0r7402oM1lOfoHCi1wO0jWvShe43uzkkFFa01BwN+/MRlB/S3LLgmfQatOn34XI arCJRhabHb+r5cJlKueBGuqn1IBnR3H98eQhfJiZJeXCmHAHX+Hxfnfh1AuDJAWrMkpv 5F20wOMX46UsqUcnZ3QrSet4HCckih13GEAQlj59IvLIWmANty2HeVXoC6p6lX1LiwxF GeFavAAFbRVjw+EQzhkryUTrXXWHxow5ZyKRT8bJVO6GwLMM7WCLTJRQgRsClROSi7ZC gSHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=wWjXV7DEQx3ncjXAY2CjIphJoukS9/XdLpuwhVDw4mg=; b=xAaOD3k2VdaZLfeOUtAisDFA1N8U/7zAGkKBkvYP0LqBVCuVcTjYD1xIuXLIk++fNd h5wDOSLz/8aU3EaOHYHCShNUXeZOunZMC6yqq4NbwNqkCWDDJVGMwmP8XLtBwgw1oElN Yf8OPoo87bwT1rBdV8dFAr6JShzgNoiXvIDX9Ohp6NSKjlPg4rp7FvvjRLxzzYPg5PZf vHkCpNUZsP50PCyPtWoeTILE+35qMIh0YaQw3IaJK1YkNJbcC8rlu055zMPWoLx1t+Jf xepgA4kYNTwpjRXkXMOVMK91EnKiKDTC8KDhZpmqLcfof4dEiArQ9a23WnVp0vImYJsi j6jQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=EXSPwmuM; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f21si17818351ejl.362.2020.07.07.08.04.05; Tue, 07 Jul 2020 08:04:30 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=EXSPwmuM; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728194AbgGGPBJ (ORCPT + 99 others); Tue, 7 Jul 2020 11:01:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727995AbgGGPBJ (ORCPT ); Tue, 7 Jul 2020 11:01:09 -0400 Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 500F0C061755 for ; Tue, 7 Jul 2020 08:01:09 -0700 (PDT) Received: by mail-pf1-x442.google.com with SMTP id u5so18545694pfn.7 for ; Tue, 07 Jul 2020 08:01:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=wWjXV7DEQx3ncjXAY2CjIphJoukS9/XdLpuwhVDw4mg=; b=EXSPwmuMGohTTTzkX6UHPOalqXxjG/i7r0OhgEzWrc3ookD1FcDpzJWtTd8717cMoO pcPydGoK/K0egjaLnbnu90EOoox6G3eHK+8PKFX6GsoaZoMCFCUDfRmYImbNwKEr1Bej eWBNTcgW82nH0CF3l5bxRaRX3+FYhMp6OMZJ1B2gBhBKnqKgUenKfMxfFbyXP1w7l76G Oqx/qKEpoTlPi30za8/DQTy9DzpiukI3N75jsJHMpsEOHQ6h6VF22ist3hMCoRWBriGh LiFkb8vlAs3DIkVNL7YRx1LyIg2G20IJlY6zrBugvbFNNL0XEe95lpQCM7Rv0nHAScLX VUrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=wWjXV7DEQx3ncjXAY2CjIphJoukS9/XdLpuwhVDw4mg=; b=qgkNsOdU9ZLYbYODfrrRoUuwiIZYQBkIgRumCYOzkEcryZ+JoYkgv0Y+lwLK5U4I+H 36WoRqwmlQs1wvRn2odr/1OdJDDVv7QafOm/Wlu8rbxJjNOmWUuiYPncEJc7xQH70Qaw rZyqfDTc0+8UazzZyULqcA5tuQFEiodCIXp6tjBUU/5/beKh0F4w+a9Xs5r8ikOIgwNv JGGpOemNLPoYBZ9+eI6Mc105SITuSb+sw8CM2N+K50jPj+X5hFFy5+k41na7SMTUmplv CoRSxIFMWBKk8Z41H94c39B5FLjjzN3J60BUb6q6sP6YuL+D+IA/Ph4ZEXVUwco1sygo HTNA== X-Gm-Message-State: AOAM532fUKi6hsDFzXHi0Ny7/Ls1HuhDWJBNvBRhbu1N99vFUNSGRaNh kQrwH9Aj5YCnMq7wPjVRlfA= X-Received: by 2002:a63:3e09:: with SMTP id l9mr46513309pga.235.1594134067952; Tue, 07 Jul 2020 08:01:07 -0700 (PDT) Received: from mail.google.com ([149.248.10.52]) by smtp.gmail.com with ESMTPSA id q24sm1259909pgg.3.2020.07.07.08.01.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jul 2020 08:01:07 -0700 (PDT) Date: Tue, 7 Jul 2020 23:00:55 +0800 From: Changbin Du To: Namhyung Kim Cc: Changbin Du , Jiri Olsa , Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Steven Rostedt , linux-kernel Subject: Re: [PATCH v2 01/15] perf ftrace: select function/function_graph tracer automatically Message-ID: <20200707150055.6rg3bcols2s3psrz@mail.google.com> References: <20200627133654.64863-1-changbin.du@gmail.com> <20200627133654.64863-2-changbin.du@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 03, 2020 at 02:47:09PM +0900, Namhyung Kim wrote: > Hello, > > On Sat, Jun 27, 2020 at 10:37 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. > > - The default filter for -G/-T is to trace all functions. > > > > 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 > > > > This will trace function vfs_read using function graph tracer: > > $ sudo perf ftrace -G vfs_read > > As we support running a new task on the command line, it might > confuse users whether it's an argument of -G option or a task to run. > One can use -- to separate them but it's easy to miss.. > yes, it is a bit confusing. How about remove the default value '*'? > Thanks > Namhyung > > > > > > Signed-off-by: Changbin Du > > --- > > tools/perf/Documentation/perf-config.txt | 5 ----- > > tools/perf/Documentation/perf-ftrace.txt | 2 +- > > tools/perf/builtin-ftrace.c | 19 ++++++++++++------- > > 3 files changed, 13 insertions(+), 13 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..c5718503eded 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, > > @@ -478,12 +478,14 @@ int cmd_ftrace(int argc, const char **argv) > > "system-wide collection from all CPUs"), > > 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), > > + OPT_CALLBACK_DEFAULT('T', "trace-funcs", &ftrace.filters, "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), > > + OPT_CALLBACK_DEFAULT('G', "graph-funcs", &ftrace.graph_funcs, "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 > > -- Cheers, Changbin Du