Accurate Cache and TLB Characterization Using hardware Counters