title: Finding which version of valgrind is running
body: <p>in C/C++, I can include valgrind headers to know at runtime whether or not my software is running on valgrind :</p>
  
  <pre><code>#include &lt;valgrind/valgrind.h&gt;
  
  bool RunningOnValgrind() 
  {
      return RUNNING_ON_VALGRIND ? true : false;
  }
  </code></pre>
  
  <p>This is documented in the <a href="http://valgrind.org/docs/manual/manual-core-adv.html" rel="nofollow">valgrind manual</a>.</p>
  
  <p>I would like to be able to know if the valgrind I am being run on supports AVX instructions. How do I write a function that returns this information ?</p>
  
  <p>From <a href="http://valgrind.org/docs/manual/dist.news.html" rel="nofollow">valgrind release notes</a>, I known that these are supported from version 3.8 onwards.  Hence one solution would be to spawn a process to execute <I>valgrind --version</I> and then parse the output but there must be a better way.</p>