From: Josef W. <Jos...@gm...> - 2010-03-27 21:36:15
|
Hi, On Wednesday 24 March 2010, John Reiser wrote: > On 03/24/2010 02:38 AM, Julian Seward wrote: > > VG_(discard_translations)( (Addr64)0x1000, (ULong) ~0xfffl); > > > > VG_(discard_translations) is not listed in any tool-available > > interface file (pub_tool_*.h). > > Please document the meaning of the parameters. My usage in callgrind as given above was more or less a quick hack to get it working. > In particular, is 0x1000 related to PAGE_SIZE or something similar? Especially this number was choosen quite random, but yes, I had a page size in mind (not that this really makes much sense). > If the second parameter is a length, then it is better to use > -(ULong)PAGE_SIZE /*note the minus sign*/ > (or in general, the negative of the first parameter) > because then it is obvious that the sum of the first parameter > and the second parameter is the entire remaining address space. Makes sense. Some time ago, I discussed with Julian about putting a function to flush the complete code cache into the tool interface - so if official, it would have another signature anyway. I came up with a patch, see attached. One issue with this patch is that the proposed function VG_(discard_all_translations)() has to be part of the VG core scheduler module, as it really should assert that the function is not called while generated code is running, which only the scheduler can see. If we make VG_(discard_all_translations) instead part of the public interface of the VG core transtab module, which is the natural thing (at least I would search for such functionality there), there would need to be a dependence to the scheduler, which currently is not there. Anyway, as there are now 2 potential users of such a tool functionality: Julian, can I submit the patch? Josef |