Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
i4
manycore
syscall-eval
Commits
35bf403c
Commit
35bf403c
authored
Aug 02, 2021
by
Florian Fischer
Browse files
don't pin our thread
parent
d11862a3
Pipeline
#66513
passed with stage
in 1 minute and 12 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Makefile
View file @
35bf403c
...
...
@@ -5,7 +5,7 @@ OBJ := $(addprefix bench-,$(SYSCALLS))
LDFLAGS
:=
-luring
-pthread
-lrt
CFLAGS
:=
-Werror
-Wall
-g
-O3
-D_GNU_SOURCE
CFLAGS
:=
-Werror
-Wall
-g
-O3
# CFLAGS := -Werror -Wall -g -O0
.PHONY
:
all clean eval docker-eval check
...
...
bench.c
View file @
35bf403c
#include
<err.h>
#include
<fcntl.h>
#include
<sched.h>
#include
<stdint.h>
#include
<stdio.h>
#include
<stdlib.h>
#include
<sys/eventfd.h>
#include
<unistd.h>
#include
"stopwatch.h"
...
...
@@ -25,22 +23,11 @@ static int create_eventfd() {
return
fd
;
}
static
void
set_cpu_affinity
(
int
cpu
)
{
cpu_set_t
set
;
// NOLINTNEXTLINE(clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling)
CPU_ZERO
(
&
set
);
CPU_SET
(
cpu
,
&
set
);
if
(
sched_setaffinity
(
getpid
(),
sizeof
(
set
),
&
set
)
==
-
1
)
err
(
EXIT_FAILURE
,
"sched_setaffinity failed"
);
}
int
main
()
{
uint64_t
cycles_sum
=
0
;
uint64_t
nanos_sum
=
0
;
uint64_t
write_buf
=
1
;
set_cpu_affinity
(
0
);
int
fd
=
create_eventfd
();
init
(
fd
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment