lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20171130131957.21617-7-vladislav.valtchev@gmail.com>
Date:   Thu, 30 Nov 2017 15:19:53 +0200
From:   "Vladislav Valtchev (VMware)" <vladislav.valtchev@...il.com>
To:     rostedt@...dmis.org
Cc:     linux-kernel@...r.kernel.org, y.karadz@...il.com,
        "Vladislav Valtchev (VMware)" <vladislav.valtchev@...il.com>
Subject: [PATCH v2 06/10] trace-cmd: Extr. profile-specific code from record_trace

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) <vladislav.valtchev@...il.com>
---
 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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