Skip to content

Commit

Permalink
Update logging to VLOG and address other feedback
Browse files Browse the repository at this point in the history
Signed-off-by: Dom Del Nano <[email protected]>
  • Loading branch information
ddelnano committed Oct 11, 2024
1 parent 0322c23 commit ed7b839
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/stirling/utils/linux_headers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -231,15 +231,16 @@ StatusOr<std::filesystem::path> ResolvePossibleSymlinkToHostPath(const std::file

// Relative paths containing "../" can result in an invalid host mount path when using
// ToHostPath. Therefore, we need to treat the absolute and relative cases differently.
std::filesystem::path resolved_host_path = p.parent_path();
std::filesystem::path resolved_host_path;
if (resolved.is_absolute()) {
resolved_host_path = system::Config::GetInstance().ToHostPath(resolved);
LOG(INFO) << absl::Substitute(
VLOG(1) << absl::Substitute(
"Symlink target is an absolute path. Converting that to host path: $0 -> $1.",
resolved.string(), resolved_host_path.string());
} else {
resolved_host_path = p.parent_path();
resolved_host_path /= resolved.string();
LOG(INFO) << absl::Substitute(
VLOG(1) << absl::Substitute(
"Symlink target is a relative path. Concatenating it to parent directory: $0",
resolved_host_path.string());
}
Expand Down

0 comments on commit ed7b839

Please sign in to comment.