|
From: Julian S. <js...@ac...> - 2006-12-15 04:40:19
|
On Friday 15 December 2006 03:34, Nicholas Nethercote wrote: > On Thu, 14 Dec 2006, Ben Liblit wrote: > > Heh. :-D I'm a bit surprised too. My best guess is that the > > VALGRIND_DISCARD_TRANSLATIONS call is behaving as a no-op just like any > > other client call would when executed in non-Valgrind-translated code. > > I'm invoking VALGRIND_DISCARD_TRANSLATIONS from an external function, > > and presumably Valgrind leaves these alone. Yes, I'd agree with that analysis. Apart from this problem your scheme should work. However, making translations is expensive. From crude measurements we see that making a translation costs in the order of 500k host instructions. And VALGRIND_DISCARD_TRANSLATIONS isn't free either, since it involves finding all translations that intersect a given address range, and invalidating the dispatcher's fast-case cache. So I'd suggest it's likely to be a net performance loss most of the time anyway. Probably simpler and easier to reorganise your helper functions so that it doesn't matter how many times they are called. > >> If so, I'd probably use the support for conditional dirty calls > > > > Ah, I hadn't noticed that before. OK, I may give this a try. You could use conditional dirty calls, but then you have to somewhere store the information about whether a call should happen or not. J |