--- zzzz-none-000/linux-4.19.183/kernel/softirq.c 2021-03-24 10:07:39.000000000 +0000 +++ bcm63-7530ax-756/linux-4.19.183/kernel/softirq.c 2023-06-28 08:54:21.000000000 +0000 @@ -26,10 +26,16 @@ #include #include #include +#include +#include #define CREATE_TRACE_POINTS #include +#if defined(CONFIG_BCM_KF_BUZZZ) && defined(CONFIG_BUZZZ_KEVT) +#include +#endif + /* - No shared variables, all the data are CPU local. - If a softirq needs serialization, let it serialize itself @@ -268,6 +274,7 @@ __local_bh_disable_ip(_RET_IP_, SOFTIRQ_OFFSET); in_hardirq = lockdep_softirq_start(); + avm_sum_softirq_enter(); restart: /* Reset the pending bitmask before enabling irqs */ @@ -278,6 +285,7 @@ h = softirq_vec; while ((softirq_bit = ffs(pending))) { + struct _runtime_stat *pts; unsigned int vec_nr; int prev_count; @@ -288,9 +296,21 @@ kstat_incr_softirqs_this_cpu(vec_nr); + avm_simple_profiling_log(avm_profile_data_type_sw_irq_begin, + (unsigned long)(h->action), (unsigned int)h); trace_softirq_entry(vec_nr); + pts = avm_softirq_enter(vec_nr); +#if defined(CONFIG_BCM_KF_BUZZZ) && defined(CONFIG_BUZZZ_KEVT) + BUZZZ_KNL3(SIRQ_ENT, 0, h->action); +#endif h->action(h); +#if defined(CONFIG_BCM_KF_BUZZZ) && defined(CONFIG_BUZZZ_KEVT) + BUZZZ_KNL3(SIRQ_EXT, 0, h->action); +#endif + avm_softirq_leave(pts); trace_softirq_exit(vec_nr); + avm_simple_profiling_log(avm_profile_data_type_sw_irq_end, + (unsigned long)(h->action), (unsigned int)h); if (unlikely(prev_count != preempt_count())) { pr_err("huh, entered softirq %u %s %p with preempt_count %08x, exited with %08x?\n", vec_nr, softirq_to_name[vec_nr], h->action, @@ -313,6 +333,7 @@ wakeup_softirqd(); } + avm_sum_softirq_leave(); lockdep_softirq_end(in_hardirq); account_irq_exit_time(current); __local_bh_enable(SOFTIRQ_OFFSET); @@ -479,6 +500,8 @@ t->next = NULL; *head->tail = t; head->tail = &(t->next); + avm_simple_profiling_log(avm_profile_data_type_trigger_tasklet_begin, + (unsigned long)(t->func), softirq_nr); raise_softirq_irqoff(softirq_nr); local_irq_restore(flags); } @@ -510,6 +533,7 @@ local_irq_enable(); while (list) { + struct _runtime_stat *pfunc_stat; struct tasklet_struct *t = list; list = list->next; @@ -519,7 +543,16 @@ if (!test_and_clear_bit(TASKLET_STATE_SCHED, &t->state)) BUG(); + avm_simple_profiling_log(avm_profile_data_type_trigger_tasklet_end, + (unsigned long)(t->func), softirq_nr); + avm_simple_profiling_log(avm_profile_data_type_tasklet_begin, + (unsigned long)(t->func), (unsigned int)(t->data)); + pfunc_stat = avm_taskletfunc_enter(t->func, softirq_nr); t->func(t->data); + avm_taskletfunc_leave(pfunc_stat); + avm_simple_profiling_log(avm_profile_data_type_tasklet_end, + (unsigned long)(t->func), (unsigned int)(t->data)); + tasklet_unlock(t); continue; }