Skip to content

Commit

Permalink
Fix linting issues
Browse files Browse the repository at this point in the history
Signed-off-by: Dom Del Nano <ddelnano@pixielabs.ai>
  • Loading branch information
ddelnano committed Aug 1, 2023
1 parent 67b1fe2 commit 67adcd6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions src/stirling/obj_tools/address_converter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ uint64_t ElfAddressConverter::BinaryAddrToVirtualAddr(uint64_t binary_addr) cons
return binary_addr - virtual_to_binary_addr_offset_;
}

StatusOr<uint32_t> GetProcMapsIndexForBinary(const std::string& binary_path, std::vector<ProcSMaps>& map_entries) {
StatusOr<uint32_t> GetProcMapsIndexForBinary(const std::string& binary_path,
std::vector<ProcSMaps>& map_entries) {
for (const auto& [idx, entry] : Enumerate(map_entries)) {
if (absl::EndsWith(binary_path, entry.pathname)) {
return idx;
Expand Down Expand Up @@ -92,7 +93,9 @@ StatusOr<std::unique_ptr<ElfAddressConverter>> ElfAddressConverter::Create(ElfRe
if (idx_status.ok()) {
map_entry = map_entries[idx_status.ConsumeValueOrDie()];
} else {
LOG(WARNING) << absl::Substitute("Failed to find match for $0 in /proc/$1/maps. Defaulting to the first entry", proc_exe.string(), pid);
LOG(WARNING) << absl::Substitute(
"Failed to find match for $0 in /proc/$1/maps. Defaulting to the first entry",
proc_exe.string(), pid);
}
const auto mapped_virt_addr = map_entry.vmem_start;
uint64_t mapped_offset;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ using px::stirling::obj_tools::SymbolMatchType;
int main() {
LOG(INFO) << "Running";

// This sleep is required otherwise when it is run inside a container (via ContainerRunner) we will
// fail to detect the child process's pid during the test case that uses this.
// This sleep is required otherwise when it is run inside a container (via ContainerRunner) we
// will fail to detect the child process's pid during the test case that uses this.
sleep(5);

std::filesystem::path self_path = GetSelfPath().ValueOrDie();
Expand Down

0 comments on commit 67adcd6

Please sign in to comment.