MCPcopy Create free account
hub / github.com/async-profiler/async-profiler / fetchInt

Function fetchInt

src/perfEvents_linux.cpp:78–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76static bool multiplex_state_dirty = false;
77
78static int fetchInt(const char* file_name) {
79 int fd = open(file_name, O_RDONLY);
80 if (fd == -1) {
81 return 0;
82 }
83
84 char num[16] = "0";
85 ssize_t r = read(fd, num, sizeof(num) - 1);
86 (void) r;
87 close(fd);
88 return atoi(num);
89}
90
91// Get perf_event_attr.config numeric value of the given tracepoint name
92// by reading /sys/kernel/tracing/events/<name>/id (since 4.1)

Callers 2

findTracepointIdFunction · 0.85
findDeviceTypeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected