linux/tools
Arnaldo Carvalho de Melo 872523233d perf bpf: Don't warn about unavailability of builtin clang, just fallback
When clang is not linked with 'perf' we should just add a debug message
about that before doing the fallback to calling the external compiler.

I.e. just the "-95" warning below gets turned into a debug message:

  # cat sys_enter_open.c
  #include "bpf.h"

  SEC("syscalls:sys_enter_open")
  int func(void *ctx)
  {
	struct {
		char *ptr;
		char path[256];
	} filename = {
		.ptr = *((char **)(ctx + 16)),
	};
	int len = bpf_probe_read_str(filename.path, sizeof(filename.path), filename.ptr);
	if (len > 0) {
		if (len == 1)
			perf_event_output(ctx, &__bpf_stdout__, BPF_F_CURRENT_CPU, &filename, len + sizeof(filename.ptr));
		else if (len < 256)
			perf_event_output(ctx, &__bpf_stdout__, BPF_F_CURRENT_CPU, &filename, len + sizeof(filename.ptr));
        }
	return 0;
  }
  # trace -e open,sys_enter_open.c
  bpf: builtin compilation failed: -95, try external compiler
     0.000 (         ): __bpf_stdout__:@......./proc/self/task/11160/comm..)
     0.014 ( 0.116 ms): qemu-system-x8/6721 open(filename: /proc/self/task/11160/comm, flags: RDWR) = 91
  2335.411 (         ): __bpf_stdout__:FB..~.../etc/resolv.conf....)
  2335.421 ( 0.030 ms): chronyd/883 open(filename: /etc/resolv.conf, flags: CLOEXEC) = 5
^C#

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: https://lkml.kernel.org/n/tip-z5aak9oay448ffj37giz94yr@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2018-01-18 13:07:00 -03:00
..
accounting License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
arch tools headers: Synchronize kernel <-> tooling headers 2018-01-10 12:46:54 -03:00
bpf tools: bpftool: protect against races with disappearing objects 2017-12-23 01:09:52 +01:00
build tools build feature: Check if pthread_barrier_t is available 2017-12-05 10:21:59 -03:00
cgroup License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
firewire License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
gpio This is the bulk of GPIO changes for the v4.15 kernel cycle: 2017-11-14 17:23:44 -08:00
hv hv: kvp: Avoid reading past allocated blocks from KVP file 2017-11-28 16:56:26 +01:00
iio License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
include perf: Update PERF_RECORD_MISC_* comment for perf_event_header::misc bit 13 2018-01-08 12:37:54 -03:00
kvm/kvm_stat tools/kvm_stat: sort '-f help' output 2017-12-21 13:03:32 +01:00
laptop License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
leds License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
lib tools lib traceevent: Fix get_field_str() for dynamic strings 2018-01-17 10:23:21 -03:00
nfsd License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
objtool objtool: Fix seg fault with clang-compiled objects 2017-12-30 22:04:17 +01:00
pci License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pcmcia License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
perf perf bpf: Don't warn about unavailability of builtin clang, just fallback 2018-01-18 13:07:00 -03:00
power Power management fixes for v4.15-rc2 2017-11-30 18:45:55 -05:00
scripts kbuild: /bin/pwd -> pwd 2017-11-18 11:32:27 +09:00
spi License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
testing Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf 2018-01-10 11:17:21 -05:00
thermal/tmon Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux 2017-11-17 14:31:27 -08:00
time
usb usbip: fix usbip bind writing random string after command in match_busid 2017-12-19 11:40:55 +01:00
virtio virtio: regression fixes 2017-12-15 12:56:23 -08:00
vm tools/slabinfo-gnuplot: force to use bash shell 2017-12-14 16:00:48 -08:00
wmi tools/wmi: add a sample for dell smbios communication over WMI 2017-11-03 16:34:00 -07:00
Makefile platform-drivers-x86 for v4.15-1 2017-11-18 10:26:57 -08:00