MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / validatePerfEventDescriptor

Function validatePerfEventDescriptor

src/Common/ThreadProfileEvents.cpp:331–353  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

329}
330
331static bool validatePerfEventDescriptor(int & fd)
332{
333 if (fcntl(fd, F_GETFL) != -1)
334 return true;
335
336 if (errno == EBADF)
337 {
338 LOG_WARNING(getLogger("PerfEvents"),
339 "Event descriptor {} was closed from the outside; reopening", fd);
340 }
341 else
342 {
343 LOG_WARNING(getLogger("PerfEvents"),
344 "Error while checking availability of event descriptor {}: {} ({})",
345 fd, errnoToString(), errno);
346
347 disablePerfEvent(fd);
348 releasePerfEvent(fd);
349 }
350
351 fd = -1;
352 return false;
353}
354
355bool PerfEventsCounters::processThreadLocalChanges(const std::string & needed_events_list)
356{

Callers 1

Calls 4

errnoToStringFunction · 0.85
disablePerfEventFunction · 0.85
releasePerfEventFunction · 0.85
getLoggerFunction · 0.70

Tested by

no test coverage detected