aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/module.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/module.h')
-rw-r--r--include/linux/module.h42
1 files changed, 23 insertions, 19 deletions
diff --git a/include/linux/module.h b/include/linux/module.h
index 098bdb7bfacf..482efc865acf 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -15,12 +15,13 @@
15#include <linux/stringify.h> 15#include <linux/stringify.h>
16#include <linux/kobject.h> 16#include <linux/kobject.h>
17#include <linux/moduleparam.h> 17#include <linux/moduleparam.h>
18#include <linux/marker.h>
19#include <linux/tracepoint.h> 18#include <linux/tracepoint.h>
20#include <asm/local.h>
21 19
20#include <asm/local.h>
22#include <asm/module.h> 21#include <asm/module.h>
23 22
23#include <trace/events/module.h>
24
24/* Not Yet Implemented */ 25/* Not Yet Implemented */
25#define MODULE_SUPPORTED_DEVICE(name) 26#define MODULE_SUPPORTED_DEVICE(name)
26 27
@@ -127,7 +128,10 @@ extern struct module __this_module;
127 */ 128 */
128#define MODULE_LICENSE(_license) MODULE_INFO(license, _license) 129#define MODULE_LICENSE(_license) MODULE_INFO(license, _license)
129 130
130/* Author, ideally of form NAME[, NAME]*[ and NAME] */ 131/*
132 * Author(s), use "Name <email>" or just "Name", for multiple
133 * authors use multiple MODULE_AUTHOR() statements/lines.
134 */
131#define MODULE_AUTHOR(_author) MODULE_INFO(author, _author) 135#define MODULE_AUTHOR(_author) MODULE_INFO(author, _author)
132 136
133/* What your module does. */ 137/* What your module does. */
@@ -307,10 +311,14 @@ struct module
307#endif 311#endif
308 312
309#ifdef CONFIG_KALLSYMS 313#ifdef CONFIG_KALLSYMS
310 /* We keep the symbol and string tables for kallsyms. */ 314 /*
311 Elf_Sym *symtab; 315 * We keep the symbol and string tables for kallsyms.
312 unsigned int num_symtab; 316 * The core_* fields below are temporary, loader-only (they
313 char *strtab; 317 * could really be discarded after module init).
318 */
319 Elf_Sym *symtab, *core_symtab;
320 unsigned int num_symtab, core_num_syms;
321 char *strtab, *core_strtab;
314 322
315 /* Section attributes */ 323 /* Section attributes */
316 struct module_sect_attrs *sect_attrs; 324 struct module_sect_attrs *sect_attrs;
@@ -325,10 +333,6 @@ struct module
325 /* The command line arguments (may be mangled). People like 333 /* The command line arguments (may be mangled). People like
326 keeping pointers to this stuff */ 334 keeping pointers to this stuff */
327 char *args; 335 char *args;
328#ifdef CONFIG_MARKERS
329 struct marker *markers;
330 unsigned int num_markers;
331#endif
332#ifdef CONFIG_TRACEPOINTS 336#ifdef CONFIG_TRACEPOINTS
333 struct tracepoint *tracepoints; 337 struct tracepoint *tracepoints;
334 unsigned int num_tracepoints; 338 unsigned int num_tracepoints;
@@ -462,7 +466,10 @@ static inline local_t *__module_ref_addr(struct module *mod, int cpu)
462static inline void __module_get(struct module *module) 466static inline void __module_get(struct module *module)
463{ 467{
464 if (module) { 468 if (module) {
465 local_inc(__module_ref_addr(module, get_cpu())); 469 unsigned int cpu = get_cpu();
470 local_inc(__module_ref_addr(module, cpu));
471 trace_module_get(module, _THIS_IP_,
472 local_read(__module_ref_addr(module, cpu)));
466 put_cpu(); 473 put_cpu();
467 } 474 }
468} 475}
@@ -473,8 +480,11 @@ static inline int try_module_get(struct module *module)
473 480
474 if (module) { 481 if (module) {
475 unsigned int cpu = get_cpu(); 482 unsigned int cpu = get_cpu();
476 if (likely(module_is_live(module))) 483 if (likely(module_is_live(module))) {
477 local_inc(__module_ref_addr(module, cpu)); 484 local_inc(__module_ref_addr(module, cpu));
485 trace_module_get(module, _THIS_IP_,
486 local_read(__module_ref_addr(module, cpu)));
487 }
478 else 488 else
479 ret = 0; 489 ret = 0;
480 put_cpu(); 490 put_cpu();
@@ -527,8 +537,6 @@ int unregister_module_notifier(struct notifier_block * nb);
527 537
528extern void print_modules(void); 538extern void print_modules(void);
529 539
530extern void module_update_markers(void);
531
532extern void module_update_tracepoints(void); 540extern void module_update_tracepoints(void);
533extern int module_get_iter_tracepoints(struct tracepoint_iter *iter); 541extern int module_get_iter_tracepoints(struct tracepoint_iter *iter);
534 542
@@ -643,10 +651,6 @@ static inline void print_modules(void)
643{ 651{
644} 652}
645 653
646static inline void module_update_markers(void)
647{
648}
649
650static inline void module_update_tracepoints(void) 654static inline void module_update_tracepoints(void)
651{ 655{
652} 656}