projects
/
platform
/
adaptation
/
renesas_rcar
/
renesas_kernel.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Merge remote-tracking branch 'asoc/fix/cs4271' into tmp
[platform/adaptation/renesas_rcar/renesas_kernel.git]
/
tools
/
perf
/
tests
/
util.c
1
#include <stdio.h>
2
#include <unistd.h>
3
#include <stdlib.h>
4
#include <sys/types.h>
5
#include <sys/stat.h>
6
#include <fcntl.h>
7
#include "tests.h"
8
#include "debugfs.h"
9
10
int trace_event__id(const char *evname)
11
{
12
char *filename;
13
int err = -1, fd;
14
15
if (asprintf(&filename,
16
"%s/syscalls/%s/id",
17
tracing_events_path, evname) < 0)
18
return -1;
19
20
fd = open(filename, O_RDONLY);
21
if (fd >= 0) {
22
char id[16];
23
if (read(fd, id, sizeof(id)) > 0)
24
err = atoi(id);
25
close(fd);
26
}
27
28
free(filename);
29
return err;
30
}