Design for Stash
Michael Elizabeth Chastain
<mec@duracef.shout.net>
Sat 18 Nov 1995

Copyright 1995 Michael Chastain
Licensed under the Gnu Public License, Version 2



The 'medium stash' is the current facility for holding datasets on
replay for 'execve' and 'uselib'.  The 'big stash' will be a shared
repository for datasets.

These are notes for the big stash.



Name space

    $FIRE_STASH/$hostname/$%name/$time-$pid

	$FIRE_STASH	environment variable
			defaults to $HOME/fire-stash
	$hostname	hostname of trace target machine
	$%name		%name of dataset (e.g. '%lib/%libc.so.4')
	$time		time of EvSci
	$pid		pid of tracer process (or target)



FetchOutExecve
FetchOutUselib

    if ( !isScrError( ) )
    {
	mmap in the file
	mkdir $hostname        ; chmod 1777
	mkdir $hostname/$%name ; chmod 1777
	look for existing match
	    $hostname/$%name/*-*
	if exist and size is same
	    mmap in
	    memcmp
	if match
	    hard link
	if no match
	    write new TMP+$pid
	    chmod and utime to match
	    rename TMP+$pid $time-$pid
    }



ScLine::smashProc case tySmashFile0

    ln -s $hostname/$%name/$time-$pid /tmp/smash-$pid/$%name
	Ok if this fails
	On the store-out side, fCompare_ is good.
    Reset after wait as usual.
	I could make reset stateless -> more expensive though.

