From: Josef W. <Jos...@gm...> - 2003-04-27 14:31:38
|
On Tuesday 22 April 2003 00:19, Nicholas Nethercote wrote: > ... > > Nick, we should add a implementation of getcwd() to V, and use absolute > > file paths. But this still doesn't work with chroot() programs :-( > > Another option: --dumpfile-fd=... > > How's this for a better solution: let's abandon the creation of the > cachegrind.out.<pid> file at startup. Originally, Cachegrind aborted if > it couldn't open the cachegrind.out.<pid> file, and I put the > open-at-startup code in so that if it couldn't open the file, the abort > would happen at the start of execution, not at the end after waiting what > could be a long time. > > But then Cachegrind was changed so it didn't abort if the file couldn't be > opened, because sometimes with --trace-children=yes it happened often (I > can't remember why). > > So now there's absolutely no point in opening the file at the start and > then reopening it at the end. So I'd be happy to remove the opening at Yes. > the start. But, the cachegrind.out.<pid> file should really be written in > the directory the program was invoked from, regardless of any cwd change Yes again. To tell the true, the "--base=" CLO addition was a quick workaround for this problem, as there's no getcwd() in valgrind's libc. We should add it and use the cwd at program start as absolute path for the cachegrind.out files. > commands during execution, so the getcwd() implementation still seems like > a good idea. Does this sound sensible, Josef? I don't understand the > chroot() problem, can you explain it to me, and how it interacts here? After a chroot(), a process can only access files below the given root in chroot(), if the files wasn't opened already. E.g, when cachegrinding the FTP damon, you don't have access to the cwd at program start on dump time. But I think this is neglectable, as chroot() is rare. > > N > > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Valgrind-users mailing list > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-users |