Lines Matching full:depth

20  * A function instance keyed by (callsite, depth).
22 * Marks are tracked for each frame up to @depth.
26 u32 callsite; /* call insn that invoked this subprog (subprog_start for depth 0) */
27 u32 depth; /* call depth (0 = entry subprog) */ member
44 DECLARE_HASHTABLE(func_instances, 8); /* maps (depth, callsite) to func_instance */
50 * Hash/compare key for func_instance: (depth, callsite).
51 * For depth == 0 (entry subprog), @callsite is the subprog start insn.
52 * For depth > 0, @callsite is the call instruction index that invoked the subprog.
54 static u32 instance_hash(u32 callsite, u32 depth) in instance_hash() argument
56 u32 key[2] = { depth, callsite }; in instance_hash()
62 u32 callsite, u32 depth) in find_instance() argument
66 u32 key = instance_hash(callsite, depth); in find_instance()
69 if (f->depth == depth && f->callsite == callsite) in find_instance()
78 u32 depth = caller ? caller->depth + 1 : 0; in call_instance() local
80 u32 lookup_key = depth > 0 ? callsite : subprog_start; in call_instance()
84 f = find_instance(env, lookup_key, depth); in call_instance()
92 f->depth = depth; in call_instance()
96 hash = instance_hash(lookup_key, depth); in call_instance()
107 u32 key, depth; in lookup_instance() local
112 for (depth = frameno; ; depth--) { in lookup_instance()
113 key = depth > 0 ? callsite : subprog_start; in lookup_instance()
114 f = find_instance(env, key, depth); in lookup_instance()
115 if (f || depth == 0) in lookup_instance()
138 for (i = 0; i <= instance->depth; i++) in bpf_stack_liveness_free()
321 for (frame = 0; frame <= instance->depth; frame++) { in update_instance()
377 cur_delta = (int)curframe_instance->depth - (int)q->curframe; in bpf_stack_slot_alive()
379 if (rel <= curframe_instance->depth) in bpf_stack_slot_alive()
390 delta = (int)instance->depth - (int)i; in bpf_stack_slot_alive()
392 if (rel > instance->depth) in bpf_stack_slot_alive()
420 "(d%d,cs%d)", instance->depth, instance->callsite); in fmt_instance()
505 for (frame = instance->depth; frame >= 0; --frame) { in print_instance()
516 for (frame = instance->depth; frame >= 0; --frame) { in print_instance()
536 int ddepth = (int)a->depth - b->depth; in cmp_instances()
545 /* print use/def slots for all instances ordered by callsite first, then by depth */
885 int depth) in fill_from_stack() argument
888 .mask = (1u << (depth + 1)) - 1, in fill_from_stack()
1051 static bool can_be_local_fp(int depth, int regno, struct arg_track *at) in can_be_local_fp() argument
1053 return regno == BPF_REG_FP || at->frame == depth || in can_be_local_fp()
1054 (at->frame == ARG_IMPRECISE && (at->mask & BIT(depth))); in can_be_local_fp()
1068 int depth = instance->depth; in arg_track_xfer() local
1126 bool src_is_local_fp = can_be_local_fp(depth, insn->src_reg, src); in arg_track_xfer()
1135 *dst = fill_from_stack(insn, at_out, insn->src_reg, at_stack_out, depth); in arg_track_xfer()
1136 } else if (src->frame >= 0 && src->frame < depth && in arg_track_xfer()
1144 !(src->mask & BIT(depth)) && src->mask && in arg_track_xfer()
1161 dst_is_local_fp = can_be_local_fp(depth, insn->dst_reg, dst); in arg_track_xfer()
1180 bool dst_is_local_fp = can_be_local_fp(depth, insn->dst_reg, dst); in arg_track_xfer()
1273 int depth = instance->depth; in record_imprecise() local
1279 if (f <= depth) { in record_imprecise()
1294 int depth = instance->depth; in record_load_store_access() local
1338 if (ptr->frame >= 0 && ptr->frame <= depth) in record_load_store_access()
1353 int depth = instance->depth; in record_call_access() local
1375 for (int f = 0; f <= depth; f++) { in record_call_access()
1385 if (frame >= 0 && frame <= depth) in record_call_access()
1540 int depth = instance->depth; in compute_subprog_args() local
1578 at_in[0][BPF_REG_FP] = arg_single(depth, 0); in compute_subprog_args()
1591 verbose(env, "subprog#%d: analyzing (depth %d)...\n", subprog, depth); in compute_subprog_args()
1696 for (f = 0; f <= dst->depth; f++) { in merge_instances()
1731 f->depth = src->depth; in fresh_instance()
1742 for (i = 0; i <= instance->depth; i++) in free_instance()
1752 * depends on the entry args and frame depth. Consider: A->C->D and B->C->D
1763 int depth = instance->depth; in analyze_subprog() local
1833 for (int f = 0; f <= depth; f++) { in analyze_subprog()
1853 if (depth == MAX_CALL_FRAMES - 1) { in analyze_subprog()
1863 callsites[depth] = idx; in analyze_subprog()
1873 for (int f = 0; f < callee_instance->depth; f++) { in analyze_subprog()