All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/2] tracing: make tracer_init_tracefs initcall asynchronous
@ 2022-04-26 12:24 ` Mark-PK Tsai
  0 siblings, 0 replies; 9+ messages in thread
From: Mark-PK Tsai @ 2022-04-26 12:24 UTC (permalink / raw)
  To: rostedt
  Cc: linux-arm-kernel, linux-kernel, linux-mediatek, mark-pk.tsai,
	matthias.bgg, mingo, yj.chiang

Move trace_eval_init() to subsys_initcall to make it start
earlier.
And to avoid tracer_init_tracefs being blocked by
trace_event_sem which trace_eval_init() hold [1],
queue tracer_init_tracefs() to eval_map_wq to let
the two works being executed sequentially.

It can speed up the initialization of kernel as result
of making tracer_init_tracefs asynchronous.

On my arm64 platform, it reduce ~20ms of 125ms which total
time do_initcalls spend.

Changes in v2:
- Fix the use of ftrace_eval_maps in INIT_DATA after initmem_free().

  In v1, a kthread is create for tracer_init_tracefs() which
  might cause kernel crash if initmem is free before it finish.
  In v2, the work of tracer_init_tracefs() is separated into 2 parts,
  one is put to subsys_initcall and the other is queue to eval_map_wq
  which can make sure it always finish before initmem is free.

Changes in v3:
- Avoid adding tracer option before __update_tracer_options finish to fix
  the warning report by kernel test robot.

Reported-by: kernel test robot <oliver.sang@intel.com>
  https://lore.kernel.org/lkml/20220322133339.GA32582@xsang-OptiPlex-9020/

Changes in v4:
- Set `tracer_options_updated = true` before calling __update_tracer_options().
  Otherwise, __update_tracer_options() will skip all the tracer in trace_array.
- Init tracerfs_init_work only when eval_map_wq is successfully created.

Mark-PK Tsai (2):
  tracing: Avoid adding tracer option before update_tracer_options
  tracing: make tracer_init_tracefs initcall asynchronous

 kernel/trace/trace.c | 39 +++++++++++++++++++++++++++++----------
 1 file changed, 29 insertions(+), 10 deletions(-)

-- 
2.18.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v4 0/2] tracing: make tracer_init_tracefs initcall asynchronous
@ 2022-04-26 12:24 ` Mark-PK Tsai
  0 siblings, 0 replies; 9+ messages in thread
From: Mark-PK Tsai @ 2022-04-26 12:24 UTC (permalink / raw)
  To: rostedt
  Cc: linux-arm-kernel, linux-kernel, linux-mediatek, mark-pk.tsai,
	matthias.bgg, mingo, yj.chiang

Move trace_eval_init() to subsys_initcall to make it start
earlier.
And to avoid tracer_init_tracefs being blocked by
trace_event_sem which trace_eval_init() hold [1],
queue tracer_init_tracefs() to eval_map_wq to let
the two works being executed sequentially.

It can speed up the initialization of kernel as result
of making tracer_init_tracefs asynchronous.

On my arm64 platform, it reduce ~20ms of 125ms which total
time do_initcalls spend.

Changes in v2:
- Fix the use of ftrace_eval_maps in INIT_DATA after initmem_free().

  In v1, a kthread is create for tracer_init_tracefs() which
  might cause kernel crash if initmem is free before it finish.
  In v2, the work of tracer_init_tracefs() is separated into 2 parts,
  one is put to subsys_initcall and the other is queue to eval_map_wq
  which can make sure it always finish before initmem is free.

Changes in v3:
- Avoid adding tracer option before __update_tracer_options finish to fix
  the warning report by kernel test robot.

Reported-by: kernel test robot <oliver.sang@intel.com>
  https://lore.kernel.org/lkml/20220322133339.GA32582@xsang-OptiPlex-9020/

Changes in v4:
- Set `tracer_options_updated = true` before calling __update_tracer_options().
  Otherwise, __update_tracer_options() will skip all the tracer in trace_array.
- Init tracerfs_init_work only when eval_map_wq is successfully created.

Mark-PK Tsai (2):
  tracing: Avoid adding tracer option before update_tracer_options
  tracing: make tracer_init_tracefs initcall asynchronous

 kernel/trace/trace.c | 39 +++++++++++++++++++++++++++++----------
 1 file changed, 29 insertions(+), 10 deletions(-)

-- 
2.18.0


_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v4 0/2] tracing: make tracer_init_tracefs initcall asynchronous
@ 2022-04-26 12:24 ` Mark-PK Tsai
  0 siblings, 0 replies; 9+ messages in thread
From: Mark-PK Tsai @ 2022-04-26 12:24 UTC (permalink / raw)
  To: rostedt
  Cc: linux-arm-kernel, linux-kernel, linux-mediatek, mark-pk.tsai,
	matthias.bgg, mingo, yj.chiang

Move trace_eval_init() to subsys_initcall to make it start
earlier.
And to avoid tracer_init_tracefs being blocked by
trace_event_sem which trace_eval_init() hold [1],
queue tracer_init_tracefs() to eval_map_wq to let
the two works being executed sequentially.

It can speed up the initialization of kernel as result
of making tracer_init_tracefs asynchronous.

On my arm64 platform, it reduce ~20ms of 125ms which total
time do_initcalls spend.

Changes in v2:
- Fix the use of ftrace_eval_maps in INIT_DATA after initmem_free().

  In v1, a kthread is create for tracer_init_tracefs() which
  might cause kernel crash if initmem is free before it finish.
  In v2, the work of tracer_init_tracefs() is separated into 2 parts,
  one is put to subsys_initcall and the other is queue to eval_map_wq
  which can make sure it always finish before initmem is free.

Changes in v3:
- Avoid adding tracer option before __update_tracer_options finish to fix
  the warning report by kernel test robot.

Reported-by: kernel test robot <oliver.sang@intel.com>
  https://lore.kernel.org/lkml/20220322133339.GA32582@xsang-OptiPlex-9020/

Changes in v4:
- Set `tracer_options_updated = true` before calling __update_tracer_options().
  Otherwise, __update_tracer_options() will skip all the tracer in trace_array.
- Init tracerfs_init_work only when eval_map_wq is successfully created.

Mark-PK Tsai (2):
  tracing: Avoid adding tracer option before update_tracer_options
  tracing: make tracer_init_tracefs initcall asynchronous

 kernel/trace/trace.c | 39 +++++++++++++++++++++++++++++----------
 1 file changed, 29 insertions(+), 10 deletions(-)

-- 
2.18.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v4 1/2] tracing: Avoid adding tracer option before update_tracer_options
  2022-04-26 12:24 ` Mark-PK Tsai
  (?)
@ 2022-04-26 12:24   ` Mark-PK Tsai
  -1 siblings, 0 replies; 9+ messages in thread
From: Mark-PK Tsai @ 2022-04-26 12:24 UTC (permalink / raw)
  To: rostedt
  Cc: linux-arm-kernel, linux-kernel, linux-mediatek, mark-pk.tsai,
	matthias.bgg, mingo, yj.chiang

To prepare for support asynchronous tracer_init_tracefs initcall,
avoid calling create_trace_option_files before __update_tracer_options.
Otherwise, create_trace_option_files will show warning because
some tracers in trace_types list are already in tr->topts.

For example, hwlat_tracer call register_tracer in late_initcall,
and global_trace.dir is already created in tracing_init_dentry,
hwlat_tracer will be put into tr->topts.
Then if the __update_tracer_options is executed after hwlat_tracer
registered, create_trace_option_files find that hwlat_tracer is
already in tr->topts.

Link: https://lore.kernel.org/lkml/20220322133339.GA32582@xsang-OptiPlex-9020/
Reported-by: kernel test robot <oliver.sang@intel.com>
Signed-off-by: Mark-PK Tsai <mark-pk.tsai@mediatek.com>
---
 kernel/trace/trace.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index f4de111fa18f..0ec7b013104a 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -6332,12 +6332,18 @@ static void tracing_set_nop(struct trace_array *tr)
 	tr->current_trace = &nop_trace;
 }
 
+static bool tracer_options_updated;
+
 static void add_tracer_options(struct trace_array *tr, struct tracer *t)
 {
 	/* Only enable if the directory has been created already. */
 	if (!tr->dir)
 		return;
 
+	/* Only create trace option files after update_tracer_options finish */
+	if (!tracer_options_updated)
+		return;
+
 	create_trace_option_files(tr, t);
 }
 
@@ -9176,6 +9182,7 @@ static void __update_tracer_options(struct trace_array *tr)
 static void update_tracer_options(struct trace_array *tr)
 {
 	mutex_lock(&trace_types_lock);
+	tracer_options_updated = true;
 	__update_tracer_options(tr);
 	mutex_unlock(&trace_types_lock);
 }
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v4 1/2] tracing: Avoid adding tracer option before update_tracer_options
@ 2022-04-26 12:24   ` Mark-PK Tsai
  0 siblings, 0 replies; 9+ messages in thread
