1
0
mirror of https://github.com/wolfpld/tracy synced 2025-04-29 12:23:53 +00:00

Skip context switch events in on demand mode, if no connection.

This commit is contained in:
Bartosz Taudul 2019-08-14 15:09:33 +02:00
parent 602c38c6c0
commit 54a9132bb5

View File

@ -154,13 +154,15 @@ void SysTraceWorker( void* ptr )
# elif defined __linux__
# include <sys/types.h>
# include <sys/stat.h>
# include <fcntl.h>
# include <stdint.h>
# include <stdio.h>
# include <string.h>
# include <unistd.h>
# include <sys/types.h>
# include <sys/stat.h>
# include <fcntl.h>
# include <stdint.h>
# include <stdio.h>
# include <string.h>
# include <unistd.h>
# include "TracyProfiler.hpp"
namespace tracy
{
@ -270,6 +272,10 @@ void SysTraceWorker( void* ptr )
auto rd = getline( &line, &lsz, f );
if( rd < 0 ) break;
#ifdef TRACY_ON_DEMAND
if( !GetProfiler().IsConnected() ) continue;
#endif
const char* ptr = line + 24;
const auto cpu = (uint8_t)ReadNumber( ptr );