Lines Matching defs:subops

3486 	/* If the subops trace all functions so must the main ops */
3501 /* Copy the subops hash */
3526 * subops are not tracing a set of functions, the
3528 * in both subops, but has to trace the functions that
3529 * are only notrace in one of the subops, for the other
3530 * subops to be able to trace them.
3550 * ftrace_startup_subops - enable tracing for subops of an ops
3551 * @ops: Manager ops (used to pick all the functions of its subops)
3552 * @subops: A new ops to add to @ops
3556 * that its list of subops are tracing. Adding a new @subops will add the
3557 * functions of @subops to @ops.
3559 int ftrace_startup_subops(struct ftrace_ops *ops, struct ftrace_ops *subops, int command)
3571 ftrace_ops_init(subops);
3573 if (WARN_ON_ONCE(subops->flags & FTRACE_OPS_FL_ENABLED))
3581 if (!subops->func_hash->filter_hash)
3582 subops->func_hash->filter_hash = EMPTY_HASH;
3583 if (!subops->func_hash->notrace_hash)
3584 subops->func_hash->notrace_hash = EMPTY_HASH;
3586 /* For the first subops to ops just enable it normally */
3593 ret = add_first_hash(&filter_hash, &notrace_hash, subops->func_hash);
3602 list_add(&subops->list, &ops->subop_list);
3605 list_del(&subops->list);
3613 subops->flags |= FTRACE_OPS_FL_ENABLED | FTRACE_OPS_FL_SUBOP;
3614 subops->managed = ops;
3621 * If the new subops and main ops filter hashes are not empty:
3622 * o Make a copy of the subops filter hash
3628 ret = add_next_hash(&filter_hash, &notrace_hash, ops->func_hash, subops->func_hash);
3632 list_add(&subops->list, &ops->subop_list);
3638 list_del(&subops->list);
3640 subops->flags |= FTRACE_OPS_FL_ENABLED | FTRACE_OPS_FL_SUBOP;
3641 subops->managed = ops;
3650 struct ftrace_ops *subops;
3657 list_for_each_entry(subops, &ops->subop_list, list) {
3662 ret = add_first_hash(filter_hash, notrace_hash, subops->func_hash);
3668 &temp_hash, subops->func_hash);
3686 * ftrace_shutdown_subops - Remove a subops from a manager ops
3687 * @ops: A manager ops to remove @subops from
3688 * @subops: The subops to remove from @ops
3691 * Removes the functions being traced by the @subops from @ops. Note, it
3692 * will not affect functions that are being traced by other subops that
3695 * If the last subops is removed from @ops, then @ops is shutdown normally.
3697 int ftrace_shutdown_subops(struct ftrace_ops *ops, struct ftrace_ops *subops, int command)
3706 if (WARN_ON_ONCE(!(subops->flags & FTRACE_OPS_FL_ENABLED)))
3709 list_del(&subops->list);
3716 list_add(&subops->list, &ops->subop_list);
3720 subops->flags &= ~FTRACE_OPS_FL_ENABLED;
3726 subops->flags &= ~(FTRACE_OPS_FL_ENABLED | FTRACE_OPS_FL_SUBOP);
3727 subops->managed = NULL;
3732 /* Rebuild the hashes without subops */
3739 list_add(&subops->list, &ops->subop_list);
3741 subops->flags &= ~(FTRACE_OPS_FL_ENABLED | FTRACE_OPS_FL_SUBOP);
3742 subops->managed = NULL;
3749 static int ftrace_hash_move_and_update_subops(struct ftrace_ops *subops,
3753 struct ftrace_ops *ops = subops->managed;
3760 /* Manager ops can not be subops (yet) */
3764 /* Move the new hash over to the subops hash */
4446 struct ftrace_ops *subops;
4449 list_for_each_entry(subops, &ops->subop_list, list) {
4450 if (!((subops->flags & FTRACE_OPS_FL_ENABLED) &&
4451 hash_contains_ip(rec->ip, subops->func_hash)))
4458 if (subops->flags & FTRACE_OPS_FL_GRAPH) {
4461 gops = container_of(subops, struct fgraph_ops, ops);
4468 if (subops->trampoline) {
4470 (void *)subops->trampoline,
4471 (void *)subops->func);
4472 add_trampoline_func(m, subops, rec);
4475 (void *)subops->func);
5063 * it will not affect subops that share it.
5068 /* Check if any other manager subops maps to this hash */
5070 struct ftrace_ops *subops;
5072 list_for_each_entry(subops, &op->subop_list, list) {
5073 if ((subops->flags & FTRACE_OPS_FL_ENABLED) &&
5074 subops->func_hash == ops->func_hash) {
5075 return ftrace_hash_move_and_update_subops(subops, orig_hash, hash);