Logic of using caching_device_stats_t in caching_device

9 views
Skip to first unread message

Artur Abdulkhakov

unread,
Mar 5, 2026, 2:47:40 PM (yesterday) Mar 5
to DynamoRIO Users

Hello,
I wrote a custom implementation of caching_device_stats_t and noticed what seems to be incorrect behavior in caching_device_t with the caching_device_block_t that is passed to caching_device_stats_t::access as an argument. On a miss, the block passed to the stats still contains the old tag that is about to be evicted.

Is this behavior intended by design, or caching_device_stats_t::access should receive a block with the new tag instead?

Bin Wang

unread,
Mar 5, 2026, 3:42:53 PM (yesterday) Mar 5
to DynamoRIO Users
Hi, I would say this is by design. You can look at the whole interactions at: https://github.com/DynamoRIO/dynamorio/blob/475a52253907f47ffa321735f756e39b48decaad/clients/drcachesim/simulator/caching_device.cpp#L247-L260

The stats recording happens on line 251, before the new tag is inserted into the block (which happens on line 260. If you need the new tag, you should be able to compute it from the memref argument.

Hope it helps.

Reply all
Reply to author
Forward
0 new messages