All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Ingo Molnar <mingo@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	James Clark <james.clark@linaro.org>,
	Jiri Olsa <jolsa@kernel.org>, Ian Rogers <irogers@google.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Clark Williams <williams@redhat.com>,
	linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	sashiko-bot <sashiko-bot@kernel.org>,
	"Zhang, Yanmin" <yanmin_zhang@linux.intel.com>
Subject: [PATCH 5/8] perf machine: Don't abort guest map creation on first inaccessible dir
Date: Sun, 26 Jul 2026 20:40:11 -0300	[thread overview]
Message-ID: <20260726234014.63111-6-acme@kernel.org> (raw)
In-Reply-To: <20260726234014.63111-1-acme@kernel.org>

From: Arnaldo Carvalho de Melo <acme@redhat.com>

machines__create_guest_kernel_maps() jumps to the failure label when one
guest directory's kallsyms file fails access(), skipping all remaining
valid guest directories.  An inaccessible directory is not fatal — other
guests may still be reachable.

Replace 'goto failure' with 'continue' so the loop processes all
directories, and remove the now-unreferenced failure label.

Fixes: a1645ce12adb ("perf: 'perf kvm' tool for monitoring guest performance from host")
Reported-by: sashiko-bot <sashiko-bot@kernel.org>
Cc: Zhang, Yanmin <yanmin_zhang@linux.intel.com>
Assisted-by: Claude:claude-opus-4.6
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/machine.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index 05724277c2a9753c..83d38637afe34fc9 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -1269,14 +1269,12 @@ int machines__create_guest_kernel_maps(struct machines *machines)
 			snprintf(path, sizeof(path), "%s/%s/proc/kallsyms",
 				 symbol_conf.guestmount,
 				 namelist[i]->d_name);
-			ret = access(path, R_OK);
-			if (ret) {
+			if (access(path, R_OK)) {
 				pr_debug("Can't access file %s\n", path);
-				goto failure;
+				continue;
 			}
 			machines__create_kernel_maps(machines, pid);
 		}
-failure:
 		free(namelist);
 	}
 
-- 
2.55.0


  parent reply	other threads:[~2026-07-26 23:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-26 23:40 [PATCHES 0/8 v1] perf machine fixes Arnaldo Carvalho de Melo
2026-07-26 23:40 ` [PATCH 1/8] perf machine: Fix fd leak on bounds check in maps__set_modules_path_dir() Arnaldo Carvalho de Melo
2026-07-26 23:40 ` [PATCH 2/8] perf machine: Fix NULL parent dereference in fork event processing Arnaldo Carvalho de Melo
2026-07-26 23:54   ` sashiko-bot
2026-07-26 23:40 ` [PATCH 3/8] perf machine: Guard against NULL strlist in machines__findnew() Arnaldo Carvalho de Melo
2026-07-26 23:40 ` [PATCH 4/8] perf machine: Check snprintf truncation " Arnaldo Carvalho de Melo
2026-07-26 23:51   ` sashiko-bot
2026-07-26 23:40 ` Arnaldo Carvalho de Melo [this message]
2026-07-26 23:50   ` [PATCH 5/8] perf machine: Don't abort guest map creation on first inaccessible dir sashiko-bot
2026-07-26 23:40 ` [PATCH 6/8] perf machine: Reset errno before strtol in guest kernel map creation Arnaldo Carvalho de Melo
2026-07-26 23:49   ` sashiko-bot
2026-07-26 23:40 ` [PATCH 7/8] perf machine: Free scandir entries " Arnaldo Carvalho de Melo
2026-07-26 23:51   ` sashiko-bot
2026-07-26 23:40 ` [PATCH 8/8] perf machine: Check snprintf truncation for guest kallsyms path Arnaldo Carvalho de Melo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260726234014.63111-6-acme@kernel.org \
    --to=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=adrian.hunter@intel.com \
    --cc=irogers@google.com \
    --cc=james.clark@linaro.org \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=sashiko-bot@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=williams@redhat.com \
    --cc=yanmin_zhang@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.