Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp862680ybk; Wed, 20 May 2020 14:03:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyMWxNxgjprntFBqxAWJyl+RjgWKSbcKIA2gpvuMU+EbKJ1uzU8ogJxn4DcDHp/NfF3WyoZ X-Received: by 2002:aa7:d495:: with SMTP id b21mr5054031edr.16.1590008625188; Wed, 20 May 2020 14:03:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590008625; cv=none; d=google.com; s=arc-20160816; b=pY2L/dlPj9xC8amOfOO49zpdyZYkTpIVHE79qWZhW7yXb9NsZQ/v+t2DaIJo1OXJGO FiHFGNDv8+dWn0uW4EZQLRgI7I+4nTYCxeXQhGSXP2PTWlYp9PUSJ437qxVuf/h+Jzyj HBesYSXMumFlYNiZY5ebCAQkcR3nnDot+63XZwjfdiYrR1T4YViqwo1HeAvdno3ypIAj wjMv2qb/9rKG1vCUfASJr+8BqQ/1Ccn5WZ0GMPnebqKBp+vXwnbkUbOglJfXZmhb/ily 00dnPA6117dqEITc/CsPrw4vjbIvoV6LAukFBQfj0N2jqjgqxmK2IZiAvTFMrIm82x1o m/DA== 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=AsuNzHzPYDqEGH7OTHYnt5y/qAbCooe//HlNF+fSp3U=; b=e/DJIyMuLtcSRSEx7x1ogb3p+8mxwdKo58t3j9YuWfCKSULQq0RMq1kh+3TSpbx/C5 bYUoywmPRCPIoLbjAWz4ruoDPSw6A83ahS/HDVAcdq+249eWPek3fXM3HDsPJQZQfuR8 sMw66ty+FSHUknmNV4g2q1I5bs0/XllrcbmueY1W/jOxn/TrU+mCe1rHC3USPuQGE0Gh QZ29MsoSBRJykovu6dQ1Xy5M+ZANt55pDzlxlLOI/4sznn6mzv/+6zF9LKrUGEKa/H9a qaT4iIYPdKYPL079zNTM9xAW/pvJIASkFtATMjnhKqa3B7rhT6ikbPh7AyBGKp64V0Bj RBSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=LYAwVuR5; 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 ny24si2289768ejb.445.2020.05.20.14.03.22; Wed, 20 May 2020 14:03:45 -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=@kernel.org header.s=default header.b=LYAwVuR5; 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 S1728250AbgETVBJ (ORCPT + 99 others); Wed, 20 May 2020 17:01:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:60036 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727839AbgETVBJ (ORCPT ); Wed, 20 May 2020 17:01:09 -0400 Received: from quaco.ghostprotocols.net (unknown [179.97.37.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6193E2075F; Wed, 20 May 2020 21:01:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590008468; bh=Bek4XvCHt9oUA9k4moA//BF3BkDYpfJWorlc0X4QLEM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LYAwVuR5gOYh1n0atQSB3hViMjvgjYDzoy87rzNhSw1N3ojp+tMMEtyllwVj2bf+s L1OopQQIl2ZYaOUdA76aTi8pcigqsxqwCus3uMzQXlzN87MmZbsMjQbdI3BbwTF25e CLjtZvPMovMns6nMKZ2/pDj3MT3epkoaeNk4ZLqE= Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 94F9B40AFD; Wed, 20 May 2020 18:01:06 -0300 (-03) Date: Wed, 20 May 2020 18:01:06 -0300 From: Arnaldo Carvalho de Melo To: Changbin Du Cc: Jiri Olsa , Peter Zijlstra , Ingo Molnar , Namhyung Kim , Steven Rostedt , linux-kernel@vger.kernel.org Subject: Re: [PATCH 06/19] perf ftrace: add support for trace option sleep-time Message-ID: <20200520210106.GT32678@kernel.org> References: <20200510150628.16610-1-changbin.du@gmail.com> <20200510150628.16610-7-changbin.du@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200510150628.16610-7-changbin.du@gmail.com> X-Url: http://acmel.wordpress.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Sun, May 10, 2020 at 11:06:15PM +0800, Changbin Du escreveu: > This adds an option '--nosleep-time' which allow us only to measure > on-CPU time. This option is function_graph tracer only. This seems, for now, very specific to the function_graph tracer, so perhaps we should have a: --function_graph_opts nosleep-time,other,another,etc ? In time options that have equivalent in other perf tools can be promoted? - Arnaldo > Signed-off-by: Changbin Du > --- > tools/perf/builtin-ftrace.c | 20 ++++++++++++++++++++ > 1 file changed, 20 insertions(+) > > diff --git a/tools/perf/builtin-ftrace.c b/tools/perf/builtin-ftrace.c > index 8133d910d5d8..d3fcf3b0b792 100644 > --- a/tools/perf/builtin-ftrace.c > +++ b/tools/perf/builtin-ftrace.c > @@ -40,6 +40,7 @@ struct perf_ftrace { > struct list_head nograph_funcs; > int graph_depth; > bool func_stack_trace; > + bool nosleep_time; > }; > > struct filter_entry { > @@ -186,6 +187,7 @@ static void reset_tracing_filters(void); > static void reset_tracing_options(struct perf_ftrace *ftrace __maybe_unused) > { > write_tracing_option_file("func_stack_trace", "0"); > + write_tracing_option_file("sleep-time", "1"); > } > > static int reset_tracing_files(struct perf_ftrace *ftrace __maybe_unused) > @@ -345,6 +347,17 @@ static int set_tracing_depth(struct perf_ftrace *ftrace) > return 0; > } > > +static int set_tracing_sleep_time(struct perf_ftrace *ftrace) > +{ > + if (!ftrace->nosleep_time) > + return 0; > + > + if (write_tracing_option_file("sleep-time", "0") < 0) > + return -1; > + > + return 0; > +} > + > static int __cmd_ftrace(struct perf_ftrace *ftrace, int argc, const char **argv) > { > char *trace_file; > @@ -413,6 +426,11 @@ static int __cmd_ftrace(struct perf_ftrace *ftrace, int argc, const char **argv) > goto out_reset; > } > > + if (set_tracing_sleep_time(ftrace) < 0) { > + pr_err("failed to set tracing option sleep-time\n"); > + goto out_reset; > + } > + > if (write_tracing_file("current_tracer", ftrace->tracer) < 0) { > pr_err("failed to set current_tracer to %s\n", ftrace->tracer); > goto out_reset; > @@ -548,6 +566,8 @@ int cmd_ftrace(int argc, const char **argv) > parse_filter_func), > OPT_INTEGER('D', "graph-depth", &ftrace.graph_depth, > "Max depth for function graph tracer"), > + OPT_BOOLEAN(0, "nosleep-time", &ftrace.nosleep_time, > + "Measure on-CPU time only (function_graph only)"), > OPT_END() > }; > > -- > 2.25.1 > -- - Arnaldo