How to collect all alterationof /proc/pid/pagemap in Linux - linux-kernel

I want to know all the virtual to physical address map information for a specific progress for all its life. So one way is to get all the alteration of the pagemap which is changing all the time.
One way come to me is to read the pagemap using loop to detect whether current pagemap is exactly the same as the former. If this realizable? or any other suggestions is appreciated. Thanks
Adam

Related

How to record access to virtual page of process in linux?

I want to track the access count of pages by a application with swap enable.
Does modify mark_page_accessed to implement it is possible?
Or other solution which is more elegant and convenient?
If it can be done in user space that would be better, plz give me some tips.
Thanks!
I have googled but could not find a specific solution.
It would be great if you can give some tips.
A smapling way works by clearing the pte bits constantly and Working Set Size (WSS) Tools (https://github.com/brendangregg/wss) is a good choice.

How can I track an event accross multiple resources in gem5?

I would like to know if there is a proper method to track memory accesses
across multiple resources at once. For example I set up a simple dual core CPU
by advancing the simple.py from learning gem5 (I just added another
TimingSimpleCPU and made the port connections).
I took a look at the different debug options and found for example the
MemoryAccess flag (and others), but this seemed to only show the accesses at
the DRAM or one other resource component.
Nevertheless I imagine a way to track events across CPU, bus and finally memory.
Does this feature already exist?
What can I try next? Is it and idea to add my own --debug-flag or can I work
with the TraceCPU for my specified use?
I haven't worked much with gem5 yet so I'm not sure how to achieve this. Since until now I only ran in SE mode is the FS mode a solution?
Finally I also found the TraceCPUData flag in the --debug-flags, but running
this with my config script created no output (like many other flags btw. ...).
It seems that this is a --debug-flag for the TraceCPU, what kind of output does this flag create and can it help me?

Program to identify if a file is not written

Firstly, I'm not a programmer so please excuse me if my question lacks technical accuracy.
Basically I have a situation where I have a camera recording a timelapse, taking a photograph at predetermined intervals (in this case 60 seconds) and then saving the image to a Dropbox folder.
I regularly monitor the Dropbox folder to ensure the images are being captured, but there have been situations where the camera has failed and I've not been aware for 24hours or so.
Ideally what I am looking for is a small program that can monitor the Dropbox folder and report back (perhaps by email) to say if an image capture has failed.
There are two parameters that I'd need to set; the interval (in this case every 60 seconds) and the period over which the camera is running (in this case 6am - 6pm).
I've managed to find several different programs that will monitor if a file is written to a folder, but not a program to determine if a file has NOT been written.
Just wanted to ask the community if this would be possible and whether anybody would be able to help?
Many thanks in advance for your advice.
Jamie
The only way to do this is to read the memory addresses and find if there is anything with the extension .temp. Other than that, you'd have to be on Linux.
Looping through memory, especially in this day and age with 32GB-64GB of RAM becoming commonplace, it is highly inefficient to do this.
Essentially, no, I don't believe there is any way to practically do this.

Which technique for locating many similar Base Pointer Adresses (fast)?

I try to catch some Base Pointer Adresses from a Windows Application which I want to Bot (Its not a game, Its an Online Broker). So, I know how to find Base Pointer Adresses, but I do this with Cheatengine (Find Adresses, set Breakpointes, search for the Output Adresses... and so on) - but this takes very much time for Base Pointers with 6+ Offsets. Maybe there is a much faster technique how to scrape them out of Memory?
And here is my presumption: In This Pic you can see, there are many similar Entrys (Forex Entrys), and they are all similar structured. They have a Adress for Ask-Value and Bid-Value - these are the Pointers I need! The Values are represented as Double. Maybe, I can find multiple Adresses at once, if I find the one from another. I thought on object oriented programing, where many Instances have Adresses nearby to the other. So, is there a way to find multiple at once, and fast?
I tried some stuff with OllyDbg, and didnt find some nearby (But my skills with OllyDbg are not insane, I still dont know all functions of it). Do you guys have a better solution, how I can find them faster? I dont really want to code some stuff in Assembler - but if nececary, I can do this. Would be great if you can help. There are 89 Entrys, and I will need per something like 20 - 30 minutes. Would be awful.
Cheers!
Filthy Frank
Using pointers and offsets is not the correct way to go about this. On the back end they're just using HTTP and an API. You should either use that directly or hook the function that does it and then work with the data right after it is received by the client.

windows memory managment: check if a page is in memory

Is there a way, in Windows, to check if a page in in memory or in disk(swap space)?
The reason I want know this is to avoid causing page fault if the page is in disk, by not accessing that page.
There is no documented way that I am aware of for accomplishing this in user mode.
That said, it is possible to determine this in kernel mode, but this would involve inspecting the Page Table Entries, which belong to the Memory Manager - not something that you really wouldn't want to do in any sort of production code.
What is the real problem you're trying to solve?
The whole point of Virtual Memory is to abstract this sort of thing away. If you are storing your own data and in user-land, put it in a data-structure that supports caching and don't think about pages.
If you are writing code in kernel-space, I know in linux you need to convert a memory address from a user-land to a kernal-space one, then there are API calls in the VMM to get at the page_table_entry, and subsequently the page struct from the address. Once that is done, you use logical operators to check for flags, one of which is "swapped". If you are trying to make something fast though, traversing and messing with memory at the page level might not be the most efficient (or safest) thing to do.
More information is needed in order to provide a more complete answer.

Resources