Skip to contentSkip to conversation

ftrace: trigger: Call traceoff trigger after event recorded

PATCH In review Masami Hiramatsu 2 participants 3 messages Sep 8, 2016 – Sep 23, 2016 Tracing

lore
Share & tools
lore

Masami Hiramatsu

author maintainer
#0 lore raw

PATCH 1/1 ftrace: trigger: Call traceoff trigger after event recorded

Call traceoff trigger after the event is recorded. Since current traceoff trigger is called before recording the event, we can not know when the trace is off by what event.

Typical usecase of traceoff/traceon trigger is tracing function calls and trace events between a pair of events. For example, trace function calls between syscall entry/exit. In that case, it is useful if we can see the return code of the target syscall.

---
 kernel/trace/trace_events_trigger.c |    1 +
 1 file changed, 1 insertion(+)
kernel/trace/trace_events_trigger.c +1 -0
index a975571..6721a1e8 100644
@@ -1028,6 +1028,7 @@ static struct event_command trigger_traceon_cmd = {
 static struct event_command trigger_traceoff_cmd = {
 	.name			= "traceoff",
 	.trigger_type		= ETT_TRACE_ONOFF,
+	.flags			= EVENT_CMD_FL_POST_TRIGGER,
 	.func			= event_trigger_callback,
 	.reg			= register_trigger,
 	.unreg			= unregister_trigger,
author maintainer
#1 lore raw

Ping?

Quoted 28 lines · On Fri, 9 Sep 2016 01:05:45 +0900 Masami Hiramatsu <[email protected]> wrote:

Call traceoff trigger after the event is recorded. Since current traceoff trigger is called before recording the event, we can not know when the trace is off by what event.

Typical usecase of traceoff/traceon trigger is tracing function calls and trace events between a pair of events. For example, trace function calls between syscall entry/exit. In that case, it is useful if we can see the return code of the target syscall.

---
 kernel/trace/trace_events_trigger.c |    1 +
 1 file changed, 1 insertion(+)
kernel/trace/trace_events_trigger.c +1 -0
index a975571..6721a1e8 100644
@@ -1028,6 +1028,7 @@ static struct event_command trigger_traceon_cmd = {
 static struct event_command trigger_traceoff_cmd = {
 	.name			= "traceoff",
 	.trigger_type		= ETT_TRACE_ONOFF,
+	.flags			= EVENT_CMD_FL_POST_TRIGGER,
 	.func			= event_trigger_callback,
 	.reg			= register_trigger,
 	.unreg			= unregister_trigger,
Signature · 1 line
Masami Hiramatsu <[email protected]>
maintainer
#2 lore raw
Quoted 1 line · On Fri, 23 Sep 2016 22:11:33 +0900 Masami Hiramatsu <[email protected]> wrote:

Ping?

Thanks for the ping. I've been hacking on other things lately that, even though I marked this as "todo", it has falling in my INBOX abyss.

I'll take a look at this today.

-- Steve

Quoted 34 lines
Quoted 28 lines · On Fri, 9 Sep 2016 01:05:45 +0900 Masami Hiramatsu <[email protected]> wrote:

Call traceoff trigger after the event is recorded. Since current traceoff trigger is called before recording the event, we can not know when the trace is off by what event.

Typical usecase of traceoff/traceon trigger is tracing function calls and trace events between a pair of events. For example, trace function calls between syscall entry/exit. In that case, it is useful if we can see the return code of the target syscall.

---
 kernel/trace/trace_events_trigger.c |    1 +
 1 file changed, 1 insertion(+)
kernel/trace/trace_events_trigger.c +1 -0
index a975571..6721a1e8 100644
@@ -1028,6 +1028,7 @@ static struct event_command trigger_traceon_cmd = {
 static struct event_command trigger_traceoff_cmd = {
 	.name			= "traceoff",
 	.trigger_type		= ETT_TRACE_ONOFF,
+	.flags			= EVENT_CMD_FL_POST_TRIGGER,
 	.func			= event_trigger_callback,
 	.reg			= register_trigger,
 	.unreg			= unregister_trigger,