LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 03-15-2013, 11:46 AM   #1
VisionIncision
Member
 
Registered: Dec 2011
Location: Wiltshire, UK
Distribution: Slackware, Gentoo
Posts: 130

Rep: Reputation: 3
Obtaining memory access information


Hi all,
I have an idea for a project, a very cool project. Is there any way to obtain detailed memory access information for a given process or set of processes. I would need to encode the data for use in Machine Learning algorithms, particularly those pertaining to Artificial Neural Networks.

Thanks,
Jack Hunt
 
Old 03-15-2013, 12:56 PM   #2
sunnydrake
Member
 
Registered: Jul 2009
Location: Kiev,Ukraine
Distribution: Ubuntu,Slax,RedHat
Posts: 289
Blog Entries: 1

Rep: Reputation: 61
gdb, /proc/"pid"
 
Old 03-15-2013, 01:06 PM   #3
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
The usual problem is "it depends".

It depends on what you mean by "memory access information".

Basic paging statistics are available...

The usual problem with trying to use them is that the information is too coarse for any real use other than crudely optimizing the paging algorithm.

One example of a problem of insufficient data has to do with identifying if a page has been modified. To do it right requires hardware. HOWEVER, it can be done by software - by making all pages read only... if a write fault occurs, AND the OS has designated the page to be writable, then the page is made r/w, and the OS data marks it as "dirty"... then the interrupt is dismissed, and the instruction retried.

Slow... but workable. Use for statistics? really bad. frequently you would like to know "how often" is a page written to, how long between writes... to get that detailed amount of information really really needs hardware.
The next problem is that if you actually get enough information for good use, it comes way too fast (such as a program counter trace) for any use. Computing a modified paging algorithm takes longer than it takes the application being traced to run...

Most that I've met take a paging statistics snapshot once every 5-10 seconds, then spends a half second to compute updates...

Last edited by jpollard; 03-15-2013 at 01:14 PM. Reason: small followup.
 
Old 03-16-2013, 02:54 AM   #4
sunnydrake
Member
 
Registered: Jul 2009
Location: Kiev,Ukraine
Distribution: Ubuntu,Slax,RedHat
Posts: 289
Blog Entries: 1

Rep: Reputation: 61
another approach is to gather executable/loaded opcodes memory access instructions statistics/modify executable to add statistics info before memory access..
 
Old 03-16-2013, 09:13 AM   #5
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,780

Rep: Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081
Valgrind might be useful for this:
Quote:
Valgrind is an instrumentation framework for building dynamic analysis tools.
Memcheck is one of the tools that comes with Valgrind:
Quote:
When a program is run under Memcheck's supervision, all reads and writes of memory are checked, and calls to malloc/new/free/delete are intercepted.
...
Memcheck runs programs about 10--30x slower than normal.
 
Old 03-18-2013, 04:13 PM   #6
VisionIncision
Member
 
Registered: Dec 2011
Location: Wiltshire, UK
Distribution: Slackware, Gentoo
Posts: 130

Original Poster
Rep: Reputation: 3
Ah ok, looks as if I wont be able to do what I need to do. Thanks guys.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Obtaining access to file in chroot environment from usual root... acc_Wk Programming 6 08-01-2011 07:55 AM
Obtaining Adequate Network Information Woodsman Slackware 9 10-19-2006 05:12 AM
Obtaining permissions to access the X server through my Konsole Newbie101 Linux - Software 1 11-14-2004 08:40 AM
obtaining information about controlling devices infamous41md Programming 2 03-07-2004 12:24 PM
RH 8.0 Mapping Virtual Memory to get access to VMIC Reflective Memory PCI card. Merlin53 Linux - Hardware 0 05-05-2003 12:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 12:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration