Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libbpf-bootstrap
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Luis Gerhorst
libbpf-bootstrap
Commits
799ad2b4
Commit
799ad2b4
authored
Mar 16, 2021
by
Luis Gerhorst
Browse files
Options
Downloads
Patches
Plain Diff
Repeat init
parent
b7d78dfa
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/task_bulk.c
+59
-51
59 additions, 51 deletions
src/task_bulk.c
with
59 additions
and
51 deletions
src/task_bulk.c
+
59
−
51
View file @
799ad2b4
...
...
@@ -41,15 +41,16 @@ static void bump_memlock_rlimit(void)
}
static
void
print_usage
(
char
**
argv
)
{
fprintf
(
stderr
,
"Usage: %s user|bpf <iter>"
,
argv
[
0
]);
fprintf
(
stderr
,
"Usage: %s user|bpf
<init>
<iter>"
,
argv
[
0
]);
}
int
main
(
int
argc
,
char
**
argv
)
{
if
(
argc
!=
3
)
{
if
(
argc
!=
4
)
{
print_usage
(
argv
);
return
1
;
}
bool
user
;
if
(
strcmp
(
"bpf"
,
argv
[
1
])
==
0
)
{
user
=
false
;
...
...
@@ -59,15 +60,21 @@ int main(int argc, char **argv)
print_usage
(
argv
);
return
1
;
}
int
iter
=
atoi
(
argv
[
2
]);
if
(
iter
<
0
)
{
int
init
=
atoi
(
argv
[
2
]);
if
(
init
<
0
)
{
print_usage
(
argv
);
return
1
;
}
int
err
;
int
iter
=
atoi
(
argv
[
3
]);
if
(
iter
<
0
)
{
print_usage
(
argv
);
return
1
;
}
int
err
=
0
;
for
(
int
k
=
0
;
k
<
init
;
k
++
)
{
if
(
user
)
{
int
*
fds
=
malloc
(
sizeof
(
int
)
*
SIZE
);
if
(
fds
==
NULL
)
{
...
...
@@ -97,7 +104,7 @@ int main(int argc, char **argv)
struct
task_bulk_bpf
*
skel
;
/* Set up libbpf errors and debug info callback */
libbpf_set_print
(
libbpf_print_fn
);
/*
libbpf_set_print(libbpf_print_fn);
*/
/* Bump RLIMIT_MEMLOCK to allow BPF sub-system to do anything */
bump_memlock_rlimit
();
...
...
@@ -127,6 +134,7 @@ int main(int argc, char **argv)
cleanup:
task_bulk_bpf__destroy
(
skel
);
}
}
return
-
err
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment