Commit 7f16023b authored by Arnaldo Carvalho de Melo's avatar Arnaldo Carvalho de Melo

Merge remote-tracking branch 'acme/perf/urgent' into perf/core

To pick up fixes.
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parents 49e73246 169e366c
...@@ -1272,4 +1272,8 @@ void intel_pmu_lbr_init_knl(void) ...@@ -1272,4 +1272,8 @@ void intel_pmu_lbr_init_knl(void)
x86_pmu.lbr_sel_mask = LBR_SEL_MASK; x86_pmu.lbr_sel_mask = LBR_SEL_MASK;
x86_pmu.lbr_sel_map = snb_lbr_sel_map; x86_pmu.lbr_sel_map = snb_lbr_sel_map;
/* Knights Landing does have MISPREDICT bit */
if (x86_pmu.intel_cap.lbr_format == LBR_FORMAT_LIP)
x86_pmu.intel_cap.lbr_format = LBR_FORMAT_EIP_FLAGS;
} }
...@@ -144,7 +144,7 @@ enum perf_event_sample_format { ...@@ -144,7 +144,7 @@ enum perf_event_sample_format {
PERF_SAMPLE_MAX = 1U << 20, /* non-ABI */ PERF_SAMPLE_MAX = 1U << 20, /* non-ABI */
__PERF_SAMPLE_CALLCHAIN_EARLY = 1ULL << 63, __PERF_SAMPLE_CALLCHAIN_EARLY = 1ULL << 63, /* non-ABI; internal use */
}; };
/* /*
......
...@@ -5943,6 +5943,7 @@ perf_output_sample_ustack(struct perf_output_handle *handle, u64 dump_size, ...@@ -5943,6 +5943,7 @@ perf_output_sample_ustack(struct perf_output_handle *handle, u64 dump_size,
unsigned long sp; unsigned long sp;
unsigned int rem; unsigned int rem;
u64 dyn_size; u64 dyn_size;
mm_segment_t fs;
/* /*
* We dump: * We dump:
...@@ -5960,7 +5961,10 @@ perf_output_sample_ustack(struct perf_output_handle *handle, u64 dump_size, ...@@ -5960,7 +5961,10 @@ perf_output_sample_ustack(struct perf_output_handle *handle, u64 dump_size,
/* Data. */ /* Data. */
sp = perf_user_stack_pointer(regs); sp = perf_user_stack_pointer(regs);
fs = get_fs();
set_fs(USER_DS);
rem = __output_copy_user(handle, (void *) sp, dump_size); rem = __output_copy_user(handle, (void *) sp, dump_size);
set_fs(fs);
dyn_size = dump_size - rem; dyn_size = dump_size - rem;
perf_output_skip(handle, rem); perf_output_skip(handle, rem);
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#define __KVM_HAVE_GUEST_DEBUG #define __KVM_HAVE_GUEST_DEBUG
#define __KVM_HAVE_IRQ_LINE #define __KVM_HAVE_IRQ_LINE
#define __KVM_HAVE_READONLY_MEM #define __KVM_HAVE_READONLY_MEM
#define __KVM_HAVE_VCPU_EVENTS
#define KVM_COALESCED_MMIO_PAGE_OFFSET 1 #define KVM_COALESCED_MMIO_PAGE_OFFSET 1
...@@ -125,6 +126,18 @@ struct kvm_sync_regs { ...@@ -125,6 +126,18 @@ struct kvm_sync_regs {
struct kvm_arch_memory_slot { struct kvm_arch_memory_slot {
}; };
/* for KVM_GET/SET_VCPU_EVENTS */
struct kvm_vcpu_events {
struct {
__u8 serror_pending;
__u8 serror_has_esr;
/* Align it to 8 bytes */
__u8 pad[6];
__u64 serror_esr;
} exception;
__u32 reserved[12];
};
/* If you need to interpret the index values, here is the key: */ /* If you need to interpret the index values, here is the key: */
#define KVM_REG_ARM_COPROC_MASK 0x000000000FFF0000 #define KVM_REG_ARM_COPROC_MASK 0x000000000FFF0000
#define KVM_REG_ARM_COPROC_SHIFT 16 #define KVM_REG_ARM_COPROC_SHIFT 16
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#define __KVM_HAVE_GUEST_DEBUG #define __KVM_HAVE_GUEST_DEBUG
#define __KVM_HAVE_IRQ_LINE #define __KVM_HAVE_IRQ_LINE
#define __KVM_HAVE_READONLY_MEM #define __KVM_HAVE_READONLY_MEM
#define __KVM_HAVE_VCPU_EVENTS
#define KVM_COALESCED_MMIO_PAGE_OFFSET 1 #define KVM_COALESCED_MMIO_PAGE_OFFSET 1
...@@ -154,6 +155,18 @@ struct kvm_sync_regs { ...@@ -154,6 +155,18 @@ struct kvm_sync_regs {
struct kvm_arch_memory_slot { struct kvm_arch_memory_slot {
}; };
/* for KVM_GET/SET_VCPU_EVENTS */
struct kvm_vcpu_events {
struct {
__u8 serror_pending;
__u8 serror_has_esr;
/* Align it to 8 bytes */
__u8 pad[6];
__u64 serror_esr;
} exception;
__u32 reserved[12];
};
/* If you need to interpret the index values, here is the key: */ /* If you need to interpret the index values, here is the key: */
#define KVM_REG_ARM_COPROC_MASK 0x000000000FFF0000 #define KVM_REG_ARM_COPROC_MASK 0x000000000FFF0000
#define KVM_REG_ARM_COPROC_SHIFT 16 #define KVM_REG_ARM_COPROC_SHIFT 16
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
/* /*
* KVM s390 specific structures and definitions * KVM s390 specific structures and definitions
* *
* Copyright IBM Corp. 2008 * Copyright IBM Corp. 2008, 2018
* *
* Author(s): Carsten Otte <cotte@de.ibm.com> * Author(s): Carsten Otte <cotte@de.ibm.com>
* Christian Borntraeger <borntraeger@de.ibm.com> * Christian Borntraeger <borntraeger@de.ibm.com>
...@@ -225,6 +225,7 @@ struct kvm_guest_debug_arch { ...@@ -225,6 +225,7 @@ struct kvm_guest_debug_arch {
#define KVM_SYNC_FPRS (1UL << 8) #define KVM_SYNC_FPRS (1UL << 8)
#define KVM_SYNC_GSCB (1UL << 9) #define KVM_SYNC_GSCB (1UL << 9)
#define KVM_SYNC_BPBC (1UL << 10) #define KVM_SYNC_BPBC (1UL << 10)
#define KVM_SYNC_ETOKEN (1UL << 11)
/* length and alignment of the sdnx as a power of two */ /* length and alignment of the sdnx as a power of two */
#define SDNXC 8 #define SDNXC 8
#define SDNXL (1UL << SDNXC) #define SDNXL (1UL << SDNXC)
...@@ -258,6 +259,8 @@ struct kvm_sync_regs { ...@@ -258,6 +259,8 @@ struct kvm_sync_regs {
struct { struct {
__u64 reserved1[2]; __u64 reserved1[2];
__u64 gscb[4]; __u64 gscb[4];
__u64 etoken;
__u64 etoken_extension;
}; };
}; };
}; };
......
...@@ -378,4 +378,41 @@ struct kvm_sync_regs { ...@@ -378,4 +378,41 @@ struct kvm_sync_regs {
#define KVM_X86_QUIRK_LINT0_REENABLED (1 << 0) #define KVM_X86_QUIRK_LINT0_REENABLED (1 << 0)
#define KVM_X86_QUIRK_CD_NW_CLEARED (1 << 1) #define KVM_X86_QUIRK_CD_NW_CLEARED (1 << 1)
#define KVM_STATE_NESTED_GUEST_MODE 0x00000001
#define KVM_STATE_NESTED_RUN_PENDING 0x00000002
#define KVM_STATE_NESTED_SMM_GUEST_MODE 0x00000001
#define KVM_STATE_NESTED_SMM_VMXON 0x00000002
struct kvm_vmx_nested_state {
__u64 vmxon_pa;
__u64 vmcs_pa;
struct {
__u16 flags;
} smm;
};
/* for KVM_CAP_NESTED_STATE */
struct kvm_nested_state {
/* KVM_STATE_* flags */
__u16 flags;
/* 0 for VMX, 1 for SVM. */
__u16 format;
/* 128 for SVM, 128 + VMCS size for VMX. */
__u32 size;
union {
/* VMXON, VMCS */
struct kvm_vmx_nested_state vmx;
/* Pad the header to 128 bytes. */
__u8 pad[120];
};
__u8 data[0];
};
#endif /* _ASM_X86_KVM_H */ #endif /* _ASM_X86_KVM_H */
...@@ -734,9 +734,11 @@ __SYSCALL(__NR_pkey_free, sys_pkey_free) ...@@ -734,9 +734,11 @@ __SYSCALL(__NR_pkey_free, sys_pkey_free)
__SYSCALL(__NR_statx, sys_statx) __SYSCALL(__NR_statx, sys_statx)
#define __NR_io_pgetevents 292 #define __NR_io_pgetevents 292
__SC_COMP(__NR_io_pgetevents, sys_io_pgetevents, compat_sys_io_pgetevents) __SC_COMP(__NR_io_pgetevents, sys_io_pgetevents, compat_sys_io_pgetevents)
#define __NR_rseq 293
__SYSCALL(__NR_rseq, sys_rseq)
#undef __NR_syscalls #undef __NR_syscalls
#define __NR_syscalls 293 #define __NR_syscalls 294
/* /*
* 32 bit systems traditionally used different * 32 bit systems traditionally used different
......
...@@ -687,6 +687,15 @@ struct drm_get_cap { ...@@ -687,6 +687,15 @@ struct drm_get_cap {
*/ */
#define DRM_CLIENT_CAP_ASPECT_RATIO 4 #define DRM_CLIENT_CAP_ASPECT_RATIO 4
/**
* DRM_CLIENT_CAP_WRITEBACK_CONNECTORS
*
* If set to 1, the DRM core will expose special connectors to be used for
* writing back to memory the scene setup in the commit. Depends on client
* also supporting DRM_CLIENT_CAP_ATOMIC
*/
#define DRM_CLIENT_CAP_WRITEBACK_CONNECTORS 5
/** DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */ /** DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */
struct drm_set_client_cap { struct drm_set_client_cap {
__u64 capability; __u64 capability;
......
...@@ -164,6 +164,8 @@ enum { ...@@ -164,6 +164,8 @@ enum {
IFLA_CARRIER_UP_COUNT, IFLA_CARRIER_UP_COUNT,
IFLA_CARRIER_DOWN_COUNT, IFLA_CARRIER_DOWN_COUNT,
IFLA_NEW_IFINDEX, IFLA_NEW_IFINDEX,
IFLA_MIN_MTU,
IFLA_MAX_MTU,
__IFLA_MAX __IFLA_MAX
}; };
...@@ -334,6 +336,7 @@ enum { ...@@ -334,6 +336,7 @@ enum {
IFLA_BRPORT_GROUP_FWD_MASK, IFLA_BRPORT_GROUP_FWD_MASK,
IFLA_BRPORT_NEIGH_SUPPRESS, IFLA_BRPORT_NEIGH_SUPPRESS,
IFLA_BRPORT_ISOLATED, IFLA_BRPORT_ISOLATED,
IFLA_BRPORT_BACKUP_PORT,
__IFLA_BRPORT_MAX __IFLA_BRPORT_MAX
}; };
#define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1) #define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1)
...@@ -459,6 +462,16 @@ enum { ...@@ -459,6 +462,16 @@ enum {
#define IFLA_MACSEC_MAX (__IFLA_MACSEC_MAX - 1) #define IFLA_MACSEC_MAX (__IFLA_MACSEC_MAX - 1)
/* XFRM section */
enum {
IFLA_XFRM_UNSPEC,
IFLA_XFRM_LINK,
IFLA_XFRM_IF_ID,
__IFLA_XFRM_MAX
};
#define IFLA_XFRM_MAX (__IFLA_XFRM_MAX - 1)
enum macsec_validation_type { enum macsec_validation_type {
MACSEC_VALIDATE_DISABLED = 0, MACSEC_VALIDATE_DISABLED = 0,
MACSEC_VALIDATE_CHECK = 1, MACSEC_VALIDATE_CHECK = 1,
...@@ -920,6 +933,7 @@ enum { ...@@ -920,6 +933,7 @@ enum {
XDP_ATTACHED_DRV, XDP_ATTACHED_DRV,
XDP_ATTACHED_SKB, XDP_ATTACHED_SKB,
XDP_ATTACHED_HW, XDP_ATTACHED_HW,
XDP_ATTACHED_MULTI,
}; };
enum { enum {
...@@ -928,6 +942,9 @@ enum { ...@@ -928,6 +942,9 @@ enum {
IFLA_XDP_ATTACHED, IFLA_XDP_ATTACHED,
IFLA_XDP_FLAGS, IFLA_XDP_FLAGS,
IFLA_XDP_PROG_ID, IFLA_XDP_PROG_ID,
IFLA_XDP_DRV_PROG_ID,
IFLA_XDP_SKB_PROG_ID,
IFLA_XDP_HW_PROG_ID,
__IFLA_XDP_MAX, __IFLA_XDP_MAX,
}; };
......
...@@ -949,6 +949,9 @@ struct kvm_ppc_resize_hpt { ...@@ -949,6 +949,9 @@ struct kvm_ppc_resize_hpt {
#define KVM_CAP_GET_MSR_FEATURES 153 #define KVM_CAP_GET_MSR_FEATURES 153
#define KVM_CAP_HYPERV_EVENTFD 154 #define KVM_CAP_HYPERV_EVENTFD 154
#define KVM_CAP_HYPERV_TLBFLUSH 155 #define KVM_CAP_HYPERV_TLBFLUSH 155
#define KVM_CAP_S390_HPAGE_1M 156
#define KVM_CAP_NESTED_STATE 157
#define KVM_CAP_ARM_INJECT_SERROR_ESR 158
#ifdef KVM_CAP_IRQ_ROUTING #ifdef KVM_CAP_IRQ_ROUTING
...@@ -1391,6 +1394,9 @@ struct kvm_enc_region { ...@@ -1391,6 +1394,9 @@ struct kvm_enc_region {
/* Available with KVM_CAP_HYPERV_EVENTFD */ /* Available with KVM_CAP_HYPERV_EVENTFD */
#define KVM_HYPERV_EVENTFD _IOW(KVMIO, 0xbd, struct kvm_hyperv_eventfd) #define KVM_HYPERV_EVENTFD _IOW(KVMIO, 0xbd, struct kvm_hyperv_eventfd)
/* Available with KVM_CAP_NESTED_STATE */
#define KVM_GET_NESTED_STATE _IOWR(KVMIO, 0xbe, struct kvm_nested_state)
#define KVM_SET_NESTED_STATE _IOW(KVMIO, 0xbf, struct kvm_nested_state)
/* Secure Encrypted Virtualization command */ /* Secure Encrypted Virtualization command */
enum sev_cmd_id { enum sev_cmd_id {
......
...@@ -144,7 +144,7 @@ enum perf_event_sample_format { ...@@ -144,7 +144,7 @@ enum perf_event_sample_format {
PERF_SAMPLE_MAX = 1U << 20, /* non-ABI */ PERF_SAMPLE_MAX = 1U << 20, /* non-ABI */
__PERF_SAMPLE_CALLCHAIN_EARLY = 1ULL << 63, __PERF_SAMPLE_CALLCHAIN_EARLY = 1ULL << 63, /* non-ABI; internal use */
}; };
/* /*
......
...@@ -65,6 +65,7 @@ struct vhost_iotlb_msg { ...@@ -65,6 +65,7 @@ struct vhost_iotlb_msg {
}; };
#define VHOST_IOTLB_MSG 0x1 #define VHOST_IOTLB_MSG 0x1
#define VHOST_IOTLB_MSG_V2 0x2
struct vhost_msg { struct vhost_msg {
int type; int type;
...@@ -74,6 +75,15 @@ struct vhost_msg { ...@@ -74,6 +75,15 @@ struct vhost_msg {
}; };
}; };
struct vhost_msg_v2 {
__u32 type;
__u32 reserved;
union {
struct vhost_iotlb_msg iotlb;
__u8 padding[64];
};
};
struct vhost_memory_region { struct vhost_memory_region {
__u64 guest_phys_addr; __u64 guest_phys_addr;
__u64 memory_size; /* bytes */ __u64 memory_size; /* bytes */
...@@ -160,6 +170,14 @@ struct vhost_memory { ...@@ -160,6 +170,14 @@ struct vhost_memory {
#define VHOST_GET_VRING_BUSYLOOP_TIMEOUT _IOW(VHOST_VIRTIO, 0x24, \ #define VHOST_GET_VRING_BUSYLOOP_TIMEOUT _IOW(VHOST_VIRTIO, 0x24, \
struct vhost_vring_state) struct vhost_vring_state)
/* Set or get vhost backend capability */
/* Use message type V2 */
#define VHOST_BACKEND_F_IOTLB_MSG_V2 0x1
#define VHOST_SET_BACKEND_FEATURES _IOW(VHOST_VIRTIO, 0x25, __u64)
#define VHOST_GET_BACKEND_FEATURES _IOR(VHOST_VIRTIO, 0x26, __u64)
/* VHOST_NET specific defines */ /* VHOST_NET specific defines */
/* Attach virtio net ring to a raw socket, or tap device. /* Attach virtio net ring to a raw socket, or tap device.
......
libbpf-y := libbpf.o bpf.o nlattr.o btf.o libbpf_errno.o libbpf-y := libbpf.o bpf.o nlattr.o btf.o libbpf_errno.o str_error.o
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
#include "libbpf.h" #include "libbpf.h"
#include "bpf.h" #include "bpf.h"
#include "btf.h" #include "btf.h"
#include "str_error.h"
#ifndef EM_BPF #ifndef EM_BPF
#define EM_BPF 247 #define EM_BPF 247
...@@ -469,7 +470,7 @@ static int bpf_object__elf_init(struct bpf_object *obj) ...@@ -469,7 +470,7 @@ static int bpf_object__elf_init(struct bpf_object *obj)
obj->efile.fd = open(obj->path, O_RDONLY); obj->efile.fd = open(obj->path, O_RDONLY);
if (obj->efile.fd < 0) { if (obj->efile.fd < 0) {
char errmsg[STRERR_BUFSIZE]; char errmsg[STRERR_BUFSIZE];
char *cp = strerror_r(errno, errmsg, sizeof(errmsg)); char *cp = str_error(errno, errmsg, sizeof(errmsg));
pr_warning("failed to open %s: %s\n", obj->path, cp); pr_warning("failed to open %s: %s\n", obj->path, cp);
return -errno; return -errno;
...@@ -810,8 +811,7 @@ static int bpf_object__elf_collect(struct bpf_object *obj) ...@@ -810,8 +811,7 @@ static int bpf_object__elf_collect(struct bpf_object *obj)
data->d_size, name, idx); data->d_size, name, idx);
if (err) { if (err) {
char errmsg[STRERR_BUFSIZE]; char errmsg[STRERR_BUFSIZE];
char *cp = strerror_r(-err, errmsg, char *cp = str_error(-err, errmsg, sizeof(errmsg));
sizeof(errmsg));
pr_warning("failed to alloc program %s (%s): %s", pr_warning("failed to alloc program %s (%s): %s",
name, obj->path, cp); name, obj->path, cp);
...@@ -1140,7 +1140,7 @@ bpf_object__create_maps(struct bpf_object *obj) ...@@ -1140,7 +1140,7 @@ bpf_object__create_maps(struct bpf_object *obj)
*pfd = bpf_create_map_xattr(&create_attr); *pfd = bpf_create_map_xattr(&create_attr);
if (*pfd < 0 && create_attr.btf_key_type_id) { if (*pfd < 0 && create_attr.btf_key_type_id) {
cp = strerror_r(errno, errmsg, sizeof(errmsg)); cp = str_error(errno, errmsg, sizeof(errmsg));
pr_warning("Error in bpf_create_map_xattr(%s):%s(%d). Retrying without BTF.\n", pr_warning("Error in bpf_create_map_xattr(%s):%s(%d). Retrying without BTF.\n",
map->name, cp, errno); map->name, cp, errno);
create_attr.btf_fd = 0; create_attr.btf_fd = 0;
...@@ -1155,7 +1155,7 @@ bpf_object__create_maps(struct bpf_object *obj) ...@@ -1155,7 +1155,7 @@ bpf_object__create_maps(struct bpf_object *obj)
size_t j; size_t j;
err = *pfd; err = *pfd;
cp = strerror_r(errno, errmsg, sizeof(errmsg)); cp = str_error(errno, errmsg, sizeof(errmsg));
pr_warning("failed to create map (name: '%s'): %s\n", pr_warning("failed to create map (name: '%s'): %s\n",
map->name, cp); map->name, cp);
for (j = 0; j < i; j++) for (j = 0; j < i; j++)
...@@ -1339,7 +1339,7 @@ load_program(enum bpf_prog_type type, enum bpf_attach_type expected_attach_type, ...@@ -1339,7 +1339,7 @@ load_program(enum bpf_prog_type type, enum bpf_attach_type expected_attach_type,
} }
ret = -LIBBPF_ERRNO__LOAD; ret = -LIBBPF_ERRNO__LOAD;
cp = strerror_r(errno, errmsg, sizeof(errmsg)); cp = str_error(errno, errmsg, sizeof(errmsg));
pr_warning("load bpf program failed: %s\n", cp); pr_warning("load bpf program failed: %s\n", cp);
if (log_buf && log_buf[0] != '\0') { if (log_buf && log_buf[0] != '\0') {
...@@ -1654,7 +1654,7 @@ static int check_path(const char *path) ...@@ -1654,7 +1654,7 @@ static int check_path(const char *path)
dir = dirname(dname); dir = dirname(dname);
if (statfs(dir, &st_fs)) { if (statfs(dir, &st_fs)) {
cp = strerror_r(errno, errmsg, sizeof(errmsg)); cp = str_error(errno, errmsg, sizeof(errmsg));
pr_warning("failed to statfs %s: %s\n", dir, cp); pr_warning("failed to statfs %s: %s\n", dir, cp);
err = -errno; err = -errno;
} }
...@@ -1690,7 +1690,7 @@ int bpf_program__pin_instance(struct bpf_program *prog, const char *path, ...@@ -1690,7 +1690,7 @@ int bpf_program__pin_instance(struct bpf_program *prog, const char *path,
} }
if (bpf_obj_pin(prog->instances.fds[instance], path)) { if (bpf_obj_pin(prog->instances.fds[instance], path)) {
cp = strerror_r(errno, errmsg, sizeof(errmsg)); cp = str_error(errno, errmsg, sizeof(errmsg));
pr_warning("failed to pin program: %s\n", cp); pr_warning("failed to pin program: %s\n", cp);
return -errno; return -errno;
} }
...@@ -1708,7 +1708,7 @@ static int make_dir(const char *path) ...@@ -1708,7 +1708,7 @@ static int make_dir(const char *path)
err = -errno; err = -errno;
if (err) { if (err) {
cp = strerror_r(-err, errmsg, sizeof(errmsg)); cp = str_error(-err, errmsg, sizeof(errmsg));
pr_warning("failed to mkdir %s: %s\n", path, cp); pr_warning("failed to mkdir %s: %s\n", path, cp);
} }
return err; return err;
...@@ -1770,7 +1770,7 @@ int bpf_map__pin(struct bpf_map *map, const char *path) ...@@ -1770,7 +1770,7 @@ int bpf_map__pin(struct bpf_map *map, const char *path)
} }
if (bpf_obj_pin(map->fd, path)) { if (bpf_obj_pin(map->fd, path)) {
cp = strerror_r(errno, errmsg, sizeof(errmsg)); cp = str_error(errno, errmsg, sizeof(errmsg));
pr_warning("failed to pin map: %s\n", cp); pr_warning("failed to pin map: %s\n", cp);
return -errno; return -errno;
} }
......
// SPDX-License-Identifier: LGPL-2.1
#undef _GNU_SOURCE
#include <string.h>
#include <stdio.h>
#include "str_error.h"
/*
* Wrapper to allow for building in non-GNU systems such as Alpine Linux's musl
* libc, while checking strerror_r() return to avoid having to check this in
* all places calling it.
*/
char *str_error(int err, char *dst, int len)
{
int ret = strerror_r(err, dst, len);
if (ret)
snprintf(dst, len, "ERROR: strerror_r(%d)=%d", err, ret);
return dst;
}
// SPDX-License-Identifier: LGPL-2.1
#ifndef BPF_STR_ERROR
#define BPF_STR_ERROR
char *str_error(int err, char *dst, int len);
#endif // BPF_STR_ERROR
...@@ -280,7 +280,7 @@ $(MAN_HTML): $(OUTPUT)%.html : %.txt ...@@ -280,7 +280,7 @@ $(MAN_HTML): $(OUTPUT)%.html : %.txt
mv $@+ $@ mv $@+ $@
ifdef USE_ASCIIDOCTOR ifdef USE_ASCIIDOCTOR
$(OUTPUT)%.1 $(OUTPUT)%.5 $(OUTPUT)%.7 : $(OUTPUT)%.txt $(OUTPUT)%.1 $(OUTPUT)%.5 $(OUTPUT)%.7 : %.txt
$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \ $(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
$(ASCIIDOC) -b manpage -d manpage \ $(ASCIIDOC) -b manpage -d manpage \
$(ASCIIDOC_EXTRA) -aperf_version=$(PERF_VERSION) -o $@+ $< && \ $(ASCIIDOC_EXTRA) -aperf_version=$(PERF_VERSION) -o $@+ $< && \
......
...@@ -574,6 +574,13 @@ struct symbol *map_groups__find_symbol(struct map_groups *mg, ...@@ -574,6 +574,13 @@ struct symbol *map_groups__find_symbol(struct map_groups *mg,
return NULL; return NULL;
} }
static bool map__contains_symbol(struct map *map, struct symbol *sym)
{
u64 ip = map->unmap_ip(map, sym->start);
return ip >= map->start && ip < map->end;
}
struct symbol *maps__find_symbol_by_name(struct maps *maps, const char *name, struct symbol *maps__find_symbol_by_name(struct maps *maps, const char *name,
struct map **mapp) struct map **mapp)
{ {
...@@ -589,6 +596,10 @@ struct symbol *maps__find_symbol_by_name(struct maps *maps, const char *name, ...@@ -589,6 +596,10 @@ struct symbol *maps__find_symbol_by_name(struct maps *maps, const char *name,
if (sym == NULL) if (sym == NULL)
continue; continue;
if (!map__contains_symbol(pos, sym)) {
sym = NULL;
continue;
}
if (mapp != NULL) if (mapp != NULL)
*mapp = pos; *mapp = pos;
goto out; goto out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment