-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf
Alexei Starovoitov says: ==================== pull-request: bpf 2020-03-12 The following pull-request contains BPF updates for your *net* tree. We've added 12 non-merge commits during the last 8 day(s) which contain a total of 12 files changed, 161 insertions(+), 15 deletions(-). The main changes are: 1) Andrii fixed two bugs in cgroup-bpf. 2) John fixed sockmap. 3) Luke fixed x32 jit. 4) Martin fixed two issues in struct_ops. 5) Yonghong fixed bpf_send_signal. 6) Yoshiki fixed BTF enum. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
- Loading branch information
Showing
12 changed files
with
161 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
tools/testing/selftests/bpf/prog_tests/send_signal_sched_switch.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// SPDX-License-Identifier: GPL-2.0 | ||
#include <test_progs.h> | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <sys/mman.h> | ||
#include <pthread.h> | ||
#include <sys/types.h> | ||
#include <sys/stat.h> | ||
#include <fcntl.h> | ||
#include "test_send_signal_kern.skel.h" | ||
|
||
static void sigusr1_handler(int signum) | ||
{ | ||
} | ||
|
||
#define THREAD_COUNT 100 | ||
|
||
static void *worker(void *p) | ||
{ | ||
int i; | ||
|
||
for ( i = 0; i < 1000; i++) | ||
usleep(1); | ||
|
||
return NULL; | ||
} | ||
|
||
void test_send_signal_sched_switch(void) | ||
{ | ||
struct test_send_signal_kern *skel; | ||
pthread_t threads[THREAD_COUNT]; | ||
u32 duration = 0; | ||
int i, err; | ||
|
||
signal(SIGUSR1, sigusr1_handler); | ||
|
||
skel = test_send_signal_kern__open_and_load(); | ||
if (CHECK(!skel, "skel_open_and_load", "skeleton open_and_load failed\n")) | ||
return; | ||
|
||
skel->bss->pid = getpid(); | ||
skel->bss->sig = SIGUSR1; | ||
|
||
err = test_send_signal_kern__attach(skel); | ||
if (CHECK(err, "skel_attach", "skeleton attach failed\n")) | ||
goto destroy_skel; | ||
|
||
for (i = 0; i < THREAD_COUNT; i++) { | ||
err = pthread_create(threads + i, NULL, worker, NULL); | ||
if (CHECK(err, "pthread_create", "Error creating thread, %s\n", | ||
strerror(errno))) | ||
goto destroy_skel; | ||
} | ||
|
||
for (i = 0; i < THREAD_COUNT; i++) | ||
pthread_join(threads[i], NULL); | ||
|
||
destroy_skel: | ||
test_send_signal_kern__destroy(skel); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters