Created
April 29, 2019 14:34
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <linux/kernel.h> | |
#include <linux/module.h> | |
MODULE_LICENSE("GPL"); | |
static int module_print_init(void) | |
{ | |
struct module *m = THIS_MODULE; | |
struct list_head *modules; | |
int j = 0; | |
modules = &m->list; | |
modules = modules->prev; | |
printk("%s\n", __func__); | |
pr_info("\n"); | |
list_for_each_entry(m, modules, list) { | |
pr_info("%3d MOD:%20s, symbol exported= %u\n", j++, m->name, m->num_syms); | |
} | |
return 0; | |
} | |
static void module_print_exit(void) | |
{ | |
printk("%s\n", __func__); | |
} | |
module_init(module_print_init); | |
module_exit(module_print_exit); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment