--- zzzz-none-000/linux-5.15.111/kernel/softirq.c 2023-05-11 14:00:40.000000000 +0000 +++ puma7-atom-6670-761/linux-5.15.111/kernel/softirq.c 2024-02-07 10:23:29.000000000 +0000 @@ -29,6 +29,8 @@ #include #include +#include +#include #define CREATE_TRACE_POINTS #include @@ -534,6 +536,7 @@ softirq_handle_begin(); in_hardirq = lockdep_softirq_start(); account_softirq_enter(current); + avm_sum_softirq_enter(); restart: /* Reset the pending bitmask before enabling irqs */ @@ -544,6 +547,7 @@ h = softirq_vec; while ((softirq_bit = ffs(pending))) { + struct _runtime_stat *pts; unsigned int vec_nr; int prev_count; @@ -554,9 +558,15 @@ 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); h->action(h); + 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, @@ -582,6 +592,7 @@ wakeup_softirqd(); } + avm_sum_softirq_leave(); account_softirq_exit(current); lockdep_softirq_end(in_hardirq); softirq_handle_end(); @@ -727,6 +738,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); } @@ -772,6 +785,7 @@ local_irq_enable(); while (list) { + struct _runtime_stat *pfunc_stat; struct tasklet_struct *t = list; list = list->next; @@ -781,9 +795,19 @@ if (tasklet_clear_sched(t)) { if (t->use_callback) t->callback(t); - else + else { + 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; }