Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp182739ybh; Sat, 18 Jul 2020 00:06:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwRZ2Q0LQMHvPBRZYhhyn6uVVo3PNat0GVsAQ0oyK4V2r6ocf5xnCzlQC5why9l79GmdhPd X-Received: by 2002:aa7:dd05:: with SMTP id i5mr12788772edv.283.1595056004571; Sat, 18 Jul 2020 00:06:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595056004; cv=none; d=google.com; s=arc-20160816; b=xeipSEXrqCVbH7Otc/77eyhYG3d6QIesQD4tNfdoSUQQzvwi9iRC5yFi85BX58/Vh0 Dw0OhRsU6q9TkJfM7yECzqcp/JU/tR90Q83wVAjOpyyhTivNo8B4PvMGTe2s7NG92E31 cV3UStdh0V95pnMgBbnjF2uoEA9d4T55o8PGAdsrgYf9nBLp9d1l/wP0Xkb9shY3Y1rr JRHUy2rn7HVDympuvl31WXRXQa4+xKbb3l23WP9y+cFst83s345HZwSr6NmZ/Jw4Whcu 0xw9P0EAmWZWJgXWcCQc8trOkc8vDihdZjf5uHYtUL31J1wgm4SLyWLQrRTWif9tfgug 3Msg== 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=ZDanhgzBL5isHf3O8Q6LAiOPrrvpU7YVUQ/Y0+sRkuw=; b=y/xxTHfvwpxi4trg1sQU9yUNJAjP0mwOU1Fbfj2qaNrbC4/HT7v1ayX4bsymX9gVbq c02nyHcrAAIbfYVZKcjI8PBtkxopzHDdun3hpBFDsyzPklh49z4pDglzw+qbHgAPxrG6 yvEQbInA6r5eYaovFFu/uoh/KQ8bLzOTtdq4Vf6/rNqPCuuMwYfjHPlIDRU/Up+IIsoP jiTWXZV4gtQxO1AfQzugntBF8m6CJMxGAZKyQ+aDgMFyOD9U+UnHvExvnQzsPp9qiJEL ZPWmKDoAvrAO2nVBqaPewzHvjmmx0Fo2MzoQgbbFPp+jFUCBEALN1KsOeR+xsSiMFPjf Fe/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=USxg2NxY; 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 n14si2194813eji.489.2020.07.18.00.06.21; Sat, 18 Jul 2020 00:06:44 -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=USxg2NxY; 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 S1726704AbgGRHGM (ORCPT + 99 others); Sat, 18 Jul 2020 03:06:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725920AbgGRHGL (ORCPT ); Sat, 18 Jul 2020 03:06:11 -0400 Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E4CFC0619D2; Sat, 18 Jul 2020 00:06:11 -0700 (PDT) Received: by mail-pj1-x1043.google.com with SMTP id md7so7373234pjb.1; Sat, 18 Jul 2020 00:06:11 -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=ZDanhgzBL5isHf3O8Q6LAiOPrrvpU7YVUQ/Y0+sRkuw=; b=USxg2NxYWNuU2lhk1sg0nXu+HPHDKDyY2QBSBTbztxfefrlz9MXrGypp299ZUGl/AG 4kt5jexW2UjSJt1vutfWfF6Hqg1kkdnR2eVGVVzm1o9Acm6FJrqAnARP/9jKZzplMJ7m TSQZhp6z8Tg3utbqBA/qh1pBqNnGk2AY899KoJ5ieCR5H+/sEohSEVjkNHd95fydlGxU 1zsouIcA8OvhGs/Seru0CAVeGalq01VPlWOIMJ+ex8peuxE10KRMNc49zyNJ2c+3jJQ3 6alnRAABYoMW4W3JKNyL2acecuHbYkAfpXC3QMWSj+16VqnMUderyVQ7KRuDtoi+h+SC cuBg== 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=ZDanhgzBL5isHf3O8Q6LAiOPrrvpU7YVUQ/Y0+sRkuw=; b=oiiGy2JnfLnfIv7/LPSMFi/7XaJ4ZHDMQORvaFZtIWtbPB/CR5MnNCjsrvDh5VtBpO 3aWqO1+VOSE6tAnJkFUryZdJOeuofxdAFAmJHOaKFkg/3nCcRVrsRef3HRwhCHczOEvB X7OVX+63EdOackCpTa/RyYB3tHXe2NL/Vl9cYJXZZu34H6DCEv+Zj3Ag6/jjuIbI/UzU s9Uq206Tf/WB4ImgzNy4osatQldyWUYbFR9G0I1fKbwGMbXugFwKsccm5hF6/Tpss1GW rozbeOUVqrWPPxA3zgEUdsq6FRdqmwwMWMzqnCyTxde8lv0xlRQAteXmgkLDJmpbNLAa tQ3Q== X-Gm-Message-State: AOAM530LEtsAfaKT+JyuzcC6w6h0bY+llQzn0QHsEkK1YIZtbAUW0yaK qy4zKtSLHMNP5MTZtAgYDN3haYqn24Q= X-Received: by 2002:a17:90a:a47:: with SMTP id o65mr14081618pjo.70.1595055970990; Sat, 18 Jul 2020 00:06:10 -0700 (PDT) Received: from mail.google.com ([149.248.10.52]) by smtp.gmail.com with ESMTPSA id p9sm4804985pja.4.2020.07.18.00.06.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Jul 2020 00:06:10 -0700 (PDT) Date: Sat, 18 Jul 2020 15:06:00 +0800 From: Changbin Du To: Steven Rostedt Cc: Changbin Du , Jiri Olsa , Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Namhyung Kim , linux-kernel@vger.kernel.org, "linux-trace-devel@vger.kernel.org" Subject: Re: [PATCH v5 02/17] perf ftrace: add option '-F/--funcs' to list available functions Message-ID: <20200718070600.6ptgpxtj5xmcwckt@mail.google.com> References: <20200711124035.6513-1-changbin.du@gmail.com> <20200711124035.6513-3-changbin.du@gmail.com> <20200717110504.1650fbdc@oasis.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200717110504.1650fbdc@oasis.local.home> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 17, 2020 at 11:05:04AM -0400, Steven Rostedt wrote: > On Sat, 11 Jul 2020 20:40:20 +0800 > Changbin Du wrote: > > > This adds an option '-F/--funcs' to list all available functions to trace, > > which is read from tracing file 'available_filter_functions'. > > > > $ sudo ./perf ftrace -F | head > > trace_initcall_finish_cb > > initcall_blacklisted > > do_one_initcall > > do_one_initcall > > trace_initcall_start_cb > > run_init_process > > try_to_run_init_process > > match_dev_by_label > > match_dev_by_uuid > > rootfs_init_fs_context > > > > Signed-off-by: Changbin Du > > > > --- > > v2: option name '-l/--list-functions' -> '-F/--funcs' > > --- > > tools/perf/Documentation/perf-ftrace.txt | 4 +++ > > tools/perf/builtin-ftrace.c | 43 ++++++++++++++++++++++++ > > 2 files changed, 47 insertions(+) > > > > diff --git a/tools/perf/Documentation/perf-ftrace.txt b/tools/perf/Documentation/perf-ftrace.txt > > index 952e46669168..d79560dea19f 100644 > > --- a/tools/perf/Documentation/perf-ftrace.txt > > +++ b/tools/perf/Documentation/perf-ftrace.txt > > @@ -30,6 +30,10 @@ OPTIONS > > --verbose=:: > > Verbosity level. > > > > +-F:: > > +--funcs:: > > + List all available functions to trace. > > + > > -p:: > > --pid=:: > > Trace on existing process id (comma separated list). > > diff --git a/tools/perf/builtin-ftrace.c b/tools/perf/builtin-ftrace.c > > index 5f53da87040d..244cc8e6bd60 100644 > > --- a/tools/perf/builtin-ftrace.c > > +++ b/tools/perf/builtin-ftrace.c > > @@ -32,6 +32,7 @@ struct perf_ftrace { > > struct evlist *evlist; > > struct target target; > > const char *tracer; > > + bool list_avail_functions; > > struct list_head filters; > > struct list_head notrace; > > struct list_head graph_funcs; > > @@ -127,6 +128,43 @@ static int append_tracing_file(const char *name, const char *val) > > return __write_tracing_file(name, val, true); > > } > > > > +static int read_tracing_file_to_stdout(const char *name) > > +{ > > All this is looking like its duplicating code that we are working on > for libtracefs. > > Would you like to start contributing to that, and when we get the > libtracefs.so packed in distributions, we can easily create the > perf ftrace without having to rewrite the wheel 10 times? > > -- Steve Yes, I'd like to join the development of libtracefs. But honestly speaking, I am not sure whether I can get enough time on it since I have to take care of my little baby :). I have the same opinion with Arnaldo that we can merge what we'v already done here. Then consider to migrate to libtracefs instead before adding more new features. -- Cheers, Changbin Du