Merge remote-tracking branch 'torvalds/master' into perf/core
To pick up fixes and get in line with other trees, powerpc kernel mostly this time, but BPF as well. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
@@ -3257,10 +3257,21 @@ static void trace__set_bpf_map_syscalls(struct trace *trace)
|
||||
|
||||
static struct bpf_program *trace__find_bpf_program_by_title(struct trace *trace, const char *name)
|
||||
{
|
||||
struct bpf_program *pos, *prog = NULL;
|
||||
const char *sec_name;
|
||||
|
||||
if (trace->bpf_obj == NULL)
|
||||
return NULL;
|
||||
|
||||
return bpf_object__find_program_by_title(trace->bpf_obj, name);
|
||||
bpf_object__for_each_program(pos, trace->bpf_obj) {
|
||||
sec_name = bpf_program__section_name(pos);
|
||||
if (sec_name && !strcmp(sec_name, name)) {
|
||||
prog = pos;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return prog;
|
||||
}
|
||||
|
||||
static struct bpf_program *trace__find_syscall_bpf_prog(struct trace *trace, struct syscall *sc,
|
||||
|
||||
@@ -296,9 +296,13 @@ static int check_env(void)
|
||||
return err;
|
||||
}
|
||||
|
||||
/* temporarily disable libbpf deprecation warnings */
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
err = bpf_load_program(BPF_PROG_TYPE_KPROBE, insns,
|
||||
ARRAY_SIZE(insns),
|
||||
license, kver_int, NULL, 0);
|
||||
#pragma GCC diagnostic pop
|
||||
if (err < 0) {
|
||||
pr_err("Missing basic BPF support, skip this test: %s\n",
|
||||
strerror(errno));
|
||||
|
||||
@@ -29,6 +29,9 @@
|
||||
|
||||
#include <internal/xyarray.h>
|
||||
|
||||
/* temporarily disable libbpf deprecation warnings */
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
|
||||
static int libbpf_perf_print(enum libbpf_print_level level __attribute__((unused)),
|
||||
const char *fmt, va_list args)
|
||||
{
|
||||
|
||||
@@ -307,6 +307,20 @@ static bool bperf_attr_map_compatible(int attr_map_fd)
|
||||
(map_info.value_size == sizeof(struct perf_event_attr_map_entry));
|
||||
}
|
||||
|
||||
int __weak
|
||||
bpf_map_create(enum bpf_map_type map_type,
|
||||
const char *map_name __maybe_unused,
|
||||
__u32 key_size,
|
||||
__u32 value_size,
|
||||
__u32 max_entries,
|
||||
const struct bpf_map_create_opts *opts __maybe_unused)
|
||||
{
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
return bpf_create_map(map_type, key_size, value_size, max_entries, 0);
|
||||
#pragma GCC diagnostic pop
|
||||
}
|
||||
|
||||
static int bperf_lock_attr_map(struct target *target)
|
||||
{
|
||||
char path[PATH_MAX];
|
||||
@@ -320,10 +334,10 @@ static int bperf_lock_attr_map(struct target *target)
|
||||
}
|
||||
|
||||
if (access(path, F_OK)) {
|
||||
map_fd = bpf_create_map(BPF_MAP_TYPE_HASH,
|
||||
map_fd = bpf_map_create(BPF_MAP_TYPE_HASH, NULL,
|
||||
sizeof(struct perf_event_attr),
|
||||
sizeof(struct perf_event_attr_map_entry),
|
||||
ATTR_MAP_SIZE, 0);
|
||||
ATTR_MAP_SIZE, NULL);
|
||||
if (map_fd < 0)
|
||||
return -1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user