utility 'as'

Hi…

I have an embedded system here (rtp6.2), and in /proc/ I see a number
of files, inside each one of them, there is a file called ‘as’. What is
this? These files increase in both number and size, what is this, and
why do we have this behavior?

(Note: a search in the news groups is useless since so many entries come
up with ‘as’…)

Thanks for any help on this…

Regards…

Miguel.

go it.

as = address space, and the folder names are pid numbers.

M.


Miguel Simon wrote:

Hi…

I have an embedded system here (rtp6.2), and in /proc/ I see a number
of files, inside each one of them, there is a file called ‘as’. What is
this? These files increase in both number and size, what is this, and
why do we have this behavior?

(Note: a search in the news groups is useless since so many entries come
up with ‘as’…)

Thanks for any help on this…

Regards…

Miguel.

Miguel Simon <simon@ou.edu> wrote:

go it.

as = address space, and the folder names are pid numbers.

And, if you open /proc/pid/as, and seek to a location, and then
issue a read(), you will get the memory contents of that process
from that address.

Pretty nifty, hunh?

-David

QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.

Hi David…



David Gibbs wrote:

Miguel Simon <> simon@ou.edu> > wrote:

go it.


as = address space, and the folder names are pid numbers.


And, if you open /proc/pid/as, and seek to a location, and then
issue a read(), you will get the memory contents of that process
from that address.

When you say ‘seek to a location’, how do I know which location
corresponds to which process? Do you have a sample code somewhere?


Pretty nifty, hunh?

Yup. I have been looking for something like this, I think. I have
another question: since I have the .elf file from a compiled source, I
wonder if you have some comments on how I could utilize this information
to retrieve memory content from /proc/pid/as?

Thanks…

Miguel.

-David

Miguel Simon <simon@ou.edu> wrote:

Hi David…



David Gibbs wrote:
Miguel Simon <> simon@ou.edu> > wrote:

go it.


as = address space, and the folder names are pid numbers.


And, if you open /proc/pid/as, and seek to a location, and then
issue a read(), you will get the memory contents of that process
from that address.

When you say ‘seek to a location’, how do I know which location
corresponds to which process? Do you have a sample code somewhere?

Look on the www.parse.com/books/book_v2 “cookbook” site – the sample
chapter does just that – digs into the “as” address space file to
get a thread fingerprint… There’s a complete commented code walkthrough.

Cheers,
-RK

Robert Krten, PARSE Software Devices +1 613 599 8316.
Realtime Systems Architecture, Books, Video-based and Instructor-led
Training and Consulting at www.parse.com.
Email my initials at parse dot com.

Miguel Simon <simon@ou.edu> wrote:

Hi David…



David Gibbs wrote:
Miguel Simon <> simon@ou.edu> > wrote:

go it.


as = address space, and the folder names are pid numbers.


And, if you open /proc/pid/as, and seek to a location, and then
issue a read(), you will get the memory contents of that process
from that address.

When you say ‘seek to a location’, how do I know which location
corresponds to which process? Do you have a sample code somewhere?

/proc/pid → that tells you which process.

When I say seek, I mean do an lseek() to a value. This corresponds
to a virtual address in the process pid.

read() then returns the contents of the virtual memory address that
you seeked to in process pid.

Pretty nifty, hunh?

Yup. I have been looking for something like this, I think. I have
another question: since I have the .elf file from a compiled source, I
wonder if you have some comments on how I could utilize this information
to retrieve memory content from /proc/pid/as?

Not off-hand. You might actually need to use the debug information.
(I don’t know much about ELF, or how things get loaded.)

-David

QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.