Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b8ab9220 authored by Ingo Molnar's avatar Ingo Molnar
Browse files

Merge tag 'perf-core-for-mingo-20160607' of...

Merge tag 'perf-core-for-mingo-20160607' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux

 into perf/core

Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo:

User visible changes:

- Support cross unwinding, i.e. collecting '--call-graph dwarf' perf.data files
  in one machine and then doing analysis in another machine of a different
  hardware architecture. This enables, for instance, to do:

	perf record -a --call-graph dwarf

  on a x86-32 or aarch64 system and then do 'perf report' on it on a
  x86_64 workstation. (He Kuang)

- Fix crash in build_id_cache__kallsyms_path(), recent regression (Wang Nan)

Infrastructure changes:

- Make tools/lib/bpf use the IS_ERR return facility consistently and also stop
  using the _get_ term for non-reference count methods (Arnaldo Carvalho de Melo)

- 'perf config' refactorings (Taeung Song)

Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parents aa3a655b 057fbfb2
Loading
Loading
Loading
Loading
+19 −41
Original line number Diff line number Diff line
@@ -1186,20 +1186,14 @@ bpf_object__next(struct bpf_object *prev)
	return next;
}

const char *
bpf_object__get_name(struct bpf_object *obj)
const char *bpf_object__name(struct bpf_object *obj)
{
	if (!obj)
		return ERR_PTR(-EINVAL);
	return obj->path;
	return obj ? obj->path : ERR_PTR(-EINVAL);
}

unsigned int
bpf_object__get_kversion(struct bpf_object *obj)
unsigned int bpf_object__kversion(struct bpf_object *obj)
{
	if (!obj)
		return 0;
	return obj->kern_version;
	return obj ? obj->kern_version : 0;
}

struct bpf_program *
@@ -1224,8 +1218,7 @@ bpf_program__next(struct bpf_program *prev, struct bpf_object *obj)
	return &obj->programs[idx];
}

