|
|
|
@ -21,6 +21,7 @@ class memtracer_t |
|
|
|
|
|
|
|
virtual bool interested_in_range(uint64_t begin, uint64_t end, access_type type) = 0; |
|
|
|
virtual void trace(uint64_t addr, size_t bytes, access_type type) = 0; |
|
|
|
virtual void clean_invalidate(uint64_t addr, size_t bytes, bool clean, bool inval) = 0; |
|
|
|
}; |
|
|
|
|
|
|
|
class memtracer_list_t : public memtracer_t |
|
|
|
@ -29,15 +30,20 @@ class memtracer_list_t : public memtracer_t |
|
|
|
bool empty() { return list.empty(); } |
|
|
|
bool interested_in_range(uint64_t begin, uint64_t end, access_type type) |
|
|
|
{ |
|
|
|
for (std::vector<memtracer_t*>::iterator it = list.begin(); it != list.end(); ++it) |
|
|
|
if ((*it)->interested_in_range(begin, end, type)) |
|
|
|
for (auto it: list) |
|
|
|
if (it->interested_in_range(begin, end, type)) |
|
|
|
return true; |
|
|
|
return false; |
|
|
|
} |
|
|
|
void trace(uint64_t addr, size_t bytes, access_type type) |
|
|
|
{ |
|
|
|
for (std::vector<memtracer_t*>::iterator it = list.begin(); it != list.end(); ++it) |
|
|
|
(*it)->trace(addr, bytes, type); |
|
|
|
for (auto it: list) |
|
|
|
it->trace(addr, bytes, type); |
|
|
|
} |
|
|
|
void clean_invalidate(uint64_t addr, size_t bytes, bool clean, bool inval) |
|
|
|
{ |
|
|
|
for (auto it: list) |
|
|
|
it->clean_invalidate(addr, bytes, clean, inval); |
|
|
|
} |
|
|
|
void hook(memtracer_t* h) |
|
|
|
{ |
|
|
|
|