Close perf_event file descriptor on exec.

This commit is contained in:
Bartosz Taudul
2021-05-19 21:09:55 +02:00
committed by Bartosz Taudul
parent 9cd1b26bc7
commit 16101571e0
+1 -1
View File
@@ -715,7 +715,7 @@ static void SetupSampling( int64_t& samplingPeriod )
for( int i=0; i<s_numCpus; i++ )
{
const int fd = perf_event_open( &pe, -1, i, -1, 0 );
const int fd = perf_event_open( &pe, -1, i, -1, PERF_FLAG_FD_CLOEXEC );
if( fd == -1 )
{
for( int j=0; j<s_numBuffers; j++ ) s_ring[j].~RingBuffer<RingBufSize>();