From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753139AbdK3NXM (ORCPT ); Thu, 30 Nov 2017 08:23:12 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:38979 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751125AbdK3NUl (ORCPT ); Thu, 30 Nov 2017 08:20:41 -0500 X-Google-Smtp-Source: AGs4zMZ2tKO/MwlmT8taxqcMbFBdFHNeUXqmGRiFJXWwA9uaa8VxghExOFe5RbuOJtzqbxi//3cqnA== From: "Vladislav Valtchev (VMware)" To: rostedt@goodmis.org Cc: linux-kernel@vger.kernel.org, y.karadz@gmail.com, "Vladislav Valtchev (VMware)" Subject: [PATCH v2 06/10] trace-cmd: Extr. profile-specific code from record_trace Date: Thu, 30 Nov 2017 15:19:53 +0200 Message-Id: <20171130131957.21617-7-vladislav.valtchev@gmail.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171130131957.21617-1-vladislav.valtchev@gmail.com> References: <20171130131957.21617-1-vladislav.valtchev@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch extracts the code in record_trace() under if (IS_PROFILE(ctx)): now that profile has its own function, that code could be moved there after removing the IS_PROFILE(ctx) checks, clearly. Signed-off-by: Vladislav Valtchev (VMware) --- trace-record.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/trace-record.c b/trace-record.c index 6c12416..55e81cf 100644 --- a/trace-record.c +++ b/trace-record.c @@ -4752,13 +4752,6 @@ static void record_trace(int argc, char **argv, { enum trace_type type = 0; - /* - * If this is a profile run, and no instances were set, - * then enable profiling on the top instance. - */ - if (IS_PROFILE(ctx) && !buffer_instances) - top_instance.profile = 1; - /* * If top_instance doesn't have any plugins or events, then * remove it from being processed. @@ -4926,9 +4919,6 @@ static void record_trace(int argc, char **argv, if (host) tracecmd_output_close(network_handle); - - if (IS_PROFILE(ctx)) - do_trace_profile(); } void trace_start(int argc, char **argv) @@ -4971,7 +4961,15 @@ void trace_profile(int argc, char **argv) ctx.events = 1; parse_record_options(argc, argv, &ctx); + + /* + * If no instances were set, then enable profiling on the top instance. + */ + if (!buffer_instances) + top_instance.profile = 1; + record_trace(argc, argv, &ctx); + do_trace_profile(); exit(0); } -- 2.14.1