All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Peter Zijlstra <peterz@infradead.org>,
	"Joel Fernandes (Google)" <joel.opensrc@gmail.com>,
	Ingo Molnar <mingo@redhat.com>,
	Abderrahmane Benbachir <abderrahmane.benbachir@polymtl.ca>
Subject: [PATCH 2/4 v2] init, tracing: instrument security and console initcall trace events
Date: Fri, 06 Apr 2018 15:08:56 -0400	[thread overview]
Message-ID: <20180406191334.208560595@goodmis.org> (raw)
In-Reply-To: 20180406190854.875810797@goodmis.org

[-- Attachment #1: 0002-init-tracing-instrument-security-and-console-initcal.patch --]
[-- Type: text/plain, Size: 2272 bytes --]

From: Abderrahmane Benbachir <abderrahmane.benbachir@polymtl.ca>

Trace events have been added around the initcall functions defined in
init/main.c. But console and security have their own initcalls. This adds
the trace events associated for those initcall functions.

Link: http://lkml.kernel.org/r/1521765208.19745.2.camel@polymtl.ca

Cc: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Abderrahmane Benbachir <abderrahmane.benbachir@polymtl.ca>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 kernel/printk/printk.c | 7 ++++++-
 security/security.c    | 8 +++++++-
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index f274fbef821d..cb5b35341d69 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -52,6 +52,7 @@
 #include <linux/uaccess.h>
 #include <asm/sections.h>
 
+#include <trace/events/initcall.h>
 #define CREATE_TRACE_POINTS
 #include <trace/events/printk.h>
 
@@ -2781,6 +2782,7 @@ EXPORT_SYMBOL(unregister_console);
  */
 void __init console_init(void)
 {
+	int ret;
 	initcall_t *call;
 
 	/* Setup the default TTY line discipline. */
@@ -2791,8 +2793,11 @@ void __init console_init(void)
 	 * inform about problems etc..
 	 */
 	call = __con_initcall_start;
+	trace_initcall_level("console");
 	while (call < __con_initcall_end) {
-		(*call)();
+		trace_initcall_start((*call));
+		ret = (*call)();
+		trace_initcall_finish((*call), ret);
 		call++;
 	}
 }
diff --git a/security/security.c b/security/security.c
index 1cd8526cb0b7..987afe3d464c 100644
--- a/security/security.c
+++ b/security/security.c
@@ -30,6 +30,8 @@
 #include <linux/string.h>
 #include <net/flow.h>
 
+#include <trace/events/initcall.h>
+
 #define MAX_LSM_EVM_XATTR	2
 
 /* Maximum number of letters for an LSM name string */
@@ -45,10 +47,14 @@ static __initdata char chosen_lsm[SECURITY_NAME_MAX + 1] =
 
 static void __init do_security_initcalls(void)
 {
+	int ret;
 	initcall_t *call;
 	call = __security_initcall_start;
+	trace_initcall_level("security");
 	while (call < __security_initcall_end) {
-		(*call) ();
+		trace_initcall_start((*call));
+		ret = (*call) ();
+		trace_initcall_finish((*call), ret);
 		call++;
 	}
 }
-- 
2.15.1

  parent reply	other threads:[~2018-04-06 19:13 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-06 19:08 [PATCH 0/4 v2] init, tracing: Steven Rostedt
2018-04-06 19:08 ` [PATCH 1/4 v2] init, tracing: Add initcall trace events Steven Rostedt
2018-04-06 19:08 ` Steven Rostedt [this message]
2018-04-06 19:08 ` [PATCH 3/4 v2] init, tracing: Have printk come through the trace events for initcall_debug Steven Rostedt
2018-04-09  5:32   ` [lkp-robot] [init, tracing] 2580d6b795: BUG:kernel_reboot-without-warning_in_boot_stage kernel test robot
2018-04-09  5:32     ` kernel test robot
2018-04-09 22:04     ` Steven Rostedt
2018-04-09 22:04       ` Steven Rostedt
2018-04-10  1:23       ` Ye Xiaolong
2018-04-10  1:23         ` Ye Xiaolong
2018-04-10  2:41         ` Steven Rostedt
2018-04-10  2:41           ` Steven Rostedt
2018-04-10  3:14           ` Ye Xiaolong
2018-04-10  3:14             ` Ye Xiaolong
2018-04-06 19:08 ` [PATCH 4/4 v2] init: Have initcall_debug still work without CONFIG_TRACEPOINTS Steven Rostedt
2018-04-07  8:18   ` kbuild test robot
2018-04-06 19:16 ` [PATCH 0/4 v2] init, tracing: Add initcall trace events Steven Rostedt
2018-04-06 19:19 ` Steven Rostedt
2018-04-06 19:34   ` Peter Zijlstra
2018-04-06 19:46     ` Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180406191334.208560595@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=abderrahmane.benbachir@polymtl.ca \
    --cc=akpm@linux-foundation.org \
    --cc=fweisbec@gmail.com \
    --cc=joel.opensrc@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.