Enumerating all the notifiable notifier function in the linux kernel

How do you detect detect reboots?
How do you detect kernel module being loaded?
How do you detect OOM condition?
How do you detect hardware problems or being connected?

To answer these question notification functions are available in the kernel:

Looking into /proc/kallsyms:

grep registe.*notif /proc/kallsyms
ffffffff8108a740 T unregister_reboot_notifier
ffffffff8108a870 T register_reboot_notifier
ffffffff8108a8f0 T register_die_notifier
ffffffff8108a990 T unregister_die_notifier
ffffffff81092d70 T clockevents_register_notifier
ffffffff8109ee90 T unregister_module_notifier
ffffffff8109eeb0 T register_module_notifier
ffffffff810a27d0 T unregister_pm_notifier
ffffffff810a27f0 T register_pm_notifier
ffffffff810f6710 T unregister_oom_notifier
ffffffff810f6730 T register_oom_notifier
ffffffff81245f80 T unregister_ipcns_notifier
ffffffff81245fc0 T cond_register_ipcns_notifier
ffffffff81246050 T register_ipcns_notifier
ffffffff81286fe0 T crypto_unregister_notifier
ffffffff81287000 T crypto_register_notifier
ffffffff812e5788 T unregister_acpi_bus_notifier
ffffffff812e57a2 T register_acpi_bus_notifier
ffffffff812ea084 T unregister_dock_notifier
ffffffff812ea0a7 T register_dock_notifier
ffffffff812edc0c T unregister_acpi_notifier
ffffffff812edc26 T register_acpi_notifier
ffffffff813200c0 T unregister_xenstore_notifier
ffffffff813200e0 T register_xenstore_notifier
ffffffff813242f0 T regulator_unregister_notifier
ffffffff81324310 T regulator_register_notifier
ffffffff81338a30 T unregister_keyboard_notifier
ffffffff81338a50 T register_keyboard_notifier
ffffffff8133d650 T unregister_vt_notifier
ffffffff8133d670 T register_vt_notifier
ffffffff81367950 T bus_unregister_notifier
ffffffff81367970 T bus_register_notifier
ffffffff8137e1d0 T da903x_unregister_notifier
ffffffff8137e220 T da903x_register_notifier
ffffffff813e11a0 T usb_unregister_notify
ffffffff813e11c0 T usb_register_notify
ffffffff81431c90 T cpufreq_unregister_notifier
ffffffff81431cd0 T cpufreq_register_notifier
ffffffff8145e280 T unregister_netdevice_notifier
ffffffff8145e2c0 T register_netdevice_notifier
ffffffff81463c20 T unregister_netevent_notifier
ffffffff81463c40 T register_netevent_notifier
ffffffff8147f920 T netlink_unregister_notifier
ffffffff8147f940 T netlink_register_notifier
ffffffff814bb790 T unregister_inetaddr_notifier
ffffffff814bb7b0 T register_inetaddr_notifier
ffffffff814eb360 T unregister_inet6addr_notifier
ffffffff814eb380 T register_inet6addr_notifier
ffffffff8152ce80 T unregister_cpu_notifier
ffffffff8152cec0 T register_cpu_notifier
ffffffff8174e430 r __ksymtab_unregister_cpu_notifier
ffffffff8174e440 r __ksymtab_register_cpu_notifier
ffffffff8174f000 r __ksymtab_unregister_reboot_notifier
ffffffff8174f010 r __ksymtab_register_reboot_notifier
ffffffff8174f460 r __ksymtab_unregister_module_notifier
ffffffff8174f470 r __ksymtab_register_module_notifier
ffffffff81754f90 r __ksymtab_unregister_acpi_notifier
ffffffff81754fa0 r __ksymtab_register_acpi_notifier
ffffffff817578a0 r __ksymtab_cpufreq_unregister_notifier
ffffffff817578b0 r __ksymtab_cpufreq_register_notifier
ffffffff817589c0 r __ksymtab_unregister_netdevice_notifier
ffffffff817589d0 r __ksymtab_register_netdevice_notifier
ffffffff817596f0 r __ksymtab_netlink_unregister_notifier
ffffffff81759700 r __ksymtab_netlink_register_notifier
ffffffff8175a1b0 r __ksymtab_unregister_inetaddr_notifier
ffffffff8175a1c0 r __ksymtab_register_inetaddr_notifier
ffffffff8175a990 r __ksymtab_unregister_inet6addr_notifier
ffffffff8175a9a0 r __ksymtab_register_inet6addr_notifier
ffffffff8175b610 r __ksymtab_unregister_die_notifier
ffffffff8175b620 r __ksymtab_register_die_notifier
ffffffff8175ba90 r __ksymtab_unregister_pm_notifier
ffffffff8175baa0 r __ksymtab_register_pm_notifier
ffffffff8175c310 r __ksymtab_unregister_oom_notifier
ffffffff8175c320 r __ksymtab_register_oom_notifier
ffffffff8175d0f0 r __ksymtab_crypto_unregister_notifier
ffffffff8175d100 r __ksymtab_crypto_register_notifier
ffffffff8175dd70 r __ksymtab_unregister_acpi_bus_notifier
ffffffff8175dd80 r __ksymtab_register_acpi_bus_notifier
ffffffff8175de00 r __ksymtab_unregister_dock_notifier
ffffffff8175de10 r __ksymtab_register_dock_notifier
ffffffff8175e210 r __ksymtab_unregister_xenstore_notifier
ffffffff8175e220 r __ksymtab_register_xenstore_notifier
ffffffff8175e360 r __ksymtab_regulator_unregister_notifier
ffffffff8175e370 r __ksymtab_regulator_register_notifier
ffffffff8175e5b0 r __ksymtab_unregister_keyboard_notifier
ffffffff8175e5c0 r __ksymtab_register_keyboard_notifier
ffffffff8175e610 r __ksymtab_unregister_vt_notifier
ffffffff8175e620 r __ksymtab_register_vt_notifier
ffffffff8175ea90 r __ksymtab_bus_unregister_notifier
ffffffff8175eaa0 r __ksymtab_bus_register_notifier
ffffffff8175f270 r __ksymtab_da903x_unregister_notifier
ffffffff8175f280 r __ksymtab_da903x_register_notifier
ffffffff81760600 r __ksymtab_usb_unregister_notify
ffffffff81760610 r __ksymtab_usb_register_notify
ffffffff817612e0 r __ksymtab_unregister_netevent_notifier
ffffffff817612f0 r __ksymtab_register_netevent_notifier
ffffffff81762210 r __kcrctab_unregister_cpu_notifier
ffffffff81762218 r __kcrctab_register_cpu_notifier
ffffffff817627f8 r __kcrctab_unregister_reboot_notifier
ffffffff81762800 r __kcrctab_register_reboot_notifier
ffffffff81762a28 r __kcrctab_unregister_module_notifier
ffffffff81762a30 r __kcrctab_register_module_notifier
ffffffff817657c0 r __kcrctab_unregister_acpi_notifier
ffffffff817657c8 r __kcrctab_register_acpi_notifier
ffffffff81766c48 r __kcrctab_cpufreq_unregister_notifier
ffffffff81766c50 r __kcrctab_cpufreq_register_notifier
ffffffff817674d8 r __kcrctab_unregister_netdevice_notifier
ffffffff817674e0 r __kcrctab_register_netdevice_notifier
ffffffff81767b70 r __kcrctab_netlink_unregister_notifier
ffffffff81767b78 r __kcrctab_netlink_register_notifier
ffffffff817680d0 r __kcrctab_unregister_inetaddr_notifier
ffffffff817680d8 r __kcrctab_register_inetaddr_notifier
ffffffff817684c0 r __kcrctab_unregister_inet6addr_notifier
ffffffff817684c8 r __kcrctab_register_inet6addr_notifier
ffffffff81768b00 r __kcrctab_unregister_die_notifier
ffffffff81768b08 r __kcrctab_register_die_notifier
ffffffff81768d40 r __kcrctab_unregister_pm_notifier
ffffffff81768d48 r __kcrctab_register_pm_notifier
ffffffff81769180 r __kcrctab_unregister_oom_notifier
ffffffff81769188 r __kcrctab_register_oom_notifier
ffffffff81769870 r __kcrctab_crypto_unregister_notifier
ffffffff81769878 r __kcrctab_crypto_register_notifier
ffffffff81769eb0 r __kcrctab_unregister_acpi_bus_notifier
ffffffff81769eb8 r __kcrctab_register_acpi_bus_notifier
ffffffff81769ef8 r __kcrctab_unregister_dock_notifier
ffffffff81769f00 r __kcrctab_register_dock_notifier
ffffffff8176a100 r __kcrctab_unregister_xenstore_notifier
ffffffff8176a108 r __kcrctab_register_xenstore_notifier
ffffffff8176a1a8 r __kcrctab_regulator_unregister_notifier
ffffffff8176a1b0 r __kcrctab_regulator_register_notifier
ffffffff8176a2d0 r __kcrctab_unregister_keyboard_notifier
ffffffff8176a2d8 r __kcrctab_register_keyboard_notifier
ffffffff8176a300 r __kcrctab_unregister_vt_notifier
ffffffff8176a308 r __kcrctab_register_vt_notifier
ffffffff8176a540 r __kcrctab_bus_unregister_notifier
ffffffff8176a548 r __kcrctab_bus_register_notifier
ffffffff8176a930 r __kcrctab_da903x_unregister_notifier
ffffffff8176a938 r __kcrctab_da903x_register_notifier
ffffffff8176b2f8 r __kcrctab_usb_unregister_notify
ffffffff8176b300 r __kcrctab_usb_register_notify
ffffffff8176b968 r __kcrctab_unregister_netevent_notifier
ffffffff8176b970 r __kcrctab_register_netevent_notifier
ffffffff8176cf0e r __kstrtab_unregister_cpu_notifier
ffffffff8176cf26 r __kstrtab_register_cpu_notifier
ffffffff8176e004 r __kstrtab_unregister_die_notifier
ffffffff8176e01c r __kstrtab_register_die_notifier
ffffffff8176e032 r __kstrtab_unregister_reboot_notifier
ffffffff8176e04d r __kstrtab_register_reboot_notifier
ffffffff8176ea8e r __kstrtab_unregister_module_notifier
ffffffff8176eaa9 r __kstrtab_register_module_notifier
ffffffff8176eb1c r __kstrtab_unregister_pm_notifier
ffffffff8176eb33 r __kstrtab_register_pm_notifier
ffffffff8176fd13 r __kstrtab_unregister_oom_notifier
ffffffff8176fd2b r __kstrtab_register_oom_notifier
ffffffff8177404b r __kstrtab_crypto_unregister_notifier
ffffffff81774066 r __kstrtab_crypto_register_notifier
ffffffff81777364 r __kstrtab_unregister_acpi_bus_notifier
ffffffff81777381 r __kstrtab_register_acpi_bus_notifier
ffffffff81777617 r __kstrtab_unregister_dock_notifier
ffffffff81777630 r __kstrtab_register_dock_notifier
ffffffff8177771a r __kstrtab_unregister_acpi_notifier
ffffffff81777733 r __kstrtab_register_acpi_notifier
ffffffff817785f5 r __kstrtab_unregister_xenstore_notifier
ffffffff81778612 r __kstrtab_register_xenstore_notifier
ffffffff817787e2 r __kstrtab_regulator_unregister_notifier
ffffffff81778800 r __kstrtab_regulator_register_notifier
ffffffff81778f58 r __kstrtab_unregister_keyboard_notifier
ffffffff81778f75 r __kstrtab_register_keyboard_notifier
ffffffff81779103 r __kstrtab_unregister_vt_notifier
ffffffff8177911a r __kstrtab_register_vt_notifier
ffffffff81779eba r __kstrtab_bus_unregister_notifier
ffffffff81779ed2 r __kstrtab_bus_register_notifier
ffffffff8177a9ce r __kstrtab_da903x_unregister_notifier
ffffffff8177a9e9 r __kstrtab_da903x_register_notifier
ffffffff8177ce4d r __kstrtab_usb_unregister_notify
ffffffff8177ce63 r __kstrtab_usb_register_notify
ffffffff8177e093 r __kstrtab_cpufreq_unregister_notifier
ffffffff8177e0af r __kstrtab_cpufreq_register_notifier
ffffffff8177faf7 r __kstrtab_unregister_netdevice_notifier
ffffffff8177fb15 r __kstrtab_register_netdevice_notifier
ffffffff8177fe67 r __kstrtab_unregister_netevent_notifier
ffffffff8177fe84 r __kstrtab_register_netevent_notifier
ffffffff81780af7 r __kstrtab_netlink_unregister_notifier
ffffffff81780b13 r __kstrtab_netlink_register_notifier
ffffffff81781b71 r __kstrtab_unregister_inetaddr_notifier
ffffffff81781b8e r __kstrtab_register_inetaddr_notifier
ffffffff8178276f r __kstrtab_unregister_inet6addr_notifier
ffffffff8178278d r __kstrtab_register_inet6addr_notifier
ffffffffa0f21bf0 t kvm_unregister_irq_mask_notifier [kvm]
ffffffffa0f21d50 t kvm_register_irq_ack_notifier [kvm]
ffffffffa0f21ce0 t kvm_unregister_irq_ack_notifier [kvm]
ffffffffa0f21c50 t kvm_register_irq_mask_notifier [kvm]

And this is from 2.6.32-21-generic kernel, Ubuntu 10.04 LTS version.

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: