/* * Always include a trailing , so userspace can differentiate * between this and the old multi-field proc format.
*/
list_for_each_entry(use, &mod->source_list, source_list) {
printed_something = 1;
seq_printf(m, "%s,", use->source->name);
}
if (!printed_something)
seq_puts(m, "-");
} #else/* !CONFIG_MODULE_UNLOAD */ staticinlinevoid print_unload_info(struct seq_file *m, struct module *mod)
{ /* We don't know the usage count, or what modules are using. */
seq_puts(m, " - -");
} #endif/* CONFIG_MODULE_UNLOAD */
/* Called by the /proc file system to return a list of modules. */ staticvoid *m_start(struct seq_file *m, loff_t *pos)
{
mutex_lock(&module_mutex); return seq_list_start(&modules, *pos);
}
/* Informative for users. */
seq_printf(m, " %s",
mod->state == MODULE_STATE_GOING ? "Unloading" :
mod->state == MODULE_STATE_COMING ? "Loading" : "Live"); /* Used by oprofile and other similar tools. */
value = m->private ? NULL : mod->mem[MOD_TEXT].base;
seq_printf(m, " 0x%px", value);
/* Taints info */ if (mod->taints)
seq_printf(m, " %s", module_flags(mod, buf, true));
seq_puts(m, "\n"); return 0;
}
/* * Format: modulename size refcount deps address * * Where refcount is a number or -, and deps is a comma-separated list * of depends or -.
*/ staticconststruct seq_operations modules_op = {
.start = m_start,
.next = m_next,
.stop = m_stop,
.show = m_show
};
/* * This also sets the "private" pointer to non-NULL if the * kernel pointers should be hidden (so you can just test * "m->private" to see if you should keep the values private). * * We use the same logic as for /proc/kallsyms.
*/ staticint modules_open(struct inode *inode, struct file *file)
{ int err = seq_open(file, &modules_op);
if (!err) { struct seq_file *m = file->private_data;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.