FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 10-01-2010, 03:29 PM
Al
 
Default oder of files opened by a process

Hello,

I want to find out by which file and line the */temp/environment
script is run or sourced.

As a am always interested in a general way to solve something, I ask
if there is a tool, that displays me the order in which files are
read by a process.

Al
 
Old 10-01-2010, 04:29 PM
Dale
 
Default oder of files opened by a process

Al wrote:

Hello,

I want to find out by which file and line the */temp/environment
script is run or sourced.

As a am always interested in a general way to solve something, I ask
if there is a tool, that displays me the order in which files are
read by a process.

Al




I'm not sure but you may want to check into strace. It may be what you
are looking for.


* dev-util/strace
Available versions: 4.5.18 4.5.19 ~4.5.20 {aio static}
Homepage: http://sourceforge.net/projects/strace/
Description: A useful diagnostic, instructional, and
debugging tool


Hope that helps.

Dale

:-) :-)
 
Old 10-01-2010, 05:00 PM
Darren Kirby
 
Default oder of files opened by a process

On Fri, Oct 1, 2010 at 10:29 AM, Dale <rdalek1967@gmail.com> wrote:
> Al wrote:
>>
>> Hello,
>>
>> I want to find out by which file and line the */temp/environment
>> script is run or sourced.
>>
>> As a am always interested in a general way to solve something, I ask
>> if there is a tool, that displays me the order in which *files are
>> read by a process.
>>
>> Al
>>
>>
>
> I'm not sure but you may want to check into strace. *It may be what you are
> looking for.
>

strace may do the job in a pinch, but there is almost certainly
something better suited to the task...however I don't know what it is.
You may want to use like this:

$ strace YourScript 2>&1 | grep open

which will run YourScript and print all open() system calls to the
console. You will have to sort through many unrelated calls (such as
reading shared library calls) but it will show the order in which your
script is opening external files. Presumably you could key in on the
relevant files using more grep calls and pipes...

>
> Dale
>
> :-) *:-)
>
>


D
--
--
Support the mob or mysteriously disappear...
I'm on flickr: http://www.flickr.com/photos/badcomputer/
 
Old 10-01-2010, 05:25 PM
Al
 
Default oder of files opened by a process

>
> I'm not sure but you may want to check into strace. *It may be what you are
> looking for.
>
> * dev-util/strace
> * * Available versions: *4.5.18 4.5.19 ~4.5.20 {aio static}
> * * Homepage: * * * * * *http://sourceforge.net/projects/strace/
> * * Description: * * * * A useful diagnostic, instructional, and debugging
> tool
>
> Hope that helps.

Arrrgh,

configure: error: operating system cygwin is not supported by strace

Any windows alternative?

Al
 
Old 10-01-2010, 05:51 PM
walt
 
Default oder of files opened by a process

On 10/01/2010 10:25 AM, Al wrote:



configure: error: operating system cygwin is not supported by strace

Any windows alternative?


This may be overkill for your purpose, but it's a great tool:

http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx
 
Old 10-01-2010, 06:14 PM
Dale
 
Default oder of files opened by a process

Al wrote:

I'm not sure but you may want to check into strace. It may be what you are
looking for.

* dev-util/strace
Available versions: 4.5.18 4.5.19 ~4.5.20 {aio static}
Homepage: http://sourceforge.net/projects/strace/
Description: A useful diagnostic, instructional, and debugging
tool

Hope that helps.


Arrrgh,

configure: error: operating system cygwin is not supported by strace

Any windows alternative?

Al




I have no ideas on windoze. I don't have it here and try to stay away
from it when possible. I just assumed since you posted on a Linux list
and there was no mention of windoze in the original post that you were
looking for a Linux tool.


Can't help you there. Sorry.

Dale

:-) :-)
 
Old 10-01-2010, 06:35 PM
Grant Edwards
 
Default oder of files opened by a process

On 2010-10-01, Dale <rdalek1967@gmail.com> wrote:
> Al wrote:
>> Hello,
>>
>> I want to find out by which file and line the */temp/environment
>> script is run or sourced.
>>
>> As a am always interested in a general way to solve something, I ask
>> if there is a tool, that displays me the order in which files are
>> read by a process.

> I'm not sure but you may want to check into strace. It may be what you
> are looking for.

strace fills the bill if you know what process (or its children) you
want to watch, and you can start that process manually.

If you don't know what process you want to watch, or there are a set
of unrelated processes, strace isn't very useful. In that case you
can use systemtap to monitor open operations on a particular file.

It takes a bit more work to use systemtap than it does to use strace,
but in many ways it's a lot more flexible and powerful:

http://sourceware.org/systemtap/

--
Grant Edwards grant.b.edwards Yow! And then we could sit
at on the hoods of cars at
gmail.com stop lights!
 
Old 10-01-2010, 06:36 PM
Grant Edwards
 
Default oder of files opened by a process

On 2010-10-01, Al <oss.elmar@googlemail.com> wrote:
>>
>> I'm not sure but you may want to check into strace. ?It may be what you are
>> looking for.
>>
>> * dev-util/strace
>> ? ? Available versions: ?4.5.18 4.5.19 ~4.5.20 {aio static}
>> ? ? Homepage: ? ? ? ? ? ?http://sourceforge.net/projects/strace/
>> ? ? Description: ? ? ? ? A useful diagnostic, instructional, and debugging
>> tool
>>
>> Hope that helps.
>
> Arrrgh,
>
> configure: error: operating system cygwin is not supported by strace
>
> Any windows alternative?

Perhaps you'd be better off asking in a Cygwin/Windows forum than a
Linux one?

--
Grant Edwards grant.b.edwards Yow! I'm reporting for duty
at as a modern person. I want
gmail.com to do the Latin Hustle now!
 
Old 10-01-2010, 06:38 PM
Al
 
Default oder of files opened by a process

Thanks, it was a good suggestion anyway and I will use it the next
time I run on Linux.

>
> I have no ideas on windoze. *I don't have it here and try to stay away from
> it when possible. *I just assumed since you posted on a Linux list and there
> was no mention of windoze in the original post that you were looking for a
> Linux tool.

Ooops, I was convinced this was the Gentoo user list.

You know Gentoo != Linux. But there is an intersection.

Al
 
Old 10-01-2010, 06:47 PM
Al
 
Default oder of files opened by a process

>
> Perhaps you'd be better off asking in a Cygwin/Windows forum than a
> Linux one?
>

Again, Gentoo != Linux.

But, you are right to suggest the Cygwin list. I didn't anticipate
that such a tool would depend on the kernel architecture. The posix
layer is there.

Al
 

Thread Tools




All times are GMT. The time now is 12:07 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org