On 29/09/16 14:53, Igor Druzhinin wrote: > As long as t_info_first_offset is calculated in uint32_t offsets we need to > multiply it by sizeof(uint32_t) in order to get the right number of pages > for trace metadata. Not doing that makes it impossible to read the trace > buffer correctly from userspace for some corner cases. > > Signed-off-by: Igor Druzhinin Hmm, looks like we actually want to revert this c/s fbf96e6, "xentrace: correct formula to calculate t_info_pages". But that one was presumably written (and Acked by me) because the variable name there, t_info_first_offset, is confusing. The other mistake in fbf96e6 is that before t_info_words was actually denominated in words; but after it's denominated in bytes (which is again confusing). What about something like the attached instead? This should fix your problem while making the code clearer. -George