Skip to contentSkip to conversation

softirq: Print the function name

PATCH In review Enlin Mu 3 participants 5 messages Jan 5 – Jan 20

lore
Share & tools
lore

Enlin Mu

author
#0 lore raw

PATCH 1/1 softirq: Print the function name

Adjust the printing format from the function address to the function name.

---
 kernel/softirq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/softirq.c +1 -1
index 77198911b8dd..68ef18616fb9 100644
@@ -622,7 +622,7 @@ static void handle_softirqs(bool ksirqd)
 		h->action();
 		trace_softirq_exit(vec_nr);
 		if (unlikely(prev_count != preempt_count())) {
-			pr_err("huh, entered softirq %u %s %p with preempt_count %08x, exited with %08x?\n",
+			pr_err("huh, entered softirq %u %s %pS with preempt_count %08x, exited with %08x?\n",
 			       vec_nr, softirq_to_name[vec_nr], h->action,
 			       prev_count, preempt_count());
 			preempt_count_set(prev_count);
Signature · 1 line
2.39.5
author
#1 lore raw
Quoted 14 lines · Enlin Mu

Adjust the printing format from the function address to the function name.

---
  kernel/softirq.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
kernel/softirq.c +0 -0
index 77198911b8dd..68ef18616fb9 100644

kernel/softirq.c static void handle_softirqs(bool ksirqd) · line 627

Quoted 7 lines
kernel/softirq.c +1 -1
@@ -622,7 +622,7 @@ static void handle_softirqs(bool ksirqd)
  		h->action();
  		trace_softirq_exit(vec_nr);
  		if (unlikely(prev_count != preempt_count())) {
-			pr_err("huh, entered softirq %u %s %p with preempt_count %08x, exited with %08x?\n",
+			pr_err("huh, entered softirq %u %s %pS with preempt_count %08x, exited with %08x?\n",
  			       vec_nr, softirq_to_name[vec_nr], h->action,
  			       prev_count, preempt_count());

Hi All

My test results are as follows:

before this patch:

[   49.919574] softirq: huh, entered softirq 1 TIMER 00000000bb45ef3a with preempt_count 00000101, exited with 00000101?

after this patch:

[   49.919570] softirq: huh, entered softirq 1 TIMER run_timer_softirq+0x0/0x108 with preempt_count 00000101, exited with 00000102?
Quoted 1 line
kernel/softirq.c +0 -0
  			preempt_count_set(prev_count);
#2 lore raw
Quoted 30 lines · enlin.mu
Quoted 14 lines · Enlin Mu

Adjust the printing format from the function address to the function name.

---
  kernel/softirq.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
kernel/softirq.c +0 -0
index 77198911b8dd..68ef18616fb9 100644

kernel/softirq.c static void handle_softirqs(bool ksirqd) · line 627

Quoted 7 lines
kernel/softirq.c +1 -1
@@ -622,7 +622,7 @@ static void handle_softirqs(bool ksirqd)
  		h->action();
  		trace_softirq_exit(vec_nr);
  		if (unlikely(prev_count != preempt_count())) {
-			pr_err("huh, entered softirq %u %s %p with preempt_count %08x, exited with %08x?\n",
+			pr_err("huh, entered softirq %u %s %pS with preempt_count %08x, exited with %08x?\n",
  			       vec_nr, softirq_to_name[vec_nr], h->action,
  			       prev_count, preempt_count());

Hi All

My test results are as follows:

before this patch:

[   49.919574] softirq: huh, entered softirq 1 TIMER 00000000bb45ef3a 
Quoted 8 lines

with preempt_count 00000101, exited with 00000101?

after this patch:

[   49.919570] softirq: huh, entered softirq 1 TIMER 

run_timer_softirq+0x0/0x108 with preempt_count 00000101, exited with 00000102?

The TIMER softirq always invoked run_timer_softirq(). If that happens then the interesting question is not the softirq action handler, but any function it invoked from there. So there is _zero_ value of adding this.

Thanks,

tglx

#3 lore raw
Quoted 4 lines · Thomas Gleixner
Quoted 3 lines · enlin.mu
Quoted 2 lines · Enlin Mu

Adjust the printing format from the function address to the function name.

…

Quoted 3 lines

The TIMER softirq always invoked run_timer_softirq(). If that happens then the interesting question is not the softirq action handler, but any function it invoked from there. So there is _zero_ value of adding this.

Removing h->action from the print would be an improvement.

Quoted 3 lines

Thanks,

tglx

Sebastian

author
#4 lore raw
Quoted 12 lines · Sebastian Andrzej Siewior
Quoted 4 lines · Thomas Gleixner
Quoted 3 lines · enlin.mu
Quoted 2 lines · Enlin Mu

Adjust the printing format from the function address to the function name.

…

Quoted 3 lines

The TIMER softirq always invoked run_timer_softirq(). If that happens then the interesting question is not the softirq action handler, but any function it invoked from there. So there is _zero_ value of adding this.

Removing h->action from the print would be an improvement.

If everyone agrees, I'll resubmit a patch.

Quoted 5 lines
Quoted 3 lines

Thanks,

tglx

Sebastian