diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-13 01:45:43 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-13 01:45:43 -0500 |
commit | 5cbb3d216e2041700231bcfc383ee5f8b7fc8b74 (patch) | |
tree | a738fa82dbcefa9bd283c08bc67f38827be63937 /kernel/gcov/base.c | |
parent | 9bc9ccd7db1c9f043f75380b5a5b94912046a60e (diff) | |
parent | 4e9b45a19241354daec281d7a785739829b52359 (diff) |
Merge branch 'akpm' (patches from Andrew Morton)
Merge first patch-bomb from Andrew Morton:
"Quite a lot of other stuff is banked up awaiting further
next->mainline merging, but this batch contains:
- Lots of random misc patches
- OCFS2
- Most of MM
- backlight updates
- lib/ updates
- printk updates
- checkpatch updates
- epoll tweaking
- rtc updates
- hfs
- hfsplus
- documentation
- procfs
- update gcov to gcc-4.7 format
- IPC"
* emailed patches from Andrew Morton <akpm@linux-foundation.org>: (269 commits)
ipc, msg: fix message length check for negative values
ipc/util.c: remove unnecessary work pending test
devpts: plug the memory leak in kill_sb
./Makefile: export initial ramdisk compression config option
init/Kconfig: add option to disable kernel compression
drivers: w1: make w1_slave::flags long to avoid memory corruption
drivers/w1/masters/ds1wm.cuse dev_get_platdata()
drivers/memstick/core/ms_block.c: fix unreachable state in h_msb_read_page()
drivers/memstick/core/mspro_block.c: fix attributes array allocation
drivers/pps/clients/pps-gpio.c: remove redundant of_match_ptr
kernel/panic.c: reduce 1 byte usage for print tainted buffer
gcov: reuse kbasename helper
kernel/gcov/fs.c: use pr_warn()
kernel/module.c: use pr_foo()
gcov: compile specific gcov implementation based on gcc version
gcov: add support for gcc 4.7 gcov format
gcov: move gcov structs definitions to a gcc version specific file
kernel/taskstats.c: return -ENOMEM when alloc memory fails in add_del_listener()
kernel/taskstats.c: add nla_nest_cancel() for failure processing between nla_nest_start() and nla_nest_end()
kernel/sysctl_binary.c: use scnprintf() instead of snprintf()
...
Diffstat (limited to 'kernel/gcov/base.c')
-rw-r--r-- | kernel/gcov/base.c | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/kernel/gcov/base.c b/kernel/gcov/base.c index 9b22d03cc581..f45b75b713c0 100644 --- a/kernel/gcov/base.c +++ b/kernel/gcov/base.c | |||
@@ -20,7 +20,6 @@ | |||
20 | #include <linux/mutex.h> | 20 | #include <linux/mutex.h> |
21 | #include "gcov.h" | 21 | #include "gcov.h" |
22 | 22 | ||
23 | static struct gcov_info *gcov_info_head; | ||
24 | static int gcov_events_enabled; | 23 | static int gcov_events_enabled; |
25 | static DEFINE_MUTEX(gcov_lock); | 24 | static DEFINE_MUTEX(gcov_lock); |
26 | 25 | ||
@@ -34,7 +33,7 @@ void __gcov_init(struct gcov_info *info) | |||
34 | 33 | ||
35 | mutex_lock(&gcov_lock); | 34 | mutex_lock(&gcov_lock); |
36 | if (gcov_version == 0) { | 35 | if (gcov_version == 0) { |
37 | gcov_version = info->version; | 36 | gcov_version = gcov_info_version(info); |
38 | /* | 37 | /* |
39 | * Printing gcc's version magic may prove useful for debugging | 38 | * Printing gcc's version magic may prove useful for debugging |
40 | * incompatibility reports. | 39 | * incompatibility reports. |
@@ -45,8 +44,7 @@ void __gcov_init(struct gcov_info *info) | |||
45 | * Add new profiling data structure to list and inform event | 44 | * Add new profiling data structure to list and inform event |
46 | * listener. | 45 | * listener. |
47 | */ | 46 | */ |
48 | info->next = gcov_info_head; | 47 | gcov_info_link(info); |
49 | gcov_info_head = info; | ||
50 | if (gcov_events_enabled) | 48 | if (gcov_events_enabled) |
51 | gcov_event(GCOV_ADD, info); | 49 | gcov_event(GCOV_ADD, info); |
52 | mutex_unlock(&gcov_lock); | 50 | mutex_unlock(&gcov_lock); |
@@ -81,6 +79,12 @@ void __gcov_merge_delta(gcov_type *counters, unsigned int n_counters) | |||
81 | } | 79 | } |
82 | EXPORT_SYMBOL(__gcov_merge_delta); | 80 | EXPORT_SYMBOL(__gcov_merge_delta); |
83 | 81 | ||
82 | void __gcov_merge_ior(gcov_type *counters, unsigned int n_counters) | ||
83 | { | ||
84 | /* Unused. */ | ||
85 | } | ||
86 | EXPORT_SYMBOL(__gcov_merge_ior); | ||
87 | |||
84 | /** | 88 | /** |
85 | * gcov_enable_events - enable event reporting through gcov_event() | 89 | * gcov_enable_events - enable event reporting through gcov_event() |
86 | * | 90 | * |
@@ -91,13 +95,15 @@ EXPORT_SYMBOL(__gcov_merge_delta); | |||
91 | */ | 95 | */ |
92 | void gcov_enable_events(void) | 96 | void gcov_enable_events(void) |
93 | { | 97 | { |
94 | struct gcov_info *info; | 98 | struct gcov_info *info = NULL; |
95 | 99 | ||
96 | mutex_lock(&gcov_lock); | 100 | mutex_lock(&gcov_lock); |
97 | gcov_events_enabled = 1; | 101 | gcov_events_enabled = 1; |
102 | |||
98 | /* Perform event callback for previously registered entries. */ | 103 | /* Perform event callback for previously registered entries. */ |
99 | for (info = gcov_info_head; info; info = info->next) | 104 | while ((info = gcov_info_next(info))) |
100 | gcov_event(GCOV_ADD, info); | 105 | gcov_event(GCOV_ADD, info); |
106 | |||
101 | mutex_unlock(&gcov_lock); | 107 | mutex_unlock(&gcov_lock); |
102 | } | 108 | } |
103 | 109 | ||
@@ -112,25 +118,23 @@ static int gcov_module_notifier(struct notifier_block *nb, unsigned long event, | |||
112 | void *data) | 118 | void *data) |
113 | { | 119 | { |
114 | struct module *mod = data; | 120 | struct module *mod = data; |
115 | struct gcov_info *info; | 121 | struct gcov_info *info = NULL; |
116 | struct gcov_info *prev; | 122 | struct gcov_info *prev = NULL; |
117 | 123 | ||
118 | if (event != MODULE_STATE_GOING) | 124 | if (event != MODULE_STATE_GOING) |
119 | return NOTIFY_OK; | 125 | return NOTIFY_OK; |
120 | mutex_lock(&gcov_lock); | 126 | mutex_lock(&gcov_lock); |
121 | prev = NULL; | 127 | |
122 | /* Remove entries located in module from linked list. */ | 128 | /* Remove entries located in module from linked list. */ |
123 | for (info = gcov_info_head; info; info = info->next) { | 129 | while ((info = gcov_info_next(info))) { |
124 | if (within(info, mod->module_core, mod->core_size)) { | 130 | if (within(info, mod->module_core, mod->core_size)) { |
125 | if (prev) | 131 | gcov_info_unlink(prev, info); |
126 | prev->next = info->next; | ||
127 | else | ||
128 | gcov_info_head = info->next; | ||
129 | if (gcov_events_enabled) | 132 | if (gcov_events_enabled) |
130 | gcov_event(GCOV_REMOVE, info); | 133 | gcov_event(GCOV_REMOVE, info); |
131 | } else | 134 | } else |
132 | prev = info; | 135 | prev = info; |
133 | } | 136 | } |
137 | |||
134 | mutex_unlock(&gcov_lock); | 138 | mutex_unlock(&gcov_lock); |
135 | 139 | ||
136 | return NOTIFY_OK; | 140 | return NOTIFY_OK; |