From: Mark-PK Tsai @ 2022-04-26 12:24 UTC (permalink / raw)
  To: rostedt
  Cc: linux-arm-kernel, linux-kernel, linux-mediatek, mark-pk.tsai,
	matthias.bgg, mingo, yj.chiang

To prepare for support asynchronous tracer_init_tracefs initcall,
avoid calling create_trace_option_files before __update_tracer_options.
Otherwise, create_trace_option_files will show warning because
some tracers in trace_types list are already in tr->topts.

For example, hwlat_tracer call register_tracer in late_initcall,
and global_trace.dir is already created in tracing_init_dentry,
hwlat_tracer will be put into tr->topts.
Then if the __update_tracer_options is executed after hwlat_tracer
registered, create_trace_option_files find that hwlat_tracer is
already in tr->topts.

Link: https://lore.kernel.org/lkml/20220322133339.GA32582@xsang-OptiPlex-9020/
Reported-by: kernel test robot <oliver.sang@intel.com>
Signed-off-by: Mark-PK Tsai <mark-pk.tsai@mediatek.com>
---
 kernel/trace/trace.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index f4de111fa18f..0ec7b013104a 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -6332,12 +6332,18 @@ static void tracing_set_nop(struct trace_array *tr)
 	tr->current_trace = &nop_trace;
 }
 
+static bool tracer_options_updated;
+
 static void add_tracer_options(struct trace_array *tr, struct tracer *t)
 {
 	/* Only enable if the directory has been created already. */
 	if (!tr->dir)
 		return;
 
+	/* Only create trace option files after update_tracer_options finish */
+	if (!tracer_options_updated)
+		return;
+
 	create_trace_option_files(tr, t);
 }
 
@@ -9176,6 +9182,7 @@ static void __update_tracer_options(struct trace_array *tr)
 static void update_tracer_options(struct trace_array *tr)
 {
 	mutex_lock(&trace_types_lock);
+	tracer_options_updated = true;
 	__update_tracer_options(tr);
 	mutex_unlock(&trace_types_lock);
 }
-- 
2.18.0


_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v4 1/2] tracing: Avoid adding tracer option before update_tracer_options
@ 2022-04-26 12:24   ` Mark-PK Tsai
  0 siblings, 0 replies; 9+ messages in thread
From: Mark-PK Tsai @ 2022-04-26 12:24 UTC (permalink / raw)
  To: rostedt
  Cc: linux-arm-kernel, linux-kernel, linux-mediatek, mark-pk.tsai,
	matthias.bgg, mingo, yj.chiang

To prepare for support asynchronous tracer_init_tracefs initcall,
avoid calling create_trace_option_files before __update_tracer_options.
Otherwise, create_trace_option_files will show warning because
some tracers in trace_types list are already in tr->topts.

For example, hwlat_tracer call register_tracer in late_initcall,
and global_trace.dir is already created in tracing_init_dentry,
hwlat_tracer will be put into tr->topts.
Then if the __update_tracer_options is executed after hwlat_tracer
registered, create_trace_option_files find that hwlat_tracer is
already in tr->topts.

Link: https://lore.kernel.org/lkml/20220322133339.GA32582@xsang-OptiPlex-9020/
Reported-by: kernel test robot <oliver.sang@intel.com>
Signed-off-by: Mark-PK Tsai <mark-pk.tsai@mediatek.com>
---
 kernel/trace/trace.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index f4de111fa18f..0ec7b013104a 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -6332,12 +6332,18 @@ static void tracing_set_nop(struct trace_array *tr)
 	tr->current_trace = &nop_trace;
 }
 
+static bool tracer_options_updated;
+
 static void add_tracer_options(struct trace_array *tr, struct tracer *t)
 {
 	/* Only enable if the directory has been created already. */
 	if (!tr->dir)
 		return;
 
+	/* Only create trace option files after update_tracer_options finish */
+	if (!tracer_options_updated)
+		return;
+
 	create_trace_option_files(tr, t);
 }
 
@@ -9176,6 +9182,7 @@ static void __update_tracer_options(struct trace_array *tr)
 static void update_tracer_options(struct trace_array *tr)
 {
 	mutex_lock(&trace_types_lock);
+	tracer_options_updated = true;
 	__update_tracer_options(tr);
 	mutex_unlock(&trace_types_lock);
 }
-- 
2.18.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v4 2/2] tracing: make tracer_init_tracefs initcall asynchronous
  2022-04-26 12:24 ` Mark-PK Tsai
  (?)
