Commit 51eb6dec authored by Brendan Gregg's avatar Brendan Gregg

print newline for empty maps

parent 9196c222
...@@ -423,6 +423,7 @@ int BPFtrace::print_maps() ...@@ -423,6 +423,7 @@ int BPFtrace::print_maps()
err = print_map_stats(map); err = print_map_stats(map);
else else
err = print_map(map, 0, 0); err = print_map(map, 0, 0);
std::cout << std::endl;
if (err) if (err)
return err; return err;
...@@ -638,9 +639,10 @@ int BPFtrace::print_map(IMap &map, uint32_t top, uint32_t div) ...@@ -638,9 +639,10 @@ int BPFtrace::print_map(IMap &map, uint32_t top, uint32_t div)
if (top) if (top)
{ {
if (i++ < (values_by_key.size() - top)) if (i < (values_by_key.size() - top))
continue; continue;
} }
i++;
std::cout << map.name_ << map.key_.argument_value_list(*this, key) << ": "; std::cout << map.name_ << map.key_.argument_value_list(*this, key) << ": ";
...@@ -665,7 +667,7 @@ int BPFtrace::print_map(IMap &map, uint32_t top, uint32_t div) ...@@ -665,7 +667,7 @@ int BPFtrace::print_map(IMap &map, uint32_t top, uint32_t div)
else else
std::cout << *(int64_t*)value.data() / div << std::endl; std::cout << *(int64_t*)value.data() / div << std::endl;
} }
if (i == 0)
std::cout << std::endl; std::cout << std::endl;
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment