Skip to content

Commit

Permalink
adjust_head statistic is not cross-platform safe
Browse files Browse the repository at this point in the history
Replace with a stat counting calls that reallocate packet,
in a cross-platform way similar to the map_in_map stat.

Fixes vbpf#583

Signed-off-by: Dave Thaler <[email protected]>
  • Loading branch information
dthaler authored and elazarg committed Feb 12, 2024
1 parent b62f8f1 commit f2f284f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/asm_cfg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ std::vector<std::string> stats_headers() {
return {
"basic_blocks", "joins", "other", "jumps", "assign", "arith",
"load", "store", "load_store", "packet_access", "call_1", "call_mem",
"call_nomem", "adjust_head", "map_in_map", "arith64", "arith32",
"call_nomem", "reallocate", "map_in_map", "arith64", "arith32",
};
}

Expand All @@ -224,8 +224,8 @@ std::map<std::string, int> collect_stats(const cfg_t& cfg) {
}
if (std::holds_alternative<Call>(ins)) {
auto call = std::get<Call>(ins);
if (call.func == 43 || call.func == 44)
res["adjust_head"] = 1;
if (call.reallocate_packet)
res["reallocate"] = 1;
}
if (std::holds_alternative<Bin>(ins)) {
auto const& bin = std::get<Bin>(ins);
Expand Down

0 comments on commit f2f284f

Please sign in to comment.