summaryrefslogtreecommitdiff
path: root/samples/bpf/bpf_load.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2017-02-14 07:29:38 +0100
committerIngo Molnar <mingo@kernel.org>2017-02-14 07:29:38 +0100
commit277d6f1dcae09aed63cd4c7900a280b0e18cf2ca (patch)
treefef746abe14f0cff91621405e501855df85d915d /samples/bpf/bpf_load.c
parent210f400d68a14bc89e2e61dc2e06cdd67cfeb5f6 (diff)
parenta734fb5d60067a73dd7099a58756847c07f9cd68 (diff)
downloadlinux-277d6f1dcae09aed63cd4c7900a280b0e18cf2ca.tar.gz
linux-277d6f1dcae09aed63cd4c7900a280b0e18cf2ca.tar.xz
Merge tag 'perf-core-for-mingo-4.11-20170213' 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: New features: - Introduce the 'delta-abs' 'perf diff' compute method, that orders the histogram entries by the absolute value of the percentage delta for a function in two perf.data files, i.e. the functions that changed the most (increase or decrease in samples) comes first (Namhyung Kim) User visible changes: - Improve message about tweaking the kernel.perf_event_paranoid setting, telling how to make the change permanent by editing /etc/sysctl.conf (Arnaldo Carvalho de Melo) Infrastructure changes: - Introduce linux/compiler-gcc.h as a counterpart to the kernel's, initially containing the definition of __fallthrough, more to come (__maybe_unused, etc) (Arnaldo Carvalho de Melo) - Fixes for problems uncovered by building tools/perf with clang, such as always true tests of arrays against NULL and variables that sometimes were used without being initialized (Arnaldo Carvalho de Melo, Steven Rostedt) - Before loading a new ELF, clear global variables set by the samples/bpf loader (Mickaël Salaün) - Ignore already processed ELF sections in the samples/bpf loader (Mickaël Salaün) - Fix compile error in the scripting code with some perl5 versions (Wang YanQing) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'samples/bpf/bpf_load.c')
-rw-r--r--samples/bpf/bpf_load.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/samples/bpf/bpf_load.c b/samples/bpf/bpf_load.c
index 396e204888b3..b86ee54da2d1 100644
--- a/samples/bpf/bpf_load.c
+++ b/samples/bpf/bpf_load.c
@@ -277,6 +277,11 @@ int load_bpf_file(char *path)
Elf_Data *data, *data_prog, *symbols = NULL;
char *shname, *shname_prog;
+ /* reset global variables */
+ kern_version = 0;
+ memset(license, 0, sizeof(license));
+ memset(processed_sec, 0, sizeof(processed_sec));
+
if (elf_version(EV_CURRENT) == EV_NONE)
return 1;
@@ -328,6 +333,8 @@ int load_bpf_file(char *path)
/* load programs that need map fixup (relocations) */
for (i = 1; i < ehdr.e_shnum; i++) {
+ if (processed_sec[i])
+ continue;
if (get_sec(elf, i, &ehdr, &shname, &shdr, &data))
continue;