1

I am interested in monitoring the CLFLUSH instruction in real-time either system-wide or for a specific process. The platform I am using is on

4.9.0-3-amd64 #1 SMP Debian 4.9.30-2+deb9u2 (2017-06-26) x86_64 GNU/Linux, 
Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz

Currently, I am trying to do that using perf top/perf stat but i am not able to filter on this specific instruction. Any idea would be greatly appreciated.

osgx
  • 90,338
  • 53
  • 357
  • 513
ladaManiak
  • 104
  • 1
  • 1
  • 6
  • 2
    Have you considered tools like DynamoRIO or Frida? Or Intel PIN? – Margaret Bloom Nov 18 '18 at 14:16
  • Can you check the [Intel Architecture Manual](https://software.intel.com/en-us/articles/intel-sdm) for Performance counters for Haswell? (or in https://download.01.org/perfmon/index/haswell.html https://software.intel.com/en-us/vtune-amplifier-help-intel-processor-events-reference) If there are some counters incremented for CLFLUSH, you may try to use them as sampling event for perf top. If there is no such hardware count, you may use `perf probe` to add synthetic tracing event on every clflush command in every binary (which is hard for system-wide mode, but easier for smaller single program). – osgx Jan 04 '19 at 08:54
  • If (as I suspect) there are no perf counters for `clflush`, this would be a duplicate of [Perf Monitoring for rdtsc dynamically](https://stackoverflow.com/q/53390392). – Peter Cordes Jan 04 '19 at 09:26

0 Answers0