@ 2022-04-26 12:24   ` Mark-PK Tsai
  -1 siblings, 0 replies; 9+ messages in thread
From: Mark-PK Tsai @ 2022-04-26 12:24 UTC (permalink / raw)
  To: rostedt
  Cc: linux-arm-kernel, linux-kernel, linux-mediatek, mark-pk.tsai,
	matthias.bgg, mingo, yj.chiang

Move trace_eval_init() to subsys_initcall to make it start
earlier.
And to avoid tracer_init_tracefs being blocked by
trace_event_sem which trace_eval_init() hold [1],
queue tracer_init_tracefs() to eval_map_wq to let
the two works being executed sequentially.

It can speed up the initialization of kernel as result
of making tracer_init_tracefs asynchronous.

On my arm64 platform, it reduce ~20ms of 125ms which total
time do_initcalls spend.

[1]: https://lore.kernel.org/r/68d7b3327052757d0cd6359a6c9015a85b437232.camel@pengutronix.de
Signed-off-by: Mark-PK Tsai <mark-pk.tsai@mediatek.com>
---
 kernel/trace/trace.c | 32 ++++++++++++++++++++++----------
 1 file changed, 22 insertions(+), 10 deletions(-)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 0ec7b013104a..7f6ad8f06129 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -9615,6 +9615,7 @@ extern struct trace_eval_map *__stop_ftrace_eval_maps[];
 
 static struct workqueue_struct *eval_map_wq __initdata;
 static struct work_struct eval_map_work __initdata;
+static struct work_struct tracerfs_init_work __initdata;
 
 static void __init eval_map_work_func(struct work_struct *work)
 {
@@ -9640,6 +9641,8 @@ static int __init trace_eval_init(void)
 	return 0;
 }
 
+subsys_initcall(trace_eval_init);
+
 static int __init trace_eval_sync(void)
 {
 	/* Make sure the eval map updates are finished */
@@ -9722,15 +9725,8 @@ static struct notifier_block trace_module_nb = {
 };
 #endif /* CONFIG_MODULES */
 
-static __init int tracer_init_tracefs(void)
+static __init void tracer_init_tracefs_work_func(struct work_struct *work)
 {
-	int ret;
-
-	trace_access_lock_init();
-
-	ret = tracing_init_dentry();
-	if (ret)
-		return 0;
 
 	event_trace_init();
 
@@ -9752,8 +9748,6 @@ static __init int tracer_init_tracefs(void)
 	trace_create_file("saved_tgids", TRACE_MODE_READ, NULL,
 			NULL, &tracing_saved_tgids_fops);
 
-	trace_eval_init();
-
 	trace_create_eval_file(NULL);
 
 #ifdef CONFIG_MODULES
@@ -9768,6 +9762,24 @@ static __init int tracer_init_tracefs(void)
 	create_trace_instances(NULL);
 
 	update_tracer_options(&global_trace);
+}
+
+static __init int tracer_init_tracefs(void)
+{
+	int ret;
+
+	trace_access_lock_init();
+
+	ret = tracing_init_dentry();
+	if (ret)
+		return 0;
+
+	if (eval_map_wq) {
+		INIT_WORK(&tracerfs_init_work, tracer_init_tracefs_work_func);
+		queue_work(eval_map_wq, &tracerfs_init_work);
+	} else {
+		tracer_init_tracefs_work_func(NULL);
+	}
 
 	return 0;
 }
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v4 2/2] tracing: make tracer_init_tracefs initcall asynchronous
@ 2022-04-26 12:24   ` Mark-PK Tsai
  0 siblings, 0 replies; 9+ messages in thread
