public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] tools-utils: Do not skip symbolic links when analyzing a linux tree
@ 2021-08-24 21:30 Matthias Maennich
  2021-09-01  8:53 ` Dodji Seketeli
  0 siblings, 1 reply; 2+ messages in thread
From: Matthias Maennich @ 2021-08-24 21:30 UTC (permalink / raw)
  To: libabigail; +Cc: dodji, gprocida, kernel-team, maennich

For various reasons, (parts of) a linux kernel tree containing vmlinux
and kernel modules might be organized using symbolic links. One reason
is that those binaries physically reside on a different storage and are
linked into place. To support such scenarios by allowing to traverse
symbolic links when discovering linux kernel binaries.

I could not see a reason why this was disabled in the first place.
Ignoring symbolic links had been the default since the inception of the
kernel mode.

Hence, allow valid symbolic links and that is what this patch does.

	* src/abg-tools-utils.cc (find_vmlinux_and_module_paths): Do not
	skip valid symbolic links.

Signed-off-by: Matthias Maennich <maennich@google.com>
---
 src/abg-tools-utils.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/abg-tools-utils.cc b/src/abg-tools-utils.cc
index 2fb20c6e9e2c..cc9a23ea3497 100644
--- a/src/abg-tools-utils.cc
+++ b/src/abg-tools-utils.cc
@@ -2298,8 +2298,8 @@ find_vmlinux_and_module_paths(const string&	from,
   FTSENT *entry;
   while ((entry = fts_read(file_hierarchy)))
     {
-      // Skip descendents of symbolic links.
-      if (entry->fts_info == FTS_SL || entry->fts_info == FTS_SLNONE)
+      // Skip descendents of dead symbolic links.
+      if (entry->fts_info == FTS_SLNONE)
 	{
 	  fts_set(file_hierarchy, entry, FTS_SKIP);
 	  continue;
-- 
2.33.0.rc2.250.ged5fa647cd-goog


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] tools-utils: Do not skip symbolic links when analyzing a linux tree
  2021-08-24 21:30 [PATCH] tools-utils: Do not skip symbolic links when analyzing a linux tree Matthias Maennich
@ 2021-09-01  8:53 ` Dodji Seketeli
  0 siblings, 0 replies; 2+ messages in thread
From: Dodji Seketeli @ 2021-09-01  8:53 UTC (permalink / raw)
  To: Matthias Maennich; +Cc: libabigail, gprocida, kernel-team

Hello Matthias,

Matthias Maennich <maennich@google.com> a écrit:

> For various reasons, (parts of) a linux kernel tree containing vmlinux
> and kernel modules might be organized using symbolic links. One reason
> is that those binaries physically reside on a different storage and are
> linked into place. To support such scenarios by allowing to traverse
> symbolic links when discovering linux kernel binaries.
>
> I could not see a reason why this was disabled in the first place.
> Ignoring symbolic links had been the default since the inception of the
> kernel mode.

Following symbolic link is disabled because there can be cases where the
link points to a directory of the kernel tree, causing cycles in the
tree.  In that case, fts_read can return the same file several times.

I seem to remember that it had noticeable performance impacts on the
tests I did with our kernels.

So to support symbolic link, we'd need to properly handle (avoid?) those
cycles, probably by taking into account the FTS_DC bit of the
FTSENT::fts_info data member.  I haven't looked into it in details,
though.

Have you seen the same think in those cases?

Thanks.

[...]

-- 
		Dodji

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-09-08 14:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-24 21:30 [PATCH] tools-utils: Do not skip symbolic links when analyzing a linux tree Matthias Maennich
2021-09-01  8:53 ` Dodji Seketeli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).