title: What is the exactly Perf buffer size?
body: <p>after I read the <a href="http://man7.org/linux/man-pages/man2/perf_event_open.2.html" rel="nofollow noreferrer">manual</a> of <code>perf_event_open()</code>, I have a few question about buffer's size in capture sampling event.</p>
  
  <p>In the description section, it says that </p>
  
  <blockquote>
    <p>A sampling event periodically writes measurements to a
           buffer that can then be accessed via mmap(2).</p>
  </blockquote>
  
  <p>And when the buffer overflow, PMU will trigger the PMI, we can access the content of buffer via <code>mmap()</code> system call. (is my understanding correct?)</p>
  
  <p>But the question is, how big is the Perf buffer? Can I set a new value (buffer length) to overwrite it?</p>
  
  <p>Variable <code>__u64 data_size</code> in the <code>struct perf_event_mmap_page</code> only indicates the records size in this time.</p>