From: Mark-PK Tsai @ 2022-04-26 12:24 UTC (permalink / raw)
  To: rostedt
  Cc: linux-arm-kernel, linux-kernel, linux-mediatek, mark-pk.tsai,
	matthias.bgg, mingo, yj.chiang

Move trace_eval_init() to subsys_initcall to make it start
earlier.
And to avoid tracer_init_tracefs being blocked by
trace_event_sem which trace_eval_init() hold [1],
queue tracer_init_tracefs() to eval_map_wq to let
the two works being executed sequentially.

It can speed up the initialization of kernel as result
of making tracer_init_tracefs asynchronous.

On my arm64 platform, it reduce ~20ms of 125ms which total
time do_initcalls spend.

[1]: https://lore.kernel.org/r/68d7b3327052757d0cd6359a6c9015a85b437232.camel@pengutronix.de
Signed-off-by: Mark-PK Tsai <mark-pk.tsai@mediatek.com>
---
 kernel/trace/trace.c | 32 ++++++++++++++++++++++----------
 1 file changed, 22 insertions(+), 10 deletions(-)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 0ec7b013104a..7f6ad8f06129 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -9615,6 +9615,7 @@ extern struct trace_eval_map *__stop_ftrace_eval_maps[];
 
 static struct workqueue_struct *eval_map_wq __initdata;
 static struct work_struct eval_map_work __initdata;
+static struct work_struct tracerfs_init_work __initdata;
 
 static void __init eval_map_work_func(struct work_struct *work)
 {
@@ -9640,6 +9641,8 @@ static int __init trace_eval_init(void)
 	return 0;
 }
 
