Since last year Mesa -- including the Intel driver -- has supported the AMD_performance_monitor extension for reading and capturing performance monitors related to the graphics hardware. There's also been Mesa support for GL_ARB_debug_output and GL_KHR_debug as other extensions for aiding OpenGL game developers and application writers for debugging or optimizing their OpenGL workloads under the open-source Linux graphics driver stack. The latest support is for INTEL_performance_query.
Going back to March have been Mesa patches out of Intel for hooking up the GL_INTEL_performance_query extension as the Intel-originated approach for exposing GPU counter information under Linux. The core support for the GL_INTEL_performance_query extension is done in the same way as the AMD_performance_monitor extension. As of Friday, that support is in Mesa with using the same AMD performance driver extension hooks. Though in terms of Mesa/Gallium3D drivers right now supporting this OpenGL performance tuning extension, only Intel is supported right now and it covers "Gen5" era hardware and newer.