int bpf_program__set_private(struct bpf_program *prog,
			     void *priv,
int bpf_program__set_priv(struct bpf_program *prog, void *priv,
			  bpf_program_clear_priv_t clear_priv)
{
	if (prog->priv && prog->clear_priv)
@@ -1236,10 +1229,9 @@ int bpf_program__set_private(struct bpf_program *prog,
	return 0;
}

int bpf_program__get_private(struct bpf_program *prog, void **ppriv)
void *bpf_program__priv(struct bpf_program *prog)
{
	*ppriv = prog->priv;
	return 0;
	return prog ? prog->priv : ERR_PTR(-EINVAL);
}

const char *bpf_program__title(struct bpf_program *prog, bool needs_copy)
@@ -1311,31 +1303,22 @@ int bpf_program__nth_fd(struct bpf_program *prog, int n)
	return fd;
}

int bpf_map__get_fd(struct bpf_map *map)
int bpf_map__fd(struct bpf_map *map)
{
	if (!map)
		return -EINVAL;

	return map->fd;
	return map ? map->fd : -EINVAL;
}

int bpf_map__get_def(struct bpf_map *map, struct bpf_map_def *pdef)
const struct bpf_map_def *bpf_map__def(struct bpf_map *map)
{
	if (!map || !pdef)
		return -EINVAL;

	*pdef = map->def;
	return 0;
	return map ? &map->def : ERR_PTR(-EINVAL);
}

const char *bpf_map__get_name(struct bpf_map *map)
const char *bpf_map__name(struct bpf_map *map)
{
	if (!map)
		return NULL;
	return map->name;
	return map ? map->name : NULL;
}

int bpf_map__set_private(struct bpf_map *map, void *priv,
int bpf_map__set_priv(struct bpf_map *map, void *priv,
		     bpf_map_clear_priv_t clear_priv)
{
	if (!map)
@@ -1351,14 +1334,9 @@ int bpf_map__set_private(struct bpf_map *map, void *priv,
	return 0;
}

int bpf_map__get_private(struct bpf_map *map, void **ppriv)
void *bpf_map__priv(struct bpf_map *map)
{
	if (!map)
		return -EINVAL;

	if (ppriv)
		*ppriv = map->priv;
	return 0;
	return map ? map->priv : ERR_PTR(-EINVAL);
}

struct bpf_map *
@@ -1389,7 +1367,7 @@ bpf_map__next(struct bpf_map *prev, struct bpf_object *obj)
}

struct bpf_map *
bpf_object__get_map_by_name(struct bpf_object *obj, const char *name)
bpf_object__find_map_by_name(struct bpf_object *obj, const char *name)
{
	struct bpf_map *pos;

+12 −13
Original line number Diff line number Diff line
@@ -55,8 +55,8 @@ void bpf_object__close(struct bpf_object *object);
/* Load/unload object into/from kernel */
int bpf_object__load(struct bpf_object *obj);
int bpf_object__unload(struct bpf_object *obj);
const char *bpf_object__get_name(struct bpf_object *obj);
unsigned int bpf_object__get_kversion(struct bpf_object *obj);
const char *bpf_object__name(struct bpf_object *obj);
unsigned int bpf_object__kversion(struct bpf_object *obj);

struct bpf_object *bpf_object__next(struct bpf_object *prev);
#define bpf_object__for_each_safe(pos, tmp)			\
@@ -78,11 +78,10 @@ struct bpf_program *bpf_program__next(struct bpf_program *prog,
typedef void (*bpf_program_clear_priv_t)(struct bpf_program *,
					 void *);

int bpf_program__set_private(struct bpf_program *prog, void *priv,
int bpf_program__set_priv(struct bpf_program *prog, void *priv,
			  bpf_program_clear_priv_t clear_priv);

int bpf_program__get_private(struct bpf_program *prog,
			     void **ppriv);
void *bpf_program__priv(struct bpf_program *prog);

const char *bpf_program__title(struct bpf_program *prog, bool needs_copy);

@@ -171,7 +170,7 @@ struct bpf_map_def {
 */
struct bpf_map;
struct bpf_map *
bpf_object__get_map_by_name(struct bpf_object *obj, const char *name);
bpf_object__find_map_by_name(struct bpf_object *obj, const char *name);

struct bpf_map *
bpf_map__next(struct bpf_map *map, struct bpf_object *obj);
@@ -180,13 +179,13 @@ bpf_map__next(struct bpf_map *map, struct bpf_object *obj);
	     (pos) != NULL;				\
	     (pos) = bpf_map__next((pos), (obj)))

int bpf_map__get_fd(struct bpf_map *map);
int bpf_map__get_def(struct bpf_map *map, struct bpf_map_def *pdef);
const char *bpf_map__get_name(struct bpf_map *map);
int bpf_map__fd(struct bpf_map *map);
const struct bpf_map_def *bpf_map__def(struct bpf_map *map);
const char *bpf_map__name(struct bpf_map *map);

typedef void (*bpf_map_clear_priv_t)(struct bpf_map *, void *);
int bpf_map__set_private(struct bpf_map *map, void *priv,
int bpf_map__set_priv(struct bpf_map *map, void *priv,
		      bpf_map_clear_priv_t clear_priv);
int bpf_map__get_private(struct bpf_map *map, void **ppriv);
void *bpf_map__priv(struct bpf_map *map);

#endif
+1 −1
Original line number Diff line number Diff line
libperf-$(CONFIG_DWARF) += dwarf-regs.o

libperf-$(CONFIG_LIBUNWIND)          += unwind-libunwind.o
libperf-$(CONFIG_LOCAL_LIBUNWIND)    += unwind-libunwind.o
libperf-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o
+1 −1
Original line number Diff line number Diff line
libperf-$(CONFIG_DWARF)     += dwarf-regs.o
libperf-$(CONFIG_LIBUNWIND) += unwind-libunwind.o
libperf-$(CONFIG_LOCAL_LIBUNWIND) += unwind-libunwind.o
+3 −1
Original line number Diff line number Diff line

#ifndef REMOTE_UNWIND_LIBUNWIND
#include <errno.h>
#include <libunwind.h>
#include "perf_regs.h"
#include "../../util/unwind.h"
#include "../../util/debug.h"
#endif

int libunwind__arch_reg_id(int regnum)
int LIBUNWIND__ARCH_REG_ID(int regnum)
{
	switch (regnum) {
	case UNW_AARCH64_X0:
Loading