title: Perf Error: The sys_perf_event_open() syscall returned with 22 (Invalid argument) for event (msr/tsc/)
body: <p>I am using perf to monitor the system for certain events. However, I get the following error and I have no idea where it comes from,as the event is listed in perf list</p>
  
  <p><strong>sudo perf record -e msr/tsc/ -a</strong></p>
  
  <pre><code>Error:
  The sys_perf_event_open() syscall returned with 22 (Invalid argument) for event (msr/tsc/).
  /bin/dmesg may provide additional information.
  No CONFIG_PERF_EVENTS=y kernel support configured?
  </code></pre>
  
  <p>How can I check No CONFIG_PERF_EVENTS=y kernel support configured?</p>
  
  <p>**Some test results: </p>
  
  <pre><code>sudo dmesg | grep "perf\|pmu"**
  [    0.029179] ENERGY_PERF_BIAS: Set to 'normal', was 'performance'
  [    0.029179] ENERGY_PERF_BIAS: View and update with x86_energy_perf_policy(8)
  [ 9475.406967] perf: interrupt took too long (2509 &gt; 2500), lowering kernel.perf_event_max_sample_rate to 79500
  [ 9475.990901] perf: interrupt took too long (3146 &gt; 3136), lowering kernel.perf_event_max_sample_rate to 63500
  [ 9476.886941] perf: interrupt took too long (3942 &gt; 3932), lowering kernel.perf_event_max_sample_rate to 50500
  [76057.268195] perf: interrupt took too long (4934 &gt; 4927), lowering kernel.perf_event_max_sample_rate to 40500
  [167368.007839] perf: interrupt took too long (6171 &gt; 6167), lowering kernel.perf_event_max_sample_rate to 32250
  [168338.165608] perf: interrupt took too long (7804 &gt; 7713), lowering kernel.perf_event_max_sample_rate to 25500
  </code></pre>
  
  <p><strong>perf list |grep msr</strong></p>
  
  <pre><code>  msr/aperf/                                         [Kernel PMU event]
    msr/mperf/                                         [Kernel PMU event]
    msr/pperf/                                         [Kernel PMU event]
    msr/smi/                                           [Kernel PMU event]
    msr/tsc/   
  </code></pre>
  
  <p><strong>sudo uname -a</strong>
  Linux bla 4.9.0-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64 GNU/Linux</p>
  
  <p><strong>sudo /proc/config.gz</strong> returns command not found
  Any help/ideas are appreciated. </p>