So I have this code
So I like to know what is this trace_fd = open(DEBUGFS "trace_pipe", O_RDONLY, 0);
it seems like reading trace but what is trace so begin telling me something about trace, and can I read any trace/ how many traces are there. If I do a write on trace pipe then what other end is in the write system call. so I am awefully confused about word trace and let alone simple code below writing to trace_pipe. Can I create my own trace? How and please telll me this
void read_trace_pipe(void)
{
int trace_fd;
trace_fd = open(DEBUGFS "trace_pipe", O_RDONLY, 0);
if (trace_fd < 0)
return;
while (1) {
static char buf[4096];
ssize_t sz;
sz = read(trace_fd, buf, sizeof(buf) - 1);
if (sz > 0) {
buf[sz] = 0;
puts(buf);
}
}
}