From a4b1a95434b90ed147e33363d92e24a035b6b775 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Thu, 8 Jan 2009 20:53:26 -0800 Subject: [PATCH] Make -k/-K prune "source" subdirectory. --- libdwfl/ChangeLog | 6 ++++++ libdwfl/linux-kernel-modules.c | 18 ++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog index 0e3768628..2ddfc3afa 100644 --- a/libdwfl/ChangeLog +++ b/libdwfl/ChangeLog @@ -1,3 +1,9 @@ +2009-01-08 Roland McGrath + + * linux-kernel-modules.c (dwfl_linux_kernel_report_offline): + Skip subdirectory named "source". + (dwfl_linux_kernel_find_elf): Likewise. + 2009-01-06 Roland McGrath * linux-kernel-modules.c (check_suffix): New function. diff --git a/libdwfl/linux-kernel-modules.c b/libdwfl/linux-kernel-modules.c index 753e9bc91..e07073cdf 100644 --- a/libdwfl/linux-kernel-modules.c +++ b/libdwfl/linux-kernel-modules.c @@ -319,6 +319,15 @@ dwfl_linux_kernel_report_offline (Dwfl *dwfl, const char *release, FTSENT *f; while ((f = fts_read (fts)) != NULL) { + /* Skip a "source" subtree, which tends to be large. + This insane hard-coding of names is what depmod does too. */ + if (f->fts_namelen == sizeof "source" - 1 + && !strcmp (f->fts_name, "source")) + { + fts_set (fts, f, FTS_SKIP); + continue; + } + switch (f->fts_info) { case FTS_F: @@ -682,6 +691,15 @@ dwfl_linux_kernel_find_elf (Dwfl_Module *mod, int error = ENOENT; while ((f = fts_read (fts)) != NULL) { + /* Skip a "source" subtree, which tends to be large. + This insane hard-coding of names is what depmod does too. */ + if (f->fts_namelen == sizeof "source" - 1 + && !strcmp (f->fts_name, "source")) + { + fts_set (fts, f, FTS_SKIP); + continue; + } + error = ENOENT; switch (f->fts_info) { -- 2.47.2