Openembedded Core Discussions
 help / color / mirror / Atom feed
From: "Seebs" <seebs@seebs.net>
To: Richard Purdie <richard.purdie@linuxfoundation.org>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH 2/9] pseudo: Add support for ignoring paths from the pseudo DB
Date: Mon, 12 Oct 2020 14:31:37 -0500	[thread overview]
Message-ID: <20201012143137.6b4cbe34@seebsdell> (raw)
In-Reply-To: <20201007101449.3132127-2-richard.purdie@linuxfoundation.org>

On Wed,  7 Oct 2020 11:14:42 +0100
Richard Purdie <richard.purdie@linuxfoundation.org> wrote:

> ++int pseudo_client_ignore_path_chroot(const char *path, int
> ignore_chroot) { ++	char *env;
> ++	if (path) {
> ++		if (ignore_chroot && pseudo_chroot && strncmp(path,
> pseudo_chroot, pseudo_chroot_len) == 0) ++
> return 0; ++		env =
> pseudo_get_value("PSEUDO_IGNORE_PATHS"); ++		if (env) {
> ++			char *p = env;
> ++        	        while (*p) {
> ++				char *next = strchr(p, ',');
> ++				if (!next)
> ++				    next = strchr(p, '\0');
> ++				if ((next - p) && !strncmp(path, p,
> next - p)) { ++
> pseudo_debug(PDBGF_PATH | PDBGF_VERBOSE, "ignoring path: '%s'\n",
> path); ++					return 1;
> ++				} ++
> if (next && *next != '\0') ++
> p = next+1; ++				else
> ++					break;
> ++			}
> ++			free(env);
> ++		}
> ++	}
> ++	return 0;

This seems like it might merit caching; parse PSEUDO_IGNORE_PATHS at
startup, build a table of paths (and probably their lengths), and use
those? Seems like there's gonna be a LOT of hits on this.

Apart from that, this looks plausible. It's certainly a large change,
but I do think that reducing the size of the database like this is
probably a big win.

-s

  reply	other threads:[~2020-10-12 19:31 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-07 10:14 [PATCH 1/9] pseudo: Ignore mismatched inodes from the db Richard Purdie
2020-10-07 10:14 ` [PATCH 2/9] pseudo: Add support for ignoring paths from the pseudo DB Richard Purdie
2020-10-12 19:31   ` Seebs [this message]
2020-10-12 20:48     ` Richard Purdie
2020-10-07 10:14 ` [PATCH 3/9] pseudo: Abort on mismatch patch Richard Purdie
2020-10-07 10:14 ` [PATCH 4/9] psuedo: Add tracking of linked files for fds Richard Purdie
2020-10-12 19:27   ` Seebs
2020-10-07 10:14 ` [PATCH 5/9] pseudo: Fix xattr segfault Richard Purdie
2020-10-12 19:22   ` Seebs
2020-10-07 10:14 ` [PATCH 6/9] pseudo: Add may unlink patch Richard Purdie
2020-10-12 19:20   ` Seebs
2020-10-12 20:33     ` Richard Purdie
2020-10-07 10:14 ` [PATCH 7/9] pseudo: Add pathfix patch Richard Purdie
2020-10-07 10:14 ` [PATCH 8/9] base/bitbake.conf: Enable pseudo path filtering Richard Purdie
2020-10-07 10:14 ` [PATCH 9/9] wic: Handle new PSEUDO_IGNORE_PATHS variable Richard Purdie

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=20201012143137.6b4cbe34@seebsdell \
    --to=seebs@seebs.net \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=richard.purdie@linuxfoundation.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox