Lines Matching refs:cfg
12 struct cfg { struct
54 #define cfg_first_func(cfg) \ argument
55 list_first_entry(&cfg->funcs, struct func_node, l)
56 #define cfg_last_func(cfg) \ argument
57 list_last_entry(&cfg->funcs, struct func_node, l)
63 static struct func_node *cfg_append_func(struct cfg *cfg, struct bpf_insn *insn) in cfg_append_func() argument
67 list_for_each_entry(func, &cfg->funcs, l) { in cfg_append_func()
81 new_func->idx = cfg->func_num; in cfg_append_func()
83 cfg->func_num++; in cfg_append_func()
131 static bool cfg_partition_funcs(struct cfg *cfg, struct bpf_insn *cur, in cfg_partition_funcs() argument
136 func = cfg_append_func(cfg, cur); in cfg_partition_funcs()
145 func = cfg_append_func(cfg, cur + cur->off + 1); in cfg_partition_funcs()
150 last_func = cfg_last_func(cfg); in cfg_partition_funcs()
152 func = cfg_first_func(cfg); in cfg_partition_funcs()
333 static bool cfg_build(struct cfg *cfg, struct bpf_insn *insn, unsigned int len) in cfg_build() argument
338 INIT_LIST_HEAD(&cfg->funcs); in cfg_build()
340 if (cfg_partition_funcs(cfg, insn, insn + cnt)) in cfg_build()
343 list_for_each_entry(func, &cfg->funcs, l) { in cfg_build()
354 static void cfg_destroy(struct cfg *cfg) in cfg_destroy() argument
358 list_for_each_entry_safe(func, func2, &cfg->funcs, l) { in cfg_destroy()
458 static void cfg_dump(struct cfg *cfg) in cfg_dump() argument
463 list_for_each_entry(func, &cfg->funcs, l) { in cfg_dump()
476 struct cfg cfg; in dump_xlated_cfg() local
478 memset(&cfg, 0, sizeof(cfg)); in dump_xlated_cfg()
479 if (cfg_build(&cfg, insn, len)) in dump_xlated_cfg()
482 cfg_dump(&cfg); in dump_xlated_cfg()
484 cfg_destroy(&cfg); in dump_xlated_cfg()