-1

my purpose :

log debug info(ratio , address, else)of softirq generation in specific situation. any information can be helpful.

I suppose some suspicious device driver but has no clue which generated heavy load.

I'll thanks for any recommend like "read this manual".

noBODYcare
  • 101
  • 1
  • 6

1 Answers1

2

Is there a way to debug softirq?

Probably yes, since the Linux kernel is open source. Actually, it is even free software.

So you could download its source code (at end of 2020, Linux 5.10), and study it, and improve it.

You might read more about syscalls(2) (including bpf(2) & poll(2) & socket(2)) then use strace(1) or dmesg(1) or perf(1) or gprof(1). See also socket(7) with netlink(7) and libnetlink(7)

You technically could write your own GCC plugin to compile your Linux kernel, so that your GCC compiler automatically improves your Linux kernel (e.g. by automatically "adding" appropriate instrumentation code).

You might also write your Linux kernel module.

In a few months (perhaps February 2021) you might use Bismon for such a purpose (static analysis of the source code of your kernel, or module). Consider also using Frama-C or Clang static analyzer.

Be aware of Rice's theorem and afraid of Heisenbugs.

For the kernel side, ask also on kernelnewbies.

My recommendation would be to minimize kernel changes, and if possible and permitted, code more application code (maybe related to systemd(1), which I don't understand much) and less kernel code.

Basile Starynkevitch
  • 223,805
  • 18
  • 296
  • 547
  • 2
    It’s strange you haven’t mentioned `perf` which is the tool #1 for such area of interest. – 0andriy Dec 20 '20 at 15:42
  • 1
    Thanks. Improved my answer – Basile Starynkevitch Dec 20 '20 at 16:41
  • Thanks for all you guy's kindness... since I was searching for 'system profiling feature' (and didn't know how to call this topic). perf is the best answer for me. but still I have problem that my kernel version is too low(2.4.x, and perf is available 2.6.+). – noBODYcare Dec 23 '20 at 01:43
  • but I can try 'perf' because I have same type of machine that have appropriate kernel version, have same problem with system I mentioned. after that I'll debug device driver directly, using method first recommended. Thanks! – noBODYcare Dec 23 '20 at 01:47
  • Ask permission to update your Linux kernel. The current version is 5.10 (at end of 2020) – Basile Starynkevitch Dec 23 '20 at 07:48