Skip to contentSkip to conversation

blktrace: Report pid with note messages

PATCH Applied Jan Kara 4 participants 4 messages May 13, 2020 – May 16, 2020

Subsystems (2)
lore
Share & tools
lore

Jan Kara

author
#0 lore raw

PATCH 1/1 blktrace: Report pid with note messages

Currently informational messages within block trace do not have PID information of the process reporting the message included. With BFQ it is sometimes useful to have the information and there's no good reason to omit the information from the trace. So just fill in pid information when generating note message.

---
 kernel/trace/blktrace.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/trace/blktrace.c +2 -2
index ca39dc3230cb..ea47f2084087 100644
@@ -170,10 +170,10 @@ void __trace_note_message(struct blk_trace *bt, struct blkcg *blkcg,
 	if (!(blk_tracer_flags.val & TRACE_BLK_OPT_CGROUP))
 		blkcg = NULL;
 #ifdef CONFIG_BLK_CGROUP
-	trace_note(bt, 0, BLK_TN_MESSAGE, buf, n,
+	trace_note(bt, current->pid, BLK_TN_MESSAGE, buf, n,
 		   blkcg ? cgroup_id(blkcg->css.cgroup) : 1);
 #else
-	trace_note(bt, 0, BLK_TN_MESSAGE, buf, n, 0);
+	trace_note(bt, current->pid, BLK_TN_MESSAGE, buf, n, 0);
 #endif
 	local_irq_restore(flags);
 }
Signature · 1 line
2.16.4
Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines

Il giorno 13 mag 2020, alle ore 18:02, Jan Kara <[email protected]> ha scritto:

Currently informational messages within block trace do not have PID information of the process reporting the message included. With BFQ it is sometimes useful to have the information and there's no good reason to omit the information from the trace. So just fill in pid information when generating note message.

Thank you!
Paolo

Quoted 25 lines

---
kernel/trace/blktrace.c | 4 ++--

1 file changed, 2 insertions(+), 2 deletions(-)
kernel/trace/blktrace.c +2 -2
index ca39dc3230cb..ea47f2084087 100644
@@ -170,10 +170,10 @@ void __trace_note_message(struct blk_trace *bt, struct blkcg *blkcg,
 	if (!(blk_tracer_flags.val & TRACE_BLK_OPT_CGROUP))
 		blkcg = NULL;
 #ifdef CONFIG_BLK_CGROUP
-	trace_note(bt, 0, BLK_TN_MESSAGE, buf, n,
+	trace_note(bt, current->pid, BLK_TN_MESSAGE, buf, n,
 		   blkcg ? cgroup_id(blkcg->css.cgroup) : 1);
 #else
-	trace_note(bt, 0, BLK_TN_MESSAGE, buf, n, 0);
+	trace_note(bt, current->pid, BLK_TN_MESSAGE, buf, n, 0);
 #endif
 	local_irq_restore(flags);
 }
Signature · 1 line
2.16.4
Reviewed-by on v1 1/1
#2 lore raw
In reply to Jan Kara
Quoted 7 lines · Jan Kara

Currently informational messages within block trace do not have PID information of the process reporting the message included. With BFQ it is sometimes useful to have the information and there's no good reason to omit the information from the trace. So just fill in pid information when generating note message.

Looks good.

maintainer Applied
#3 lore raw
In reply to Jan Kara
Quoted 5 lines · Jan Kara

Currently informational messages within block trace do not have PID information of the process reporting the message included. With BFQ it is sometimes useful to have the information and there's no good reason to omit the information from the trace. So just fill in pid information when generating note message.

Applied, thanks.

Signature · 1 line
Jens Axboe