Lines Matching full:old

115 static inline void release_probes(struct tracepoint *tp, struct tracepoint_func *old)  in release_probes()  argument
117 if (old) { in release_probes()
118 struct tp_probes *tp_probes = container_of(old, in release_probes()
146 struct tracepoint_func *old, *new; in func_add() local
147 int iter_probes; /* Iterate over old probe array. */ in func_add()
155 old = *funcs; in func_add()
156 if (old) { in func_add()
158 for (iter_probes = 0; old[iter_probes].func; iter_probes++) { in func_add()
159 if (old[iter_probes].func == tp_stub_func) in func_add()
161 if (old[iter_probes].func == tp_func->func && in func_add()
162 old[iter_probes].data == tp_func->data) in func_add()
171 if (old) { in func_add()
173 for (iter_probes = 0; old[iter_probes].func; iter_probes++) { in func_add()
174 if (old[iter_probes].func == tp_stub_func) in func_add()
177 if (pos < 0 && old[iter_probes].prio < prio) in func_add()
179 new[nr_probes++] = old[iter_probes]; in func_add()
192 return old; in func_add()
199 struct tracepoint_func *old, *new; in func_remove() local
201 old = *funcs; in func_remove()
203 if (!old) in func_remove()
209 for (nr_probes = 0; old[nr_probes].func; nr_probes++) { in func_remove()
210 if ((old[nr_probes].func == tp_func->func && in func_remove()
211 old[nr_probes].data == tp_func->data) || in func_remove()
212 old[nr_probes].func == tp_stub_func) in func_remove()
225 return old; in func_remove()
232 for (i = 0; old[i].func; i++) { in func_remove()
233 if ((old[i].func != tp_func->func || in func_remove()
234 old[i].data != tp_func->data) && in func_remove()
235 old[i].func != tp_stub_func) in func_remove()
236 new[j++] = old[i]; in func_remove()
242 * Failed to allocate, replace the old function in func_remove()
245 for (i = 0; old[i].func; i++) { in func_remove()
246 if (old[i].func == tp_func->func && in func_remove()
247 old[i].data == tp_func->data) in func_remove()
248 WRITE_ONCE(old[i].func, tp_stub_func); in func_remove()
250 *funcs = old; in func_remove()
254 return old; in func_remove()
290 struct tracepoint_func *old, *tp_funcs; in tracepoint_add_func() local
301 old = func_add(&tp_funcs, func, prio); in tracepoint_add_func()
302 if (IS_ERR(old)) { in tracepoint_add_func()
303 WARN_ON_ONCE(warn && PTR_ERR(old) != -ENOMEM); in tracepoint_add_func()
304 return PTR_ERR(old); in tracepoint_add_func()
316 * Make sure new static func never uses old data after a in tracepoint_add_func()
341 if (tp_funcs[0].data != old[0].data) in tracepoint_add_func()
349 release_probes(tp, old); in tracepoint_add_func()
362 struct tracepoint_func *old, *tp_funcs; in tracepoint_remove_func() local
366 old = func_remove(&tp_funcs, func); in tracepoint_remove_func()
367 if (WARN_ON_ONCE(IS_ERR(old))) in tracepoint_remove_func()
368 return PTR_ERR(old); in tracepoint_remove_func()
370 if (tp_funcs == old) in tracepoint_remove_func()
385 * Make sure new static func never uses old data after a in tracepoint_remove_func()
396 * to prevent current readers that have loaded the old data in tracepoint_remove_func()
399 if (tp_funcs[0].data != old[0].data) in tracepoint_remove_func()
413 if (tp_funcs[0].data != old[0].data) in tracepoint_remove_func()
420 release_probes(tp, old); in tracepoint_remove_func()