+subsys_initcall(trace_eval_init);
+
 static int __init trace_eval_sync(void)
 {
 	/* Make sure the eval map updates are finished */
@@ -9722,15 +9725,8 @@ static struct notifier_block trace_module_nb = {
 };
 #endif /* CONFIG_MODULES */
 
-static __init int tracer_init_tracefs(void)
+static __init void tracer_init_tracefs_work_func(struct work_struct *work)
 {
-	int ret;
-
-	trace_access_lock_init();
-
-	ret = tracing_init_dentry();
-	if (ret)
-		return 0;
 
 	event_trace_init();
 
@@ -9752,8 +9748,6 @@ static __init int tracer_init_tracefs(void)
 	trace_create_file("saved_tgids", TRACE_MODE_READ, NULL,
 			NULL, &tracing_saved_tgids_fops);
 
-	trace_eval_init();
-
 	trace_create_eval_file(NULL);
 
 #ifdef CONFIG_MODULES
@@ -9768,6 +9762,24 @@ static __init int tracer_init_tracefs(void)
 	create_trace_instances(NULL);
 
 	update_tracer_options(&global_trace);
+}
+
+static __init int tracer_init_tracefs(void)
+{
+	int ret;
+
+	trace_access_lock_init();
+
+	ret = tracing_init_dentry();
+	if (ret)
+		return 0;
+
+	if (eval_map_wq) {
+		INIT_WORK(&tracerfs_init_work, tracer_init_tracefs_work_func);
+		queue_work(eval_map_wq, &tracerfs_init_work);
+	} else {
+		tracer_init_tracefs_work_func(NULL);
+	}
 
 	return 0;
 }
-- 
2.18.0


_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v4 2/2] tracing: make tracer_init_tracefs initcall asynchronous
@ 2022-04-26 12:24   ` Mark-PK Tsai
  0 siblings, 0 replies; 9+ messages in thread
From: Mark-PK Tsai @ 2022-04-26 12:24 UTC (permalink / raw)
  To: rostedt
  Cc: linux-arm-kernel, linux-kernel, linux-mediatek, mark-pk.tsai,
	matthias.bgg, mingo, yj.chiang

Move trace_eval_init() to subsys_initcall to make it start
earlier.
And to avoid tracer_init_tracefs being blocked by
trace_event_sem which trace_eval_init() hold [1],
queue tracer_init_tracefs() to eval_map_wq to let
the two works being executed sequentially.

It can speed up the initialization of kernel as result
of making tracer_init_tracefs asynchronous.

On my arm64 platform, it reduce ~20ms of 125ms which total
time do_initcalls spend.

[1]: https://lore.kernel.org/r/68d7b3327052757d0cd6359a6c9015a85b437232.camel@pengutronix.de
Signed-off-by: Mark-PK Tsai <mark-pk.tsai@mediatek.com>
---
 kernel/trace/trace.c | 32 ++++++++++++++++++++++----------
 1 file changed, 22 insertions(+), 10 deletions(-)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 0ec7b013104a..7f6ad8f06129 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -9615,6 +9615,7 @@ extern struct trace_eval_map *__stop_ftrace_eval_maps[];
 
 static struct workqueue_struct *eval_map_wq __initdata;
 static struct work_struct eval_map_work __initdata;
+static struct work_struct tracerfs_init_work __initdata;
 
 static void __init eval_map_work_func(struct work_struct *work)
 {
@@ -9640,6 +9641,8 @@ static int __init trace_eval_init(void)
 	return 0;
 }
 
+subsys_initcall(trace_eval_init);
+
 static int __init trace_eval_sync(void)
 {
 	/* Make sure the eval map updates are finished */
@@ -9722,15 +9725,8 @@ static struct notifier_block trace_module_nb = {
 };
 #endif /* CONFIG_MODULES */
 
-static __init int tracer_init_tracefs(void)
+static __init void tracer_init_tracefs_work_func(struct work_struct *work)
 {
-	int ret;
-
-	trace_access_lock_init();
-
-	ret = tracing_init_dentry();
-	if (ret)
-		return 0;
 
 	event_trace_init();
 
@@ -9752,8 +9748,6 @@ static __init int tracer_init_tracefs(void)
 	trace_create_file("saved_tgids", TRACE_MODE_READ, NULL,
 			NULL, &tracing_saved_tgids_fops);
 
-	trace_eval_init();
-
 	trace_create_eval_file(NULL);
 
 #ifdef CONFIG_MODULES
@@ -9768,6 +9762,24 @@ static __init int tracer_init_tracefs(void)
 	create_trace_instances(NULL);
 
 	update_tracer_options(&global_trace);
+}
+
+static __init int tracer_init_tracefs(void)
+{
+	int ret;
+
+	trace_access_lock_init();
+
+	ret = tracing_init_dentry();
+	if (ret)
+		return 0;
+
+	if (eval_map_wq) {
+		INIT_WORK(&tracerfs_init_work, tracer_init_tracefs_work_func);
+		queue_work(eval_map_wq, &tracerfs_init_work);
+	} else {
+		tracer_init_tracefs_work_func(NULL);
+	}
 
 	return 0;
 }
-- 
2.18.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-04-26 12:25 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-26 12:24 [PATCH v4 0/2] tracing: make tracer_init_tracefs initcall asynchronous Mark-PK Tsai
2022-04-26 12:24 ` Mark-PK Tsai
2022-04-26 12:24 ` Mark-PK Tsai
2022-04-26 12:24 ` [PATCH v4 1/2] tracing: Avoid adding tracer option before update_tracer_options Mark-PK Tsai
2022-04-26 12:24   ` Mark-PK Tsai
2022-04-26 12:24   ` Mark-PK Tsai
2022-04-26 12:24 ` [PATCH v4 2/2] tracing: make tracer_init_tracefs initcall asynchronous Mark-PK Tsai
2022-04-26 12:24   ` Mark-PK Tsai
2022-04-26 12:24   ` Mark-PK Tsai

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.