Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp537239ybt; Wed, 8 Jul 2020 06:04:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzo86X/AR2lXODia+Z8VXazuhmklkprIC52O+w00UurUXND0qKSshze4PEnYLu4KZMq0Zr6 X-Received: by 2002:a17:906:38da:: with SMTP id r26mr50072422ejd.120.1594213471190; Wed, 08 Jul 2020 06:04:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594213471; cv=none; d=google.com; s=arc-20160816; b=JkTpowxbHz8vbBQUM+p1vsm6sEilgEKWYQ0pheB+oTXejwOpvRw50RFARty8DaZK5+ 0fqnGWOk7wisENQTO2M/tXV1ZRSZF35/N9lAsHVXlpm9W71yny5rtyWoX3lV2wUHNAH7 7M5NWYNn8ySL29lwkzOipyZbGLJDCmZhjyzrwCu8U9kyBbLeo0T5hsYcVoP3wz/NBcKW a2/YXz7xEiRxbjlsDCQuT3vbINapKaiwvpovrNxMQ/QA8H773MFoNu5hT4pxJVG47eoR eViRlBdYNJU4Mhy1g06FR+oAYoAnz2w8BQZclwevDC+qhQmwhT0GwpMJpbBoY+ZcjiI7 XUdA== 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=AR/+kkmrZYJx40sEb+zRuBli/0RUxgaF5v240jClZxk=; b=ImMopP/scUwEYOFBiUueC8u2K1yedxOgV8uWqA0urhKndGnh9E/+P84j8HeMCa9uwF ge2q9al213SHS46pQwRsjOvHaAvXgRuxs/WLuV6l4s6UDQKVDzAX1RyVwF7yyhVQUATH +6+mNEOFAO9IJ7jyBWUz/v2YFLuk36fvJENipKVDZzkInn0AZwnibP/2F1/yU6L5dfqI DECOwr64oQhHpCK5/FmKSYFTZwy2EdEADfDxzKa0eYpvtZk4Ekh1nKAmfvqa7fxT9rIs xQpdUhDe2C/Mtt29fZONUB4U0Tl2mcfo2Z070eyL9goeWKI4oatFHMmcF6rQs/36QDgr MzXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qIcwIJ7n; 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 m20si17716372eds.126.2020.07.08.06.04.07; Wed, 08 Jul 2020 06:04:31 -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=qIcwIJ7n; 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 S1729171AbgGHM73 (ORCPT + 99 others); Wed, 8 Jul 2020 08:59:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728941AbgGHM73 (ORCPT ); Wed, 8 Jul 2020 08:59:29 -0400 Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EC4EC08C5DC for ; Wed, 8 Jul 2020 05:59:29 -0700 (PDT) Received: by mail-pl1-x643.google.com with SMTP id b9so617201plx.6 for ; Wed, 08 Jul 2020 05:59:29 -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=AR/+kkmrZYJx40sEb+zRuBli/0RUxgaF5v240jClZxk=; b=qIcwIJ7nxSDfZqK+fE9ZdVWlWyRHkHL/3Q8tw+K/dY6Nf/6VxorwVTGVayZKrc/0b7 Y0CM62/v17XcWlDLnbXhBmNz8qvl5GQAHl2nFXnNzAoO2jNmhkrYeY9EMKdwc40+N4vS tGvTgdYhVy0Fg1jig3VoEc7zw4eC3vo9Tv+qOYlDMs5WGDwzgHfeFsWI5QLjr1vhGn5k v1HjzQoT7jzNWyPGuHC5CD64ZPVYKdrAdNTorswV2J78Ja5fHlbvP3WJ3V+IJSavU4xl BZ5M/eBHYaxRNwPRK2i7Tl6GHmh8LpPxHehujPs9fB25rmB5peow3YDO7l8t+YMBzl09 8Pvg== 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=AR/+kkmrZYJx40sEb+zRuBli/0RUxgaF5v240jClZxk=; b=b9ytcID2FPDhEAXcVj+pCN6u5iPxXlIQKnGXAb0lecxS0RfHxvgImwgamatEs+mNW2 MP83wbOhii6ZrwysFaeAOCu2Xd0A05tRjhqzrWEBBWa2VGI/50SN1gqPwJN8JSLILIVm ucH9nE6s+RdJvS/kFu4guuiN0kv7psm2NXGAh5g+4E6EXlEhwvd2DJ6lt46OzbgzdYFh QpUeAwN74HLcg2t28mSXLwp/jh5UQtNQf5BsQEBqZpdFIWVadzhnrwEF8GDnlvYTvuFq t/AiWhyANOHVNxwfaHZH0MdM6YHF4QtKu1jd9895SG3BLpTyU/YXa4Yvl6OtAXA982ni yc1A== X-Gm-Message-State: AOAM533oTamKixgnhGsqOANM7O1zlxiDSXiKZK2bK1Z0k2eB8/6rk9bs swLwocx/2UgA4wx8uPhDzJI= X-Received: by 2002:a17:902:b687:: with SMTP id c7mr49600899pls.102.1594213168676; Wed, 08 Jul 2020 05:59:28 -0700 (PDT) Received: from mail.google.com ([149.248.10.52]) by smtp.gmail.com with ESMTPSA id 199sm3922422pgc.79.2020.07.08.05.59.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jul 2020 05:59:27 -0700 (PDT) Date: Wed, 8 Jul 2020 20:59:20 +0800 From: Changbin Du To: Arnaldo Carvalho de Melo Cc: Changbin Du , Namhyung Kim , Jiri Olsa , Peter Zijlstra , Ingo Molnar , Steven Rostedt , linux-kernel Subject: Re: [PATCH v2 10/15] perf ftrace: add support for trace option sleep-time Message-ID: <20200708125920.nmsq27otrjxmpjfx@mail.google.com> References: <20200627133654.64863-1-changbin.du@gmail.com> <20200627133654.64863-11-changbin.du@gmail.com> <20200707152539.ldhgqf6vmnttqnfn@mail.google.com> <20200707160943.GA1556@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200707160943.GA1556@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 07, 2020 at 01:09:43PM -0300, Arnaldo Carvalho de Melo wrote: > Em Tue, Jul 07, 2020 at 11:35:14PM +0800, Changbin Du escreveu: > > On Fri, Jul 03, 2020 at 03:40:59PM +0900, Namhyung Kim wrote: > > > On Sat, Jun 27, 2020 at 10:38 PM Changbin Du wrote: > > > > This adds an option '--graph-nosleep-time' which allow us only to measure > > > > on-CPU time. This option is function_graph tracer only. > > > > I'd suggest --graph-sleep-time instead and set it by default. > > > Then we can have --no-graph-sleep-time as well. > > > If so can we make --graph-sleep-time as default. Seems there is no something > > like OPT_BOOLEAN_DEFAULT(). > > > > By the way, didn't we agree to have something like --graph-opts instead? > > > As I mentioned in previous version, --graph-opts make the parsing a little > > complex. > > --graph-opts depth=,nosleep_time,noirqs,no_tail,verbose > > > While the exsiting style is '--graph-depth '. The cons is we must type more > > characters. The pros is don't need to reimplement parsing and align with old > > behaviour. > > --graph-depth > > --graph-nosleep-time > > --graph-noirqs > > --graph-notail > > --graph-verbose > > This achieves the same result, yes, but it is more cumbersome, to use > all we would have to do: > > perf ftrace --graph-depth 10 --graph-nosleep-time --graph-noirqs --graph-notail --graph-verbose ... > > When we could have a more compact: > > perf ftrace --graph-opts depth=10,nosleep-time,noirqs,notail,verbose ... > > I.e., instead of a series of: > > OPT_INTEGER(0, "graph-depth", &ftrace.graph_depth, "Max depth for function graph tracer"), > OPT_BOOLEAN(0, "sleep-time", &ftrace.sleep_time, "explanation"), > OPT_BOOLEAN(0, "irqs" &ftrace.irqs, "explanation"), > OPT_BOOLEAN(0, "tail" &ftrace.tail, "explanation"), > OPT_BOOLEAN(0, "verbose" &ftrace.verbose, "explanation"), > > We'd have a: > > OPT_CALLBACK(0, "graph-opts", &ftrace, "options", "graph options", parse_graph_opts), > > And parse_graph_opts() would just have a simple strchr(opt, ',') + if > strcmp()/else loop, i.e., it would be easier for users, slightly more > difficult for perf developers :-) > And we also have to parse key-value pairs for 'graph-depth' and move option '--graph-depth' to 'graph-opts'. There is an existing similr option '--debug'. It can be factored out as a general interface. --debug --debug verbose=2,stderr > - Arnaldo -- Cheers, Changbin Du