aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2011-02-18typoPSEUDO_PORTSSeebs
2011-02-17move fopen to unixSeebs
2011-02-17works on darwinSeebs
2011-02-17okay, builds *cleanly* on Darwin nowSeebs
2011-02-17revert to real_foo now that it worksSeebs
2011-02-17fix reliance on real_stat() for linux portPeter Seebach
2011-02-17yet more ports work, linux seems to be running decently againPeter Seebach
2011-02-17fix up memory allocation problem and difficulty unloadingPeter Seebach
2011-02-17force generation of wrappers firstSeebs
2011-02-16cleanup after initial porting workPeter Seebach
2011-02-16yet another passSeebs
2011-02-16pass 4 of portsPeter Seebach
2011-02-15pass 3 -- now actually failsSeebs
2011-02-15part 2 of ports workSeebs
2011-02-14part 2 of portsPeter Seebach
2011-02-14First part of ports designPeter Seebach
2011-02-10Whoops! If LOCALSTATEDIR doesn't exist, and you invoke pseudoPeter Seebach
directly rather than via an on-demand spawn from the client, the directory is never created.
2011-02-09database initialization cleanup.Peter Seebach
2011-02-08Expand paths on exec.Peter Seebach
This is fussy, because we have to actually do the path search ourselves as best we can to handle unqualified paths. The result, though, is more meaningful logs. Along the way, fix some bitrot in the comments in pseudo_fix_path and friends.
2011-02-01... and pseudodb needs -ldlpseudo-1.0PSEUDO_1_0Peter Seebach
2011-02-01Oh, sqlite needs -lpthread sometimesPeter Seebach
2011-02-01Add performance test (rough draft).Peter Seebach
2011-02-01Fix linkage issues due to missing -ldlPeter Seebach
2011-01-24Revert "Add a cache of the last object found in pseudo_op"Mark Hatle
This reverts commit 49d4d35918d457b0e9206679ecad3b9c84f11e66.
2011-01-18Do not cache OP_EXEC callsMark Hatle
The cached data values were being collected when an OP_EXEC call was made. This is incorrect as the values are only for logging purposes. It's believed this caused an occasional crash in certain instances. Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2011-01-14Automatically create state/prefix directoriesPeter Seebach
It'd be handy for the WR build system if new state directories could be created as needed. It is made so. And to answer the first question everyone, including me, has on reading this: You can't do system("mkdir -p ...") because the invoked shell would need to run under pseudo, so it'd have to check for a server, and...
2011-01-13ChangeLog for previous fixPeter Seebach
2011-01-13Fixup: The path code could double-free.Peter Seebach
The problem is that path_by_ino could end up being the same pointer as cache_path, after which, if cache_path were freed (or kept around for later), there would be malloc arena problems. Also, fix the calculation for pathlen to increase cache hits. The IPC messages use length of path *plus one* as the length, because the buffer is defined to include its terminating null byte.
2010-12-17Fix the msg cache codeMark Hatle
The pathlen that is cached could be wrong in certain operations (RENAME). Fix this by resetting it to the proper path length. Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2010-12-17When pseudo is disabled avoid directory processing...Mark Hatle
When pseudo is disabled, we skip a bunch of the prefix, localstate, etc processing. This allows pseudo to run with a directory that does not yet exist. Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2010-12-16The maketables thing made it possible for some modules to get builtPeter Seebach
before pseudo_tables.h existed. Fixed.
2010-12-16update docs to eliminate claims that we don't have chrootPeter Seebach
2010-12-16Change the file journal from PERSIST to OFFMark Hatle
Changing the file journal to OFF, this makes things a bit more susceptible to failure in cases where pseudo crashes or the system crashes.. however, this is believed to be unlikely. Timing: Before: real 6m42.093s user 0m34.321s sys 2m46.086s (with journal set to MEMORY) real 6m33.037s user 0m33.133s sys 2m48.668s After (journal set to OFF) real 6m17.313s user 0m32.757s sys 2m47.654s Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2010-12-16Optimize the sql database indexes differently...Mark Hatle
We change the index from simply "path" to "path, dev, ino". This allows for slightly faster searches for the exact file information, and does not cause any penalty for a simple "path" based search. Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2010-12-16Add a cache of the last object found in pseudo_opMark Hatle
Add a cache of the last object found in pseudo_op. Profiling has indiciated that many operations come in clusters. So instead of doing select, operation for each item in the cluster, we check to see if we already know the item and perform the op.. Performance improvement when processing 500k or so files: Previous: real 7m11.778s user 0m35.929s sys 2m46.723s This commit: real 6m42.093s user 0m34.321s sys 2m46.086s Also validation of the component can be added by compiling with NVALIDATE. This verifies the result of the cache is the same as what would have come from the database. Differences are logged to the standard pseudo.log. Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2010-12-16Restructure the pseudo_op file identificationMark Hatle
We restructure the pseudo_op file identification, which involves a fairly significant performance increase. The old method would do: if pdb_find_file_path: found_path = 1; if found_path && pdb_find_file_exact: found_ino = 1; else if pdb_find_file_dev: found_ino = 1; This resulted in at least two select calls for each file. One for "path" and one for exact or dev. The new method instead does: if pdb_find_file_exact: found_path = 1; found_ino = 1; else if pdb_find_file_path: found_path = 1; if pdb_find_file_dev: found_ino = 1; This shrinks the number of selects to either one or three. Potentially cutting the number of selects in half -- or increasing the number to three on an empty set... (Profiling has shown this is a net win) Timing numbers when manipulating a large number (500k) of files in a ramdisk: real 7m48.354s user 0m32.895s sys 2m50.274s After this change: real 7m11.778s user 0m35.929s sys 2m46.723s Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2010-12-16Add sqlite call profilingMark Hatle
Add sqlite call profiling, this allows us to see the sqlite calls that are being made as the system runs, via the pseudo log. It was noted that by this profiling that a small change to pseudo.c, when a file was found, reduced the sqlite SELECT calls by about 1/3. Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2010-12-16Restructure wrapfuncs.cMark Hatle
Restructure wrapfuncs.c in an attempt to improve PSEUDO_DISABLED=1 performance. Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2010-12-13Further amend the system to enable/disable sudo during fork/exec.Mark Hatle
2010-12-09: * (mhatle) Add doc/program_flow to attempt to explain startup/running * (mhatle) guts/* minor cleanup * (mhatle) Reorganize into a new constructor for libpseudo ONLY pseudo main() now manually calls the util init new / revised init for client, wrappers and utils * (mhatle) Add central "reinit" function * (mhatle) Add manul execv* functions * (mhatle) rename pseudo_populate_wrappers to pseudo_check_wrappers Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2010-12-132010-12-08:Mark Hatle
* (mhatle) Add guts/clone.c to cleanup the clone support * (mhatle) guts/clone.c only run setupenv and reinit when NOT PSEUDO_RELOADED * (mhatle) guts/execve.c whitespace fixe * (mhatle) guts/fork.c similar to guts/clone.c change * (mhatle) pseudo_client.c add reinit function * (mhatle) pseudo_client.c revise client reset, include code from pseudo_wrappers.c * (mhatle) pseudo_server.c move the pid writing to the parent * (mhatle) pseudo_wrappers.c clone cleanup and populate cleanup Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2010-12-07This is a merge of several commits from a tree which turned out toPeter Seebach
be out of sync in a very inconvenient way. Changes include: * Some whitespace fixes, also move the pseudo_variables definition into pseudo_util.c since it's not used anywhere else. * Further improvements in the fork() support: We now recognize both positive and negative forms of PSEUDO_DISABLED, so we can distinguish between "it was removed from the environment by env -i" (restore the old value) and "it was intentionally turned off" (the new value wins). * clone(2) support. This is a little primitive, and programs might still fail horribly due to clone's semantics, but at least it's there and passes easy test cases. Plus a big patch from Mark Hatle: Cleanup fork/clone and PSEUDO_DISABLED guts/fork.c: * cleanup function and make it more robust * be sure to call pseudo_setupenv prior to pseudo_client_reset to match exec behavior pseudo_wrappers.c: * fix mismatched type in execl_to_v call via typecast * Simplify fork call via single call to wrap_fork() * be sure to save pseudo_disabled * be sure to call pseudo_setupenv prior to pseudo_client_reset to match exec behavior tests: * Add a test of whether pseudo can be disabled/enabled on a fork. Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2010-12-02Major shift: Fix execl*(), allow enabling/disabling pseudo withPeter Seebach
an environment variable across fork(). This does a couple of things. One is, move the fork/vfork and execl* functions out of the standard wrapper environment. Having done that, the execl*() wrappers are rewritten so they can use real_execv*() when running in antimagic mode. This allows us to run pseudo entirely in antimagic mode. Which is handy, because we also add support for enabling/disabling antimagic mode in the child process on a fork, using an additional hook for this in the pseudo_client_init() routine. The redone fork() wrapper now calls pseudo_client_init() in the child process after a successful fork even if it's in antimagic mode already. This is not yet well-tested.
2010-12-02The pseudo_db.c file created tables (operations, etc.) in the logsPeter Seebach
database to preserve the meaning of log messages in old databases in case of renumbering... but these tables were never used, and the tables used to create them were, in fact, out of date and inconsistent with the range of operations now supported. Remove the vestigial remains of the never-implemented feature. Also, update .gitignore to stop git from complaining about some more generated files.
2010-11-30Major shift: All the id_t types have been reworked so that theyPeter Seebach
are generated from text files and templates, making it now (we hope) impossible for the list of strings to get out of sync with the enum.
2010-11-18Messing with makewrappers: Move templating code out (for planned usePeter Seebach
in an incoming "maketables".)
2010-11-17Add "Futures.txt" for notes about planned work.Peter Seebach
2010-11-17First pass of some cleanups -- support moving a tracked directory fromPeter Seebach
one device to another, for instance.
2010-10-25Clean up makewrappers a bit.Peter Seebach
2010-10-12Remove tabs from makewrappers.Peter Seebach
2010-10-12Was missing copyright in new makewrappers.Peter Seebach