Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1254715 > unrolled thread
| Started by | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| First post | 2015-10-23 19:00 +0200 |
| Last post | 2015-10-24 03:30 +0200 |
| Articles | 4 — 3 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH 05/31] perf record: Load eBPF object into kernel Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-10-23 19:00 +0200
Re: [PATCH 05/31] perf record: Load eBPF object into kernel Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-10-24 02:30 +0200
Re: [PATCH 05/31] perf record: Load eBPF object into kernel "Wangnan (F)" <wangnan0@huawei.com> - 2015-10-26 08:20 +0100
Re: [PATCH 05/31] perf record: Load eBPF object into kernel pi3orama <pi3orama@163.com> - 2015-10-24 03:30 +0200
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2015-10-23 19:00 +0200 |
| Subject | Re: [PATCH 05/31] perf record: Load eBPF object into kernel |
| Message-ID | <qmNR9-7hz-43@gated-at.bofh.it> |
Em Wed, Oct 14, 2015 at 12:41:16PM +0000, Wang Nan escreveu:
> This patch utilizes bpf_object__load() provided by libbpf to load all
> objects into kernel.
So, testing this, using that other proggie, I get;
# perf record --event /tmp/foo.o sleep 1
libbpf: load bpf program failed: Invalid argument
libbpf: -- BEGIN DUMP LOG ---
libbpf:
libbpf: -- END LOG --
libbpf: failed to load program 'fork=_do_fork'
libbpf: failed to load object '/tmp/foo.o'
event syntax error: '/tmp/foo.o'
\___ Invalid argument: Are you root and runing a CONFIG_BPF_SYSCALL kernel?
(add -v to see detail)
Run 'perf list' for a list of valid events
Usage: perf record [<options>] [<command>]
or: perf record [<options>] -- <command> [<options>]
-e, --event <event> event selector. use 'perf list' to list available events
But:
[root@felicio ~]# grep -i bpf /proc/kallsyms | wc -l
117
[root@felicio ~]# grep -i sys_bpf /proc/kallsyms
ffffffff811829d0 T SyS_bpf
ffffffff811829d0 T sys_bpf
[root@felicio ~]# uname -a
Linux felicio.ghostprotocols.net 4.2.0 #1 SMP Mon Aug 31 12:25:38 BRT
2015 x86_64 x86_64 x86_64 GNU/Linux
[root@felicio ~]#
I'll try updating it to torvalds/master...
For reference, that foo.o eBPF proggie was built with:
[acme@felicio linux]$ cat ~/bin/hello-ebpf
# Taken from 'perf test LLVM'
# Thu Oct 22 12:07:26 BRT 2015
export KERNEL_INC_OPTIONS="-nostdinc -isystem
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/include
-I/home/acme/git/linux/arch/x86/include
-Iarch/x86/include/generated/uapi -Iarch/x86/include/generated
-I/home/acme/git/linux/include -Iinclude
-I/home/acme/git/linux/arch/x86/include/uapi
-Iarch/x86/include/generated/uapi -I/home/acme/git/linux/include/uapi
-Iinclude/generated/uapi -include
/home/acme/git/linux/include/linux/kconfig.h"
export WORKING_DIR=/lib/modules/4.2.0/build
export CLANG_SOURCE=-
export CLANG_OPTIONS=-xc
OBJ=/tmp/foo.o
rm -f $OBJ
echo '__attribute__((section("fork=_do_fork"), used)) int fork(void
*ctx) {return 0;} char _license[] __attribute__((section("license"),
used)) = "GPL";int _version __attribute__((section("version"), used)) =
0x40100;' | clang -D__KERNEL__ $CLANG_OPTIONS $KERNEL_INC_OPTIONS
-Wno-unused-value -Wno-pointer-sign -working-directory $WORKING_DIR -c
"$CLANG_SOURCE" -target bpf -O2 -o /tmp/foo.o && file $OBJ
- Arnaldo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2015-10-24 02:30 +0200 |
| Message-ID | <qmUSB-GO-1@gated-at.bofh.it> |
| In reply to | #1254715 |
Em Fri, Oct 23, 2015 at 01:58:40PM -0300, Arnaldo Carvalho de Melo escreveu:
> I'll try updating it to torvalds/master...
Ok, still the same problem, this time with -vv, what does the following message
mean?
libbpf: don't need create maps for /tmp/foo.o
Full output:
[acme@felicio linux]$ sudo ~/bin/perf record -vv --event /tmp/foo.o sleep 1
libbpf: loading /tmp/foo.o
libbpf: section .strtab, size 66, link 0, flags 0, type=3
libbpf: section .text, size 0, link 0, flags 6, type=1
libbpf: section .data, size 0, link 0, flags 3, type=1
libbpf: section .bss, size 0, link 0, flags 3, type=8
libbpf: section fork=_do_fork, size 16, link 0, flags 6, type=1
libbpf: found program fork=_do_fork
libbpf: section license, size 4, link 0, flags 3, type=1
libbpf: license of /tmp/foo.o is GPL
libbpf: section version, size 4, link 0, flags 3, type=1
libbpf: kernel version of /tmp/foo.o is 40100
libbpf: section .symtab, size 96, link 1, flags 0, type=2
bpf: config program 'fork=_do_fork'
symbol:_do_fork file:(null) line:0 offset:0 return:0 lazy:(null)
bpf: config 'fork=_do_fork' is ok
Blacklist: 0xffffffff81016f10-0xffffffff81016f50, do_device_not_available
Blacklist: 0xffffffff810171f0-0xffffffff810173e0, do_debug
Blacklist: 0xffffffff81016eb0-0xffffffff81016f10, fixup_bad_iret
Blacklist: 0xffffffff81016bd0-0xffffffff81016c00, sync_regs
Blacklist: 0xffffffff81016f50-0xffffffff810170a0, do_int3
Blacklist: 0xffffffff810170a0-0xffffffff810171f0, do_general_protection
Blacklist: 0xffffffff81016c00-0xffffffff81016d40, do_trap
Blacklist: 0xffffffff81019a10-0xffffffff81019af0, __die
Blacklist: 0xffffffff810198e0-0xffffffff810199b0, oops_end
Blacklist: 0xffffffff81019830-0xffffffff810198e0, oops_begin
Blacklist: 0xffffffff8101a770-0xffffffff8101a8c0, do_nmi
Blacklist: 0xffffffff8101a680-0xffffffff8101a770, default_do_nmi
Blacklist: 0xffffffff8101a560-0xffffffff8101a5f0, unknown_nmi_error
Blacklist: 0xffffffff8101a5f0-0xffffffff8101a680, io_check_error
Blacklist: 0xffffffff8101a4e0-0xffffffff8101a560, pci_serr_error
Blacklist: 0xffffffff8101a0d0-0xffffffff8101a1f0, nmi_handle
Blacklist: 0xffffffff81027a90-0xffffffff81027b10, debug_stack_reset
Blacklist: 0xffffffff81027a40-0xffffffff81027a90, debug_stack_set_zero
Blacklist: 0xffffffff81027a00-0xffffffff81027a40, is_debug_stack
Blacklist: 0xffffffff8102b400-0xffffffff8102b440, perf_event_nmi_handler
Blacklist: 0xffffffff8104b020-0xffffffff8104b060, perf_ibs_nmi_handler
Blacklist: 0xffffffff810526a0-0xffffffff810526c0, arch_trigger_all_cpu_backtrace_handler
Blacklist: 0xffffffff8105b090-0xffffffff8105b180, longjmp_break_handler
Blacklist: 0xffffffff8105ae21-0xffffffff8105ae30, jprobe_return_end
Blacklist: 0xffffffff8105ae00-0xffffffff8105ae21, jprobe_return
Blacklist: 0xffffffff8105ae70-0xffffffff8105af10, setjmp_pre_handler
Blacklist: 0xffffffff8105b040-0xffffffff8105b090, kprobe_exceptions_notify
Blacklist: 0xffffffff8105af10-0xffffffff8105b040, kprobe_fault_handler
Blacklist: 0xffffffff8105b8f0-0xffffffff8105b9c0, kprobe_debug_handler
Blacklist: 0xffffffff8105b720-0xffffffff8105b8f0, resume_execution
Blacklist: 0xffffffff8105b180-0xffffffff8105b380, trampoline_handler
Blacklist: 0xffffffff8105ada9-0xffffffff8105ae00, kretprobe_trampoline
Blacklist: 0xffffffff8105ada0-0xffffffff8105ada9, kretprobe_trampoline_holder
Blacklist: 0xffffffff8105b5c0-0xffffffff8105b720, kprobe_int3_handler
Blacklist: 0xffffffff8105b520-0xffffffff8105b5c0, reenter_kprobe
Blacklist: 0xffffffff8105b380-0xffffffff8105b520, setup_singlestep
Blacklist: 0xffffffff8105ad80-0xffffffff8105ada0, arch_prepare_kretprobe
Blacklist: 0xffffffff8105ae30-0xffffffff8105ae70, skip_prefixes
Blacklist: 0xffffffff8105ad60-0xffffffff8105ad80, synthesize_relcall
Blacklist: 0xffffffff8105ad40-0xffffffff8105ad60, synthesize_reljump
Blacklist: 0xffffffff8105c0c0-0xffffffff8105c110, setup_detour_execution
Blacklist: 0xffffffff8105c020-0xffffffff8105c0c0, optimized_callback
Blacklist: 0xffffffff8105c860-0xffffffff8105c970, kprobe_ftrace_handler
Blacklist: 0xffffffff8105c970-0xffffffff8105c9c0, skip_singlestep
Blacklist: 0xffffffff8105fec0-0xffffffff8105ff70, do_async_page_fault
Blacklist: 0xffffffff8105f820-0xffffffff8105f850, kvm_read_and_reset_pf_reason
Blacklist: 0xffffffff810607a0-0xffffffff810607b0, native_load_idt
Blacklist: 0xffffffff81060a30-0xffffffff81060a80, native_set_debugreg
Blacklist: 0xffffffff81060a80-0xffffffff81060ad0, native_get_debugreg
Blacklist: 0xffffffff81064f00-0xffffffff81064ff0, trace_do_page_fault
Blacklist: 0xffffffff81064e80-0xffffffff81064f00, do_page_fault
Blacklist: 0xffffffff81064a90-0xffffffff81064e80, __do_page_fault
Blacklist: 0xffffffff81064900-0xffffffff81064a90, spurious_fault
Blacklist: 0xffffffff81063e50-0xffffffff810640d0, vmalloc_fault
Blacklist: 0xffffffff810bb8d0-0xffffffff810bb930, notify_die
Blacklist: 0xffffffff810bb7f0-0xffffffff810bb810, atomic_notifier_call_chain
Blacklist: 0xffffffff810bb7d0-0xffffffff810bb7f0, __atomic_notifier_call_chain
Blacklist: 0xffffffff810bb760-0xffffffff810bb7d0, notifier_call_chain
Blacklist: 0xffffffff8113fb70-0xffffffff8113fbb0, dump_kprobe
Blacklist: 0xffffffff8113fdf0-0xffffffff8113ffa0, pre_handler_kretprobe
Blacklist: 0xffffffff81141290-0xffffffff81141360, cleanup_rp_inst
Blacklist: 0xffffffff811408a0-0xffffffff811409c0, kprobe_flush_task
Blacklist: 0xffffffff8113fce0-0xffffffff8113fd00, kretprobe_table_unlock
Blacklist: 0xffffffff8113fcb0-0xffffffff8113fce0, kretprobe_hash_unlock
Blacklist: 0xffffffff8113fc80-0xffffffff8113fcb0, kretprobe_table_lock
Blacklist: 0xffffffff8113fc40-0xffffffff8113fc80, kretprobe_hash_lock
Blacklist: 0xffffffff81140800-0xffffffff811408a0, recycle_rp_inst
Blacklist: 0xffffffff81140300-0xffffffff81140370, kprobes_inc_nmissed_count
Blacklist: 0xffffffff8113f840-0xffffffff8113f880, aggr_break_handler
Blacklist: 0xffffffff8113f800-0xffffffff8113f840, aggr_fault_handler
Blacklist: 0xffffffff8113fa30-0xffffffff8113fad0, aggr_post_handler
Blacklist: 0xffffffff8113f990-0xffffffff8113fa30, aggr_pre_handler
Blacklist: 0xffffffff8113f900-0xffffffff8113f990, opt_pre_handler
Blacklist: 0xffffffff8113f7b0-0xffffffff8113f800, get_kprobe
Blacklist: 0xffffffff81173100-0xffffffff811731e0, perf_trace_buf_prepare
Blacklist: 0xffffffff81179380-0xffffffff811793e0, kretprobe_dispatcher
Blacklist: 0xffffffff8117a650-0xffffffff8117a6a0, kprobe_dispatcher
Blacklist: 0xffffffff81178280-0xffffffff811784d0, kretprobe_perf_func
Blacklist: 0xffffffff81178030-0xffffffff81178280, kprobe_perf_func
Blacklist: 0xffffffff81178ff0-0xffffffff81179380, kretprobe_trace_func
Blacklist: 0xffffffff8117a2e0-0xffffffff8117a650, kprobe_trace_func
Blacklist: 0xffffffff81178e90-0xffffffff81178eb0, fetch_symbol_string_size
Blacklist: 0xffffffff81178010-0xffffffff81178030, fetch_symbol_string
Blacklist: 0xffffffff8117a210-0xffffffff8117a230, fetch_symbol_u64
Blacklist: 0xffffffff8117a2c0-0xffffffff8117a2e0, fetch_symbol_u32
Blacklist: 0xffffffff8117a160-0xffffffff8117a180, fetch_symbol_u16
Blacklist: 0xffffffff8117a0b0-0xffffffff8117a0d0, fetch_symbol_u8
Blacklist: 0xffffffff81178de0-0xffffffff81178e90, fetch_memory_string_size
Blacklist: 0xffffffff81177fc0-0xffffffff81178010, fetch_memory_string
Blacklist: 0xffffffff8117a180-0xffffffff8117a210, fetch_memory_u64
Blacklist: 0xffffffff8117a230-0xffffffff8117a2c0, fetch_memory_u32
Blacklist: 0xffffffff8117a0d0-0xffffffff8117a160, fetch_memory_u16
Blacklist: 0xffffffff8117a020-0xffffffff8117a0b0, fetch_memory_u8
Blacklist: 0xffffffff81177f90-0xffffffff81177fc0, fetch_stack_u64
Blacklist: 0xffffffff81177f60-0xffffffff81177f90, fetch_stack_u32
Blacklist: 0xffffffff81177f30-0xffffffff81177f60, fetch_stack_u16
Blacklist: 0xffffffff81177f00-0xffffffff81177f30, fetch_stack_u8
Blacklist: 0xffffffff8117e210-0xffffffff8117e220, fetch_user_stack_address
Blacklist: 0xffffffff8117e200-0xffffffff8117e210, fetch_kernel_stack_address
Blacklist: 0xffffffff8117e190-0xffffffff8117e200, fetch_bitfield_u64
Blacklist: 0xffffffff8117e120-0xffffffff8117e190, fetch_bitfield_u32
Blacklist: 0xffffffff8117e0b0-0xffffffff8117e120, fetch_bitfield_u16
Blacklist: 0xffffffff8117e040-0xffffffff8117e0b0, fetch_bitfield_u8
Blacklist: 0xffffffff8117e590-0xffffffff8117e630, free_deref_fetch_param
Blacklist: 0xffffffff8117e500-0xffffffff8117e590, update_deref_fetch_param
Blacklist: 0xffffffff8117dfc0-0xffffffff8117e040, fetch_deref_string_size
Blacklist: 0xffffffff8117df40-0xffffffff8117dfc0, fetch_deref_string
Blacklist: 0xffffffff8117dec0-0xffffffff8117df40, fetch_deref_u64
Blacklist: 0xffffffff8117de40-0xffffffff8117dec0, fetch_deref_u32
Blacklist: 0xffffffff8117ddc0-0xffffffff8117de40, fetch_deref_u16
Blacklist: 0xffffffff8117dd50-0xffffffff8117ddc0, fetch_deref_u8
Blacklist: 0xffffffff8117dd40-0xffffffff8117dd50, fetch_retval_u64
Blacklist: 0xffffffff8117dd30-0xffffffff8117dd40, fetch_retval_u32
Blacklist: 0xffffffff8117dd20-0xffffffff8117dd30, fetch_retval_u16
Blacklist: 0xffffffff8117dd10-0xffffffff8117dd20, fetch_retval_u8
Blacklist: 0xffffffff8117e4e0-0xffffffff8117e500, fetch_reg_u64
Blacklist: 0xffffffff8117e4c0-0xffffffff8117e4e0, fetch_reg_u32
Blacklist: 0xffffffff8117e4a0-0xffffffff8117e4c0, fetch_reg_u16
Blacklist: 0xffffffff8117e480-0xffffffff8117e4a0, fetch_reg_u8
Blacklist: 0xffffffff8117e420-0xffffffff8117e480, print_type_string
Blacklist: 0xffffffff8117e3e0-0xffffffff8117e420, print_type_s64
Blacklist: 0xffffffff8117e3a0-0xffffffff8117e3e0, print_type_s32
Blacklist: 0xffffffff8117e360-0xffffffff8117e3a0, print_type_s16
Blacklist: 0xffffffff8117e320-0xffffffff8117e360, print_type_s8
Blacklist: 0xffffffff8117e2e0-0xffffffff8117e320, print_type_u64
Blacklist: 0xffffffff8117e2a0-0xffffffff8117e2e0, print_type_u32
Blacklist: 0xffffffff8117e260-0xffffffff8117e2a0, print_type_u16
Blacklist: 0xffffffff8117e220-0xffffffff8117e260, print_type_u8
Blacklist: 0xffffffff8119a9a0-0xffffffff8119a9c0, context_tracking_user_exit
Blacklist: 0xffffffff8119a8d0-0xffffffff8119a9a0, context_tracking_exit
Blacklist: 0xffffffff8119aad0-0xffffffff8119aaf0, context_tracking_user_enter
Blacklist: 0xffffffff8119a9c0-0xffffffff8119aad0, context_tracking_enter
Blacklist: 0xffffffff8139f400-0xffffffff8139f470, nmi_cpu_backtrace
Looking at the vmlinux_path (7 entries long)
Using /lib/modules/4.3.0-rc6+/build/vmlinux for symbols
Open Debuginfo file: /lib/modules/4.3.0-rc6+/build/vmlinux
Try to find probe point from debuginfo.
Matched function: _do_fork
Probe point found: _do_fork+0
Found 1 probe_trace_events.
Opening /sys/kernel/debug/tracing//kprobe_events write=1
Writing event: p:perf_bpf_probe/fork _text+638512
libbpf: don't need create maps for /tmp/foo.o
libbpf: load bpf program failed: Invalid argument
libbpf: -- BEGIN DUMP LOG ---
libbpf:
libbpf: -- END LOG --
libbpf: failed to load program 'fork=_do_fork'
libbpf: failed to load object '/tmp/foo.o'
bpf: load objects failed
event syntax error: '/tmp/foo.o'
\___ Invalid argument: Are you root and runing a CONFIG_BPF_SYSCALL kernel?
(add -v to see detail)
Run 'perf list' for a list of valid events
Usage: perf record [<options>] [<command>]
or: perf record [<options>] -- <command> [<options>]
-e, --event <event> event selector. use 'perf list' to list available events
Opening /sys/kernel/debug/tracing//kprobe_events write=1
Opening /sys/kernel/debug/tracing//uprobe_events write=1
Parsing probe_events: p:perf_bpf_probe/fork _text+638512
Group:perf_bpf_probe Event:fork probe:p
Writing event: -:perf_bpf_probe/fork
[acme@felicio linux]$ uname -a
Linux felicio.ghostprotocols.net 4.3.0-rc6+ #1 SMP Fri Oct 23 16:40:25 BRT 2015 x86_64 x86_64 x86_64 GNU/Linux
[acme@felicio linux]$
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | "Wangnan (F)" <wangnan0@huawei.com> |
|---|---|
| Date | 2015-10-26 08:20 +0100 |
| Message-ID | <qnKet-5ir-9@gated-at.bofh.it> |
| In reply to | #1255075 |
Hi Arnaldo,
On 2015/10/24 8:27, Arnaldo Carvalho de Melo wrote:
> libbpf: load bpf program failed: Invalid argument
> libbpf: -- BEGIN DUMP LOG ---
> libbpf:
>
> libbpf: -- END LOG --
> libbpf: failed to load program 'fork=_do_fork'
> libbpf: failed to load object '/tmp/foo.o'
> bpf: load objects failed
> event syntax error: '/tmp/foo.o'
> \___ Invalid argument: Are you root and runing a CONFIG_BPF_SYSCALL kernel?
>
> (add -v to see detail)
> Run 'perf list' for a list of valid events
>
> Usage: perf record [<options>] [<command>]
> or: perf record [<options>] -- <command> [<options>]
>
> -e, --event <event> event selector. use 'perf list' to list available events
> Opening /sys/kernel/debug/tracing//kprobe_events write=1
> Opening /sys/kernel/debug/tracing//uprobe_events write=1
> Parsing probe_events: p:perf_bpf_probe/fork _text+638512
> Group:perf_bpf_probe Event:fork probe:p
> Writing event: -:perf_bpf_probe/fork
> [acme@felicio linux]$ uname -a
> Linux felicio.ghostprotocols.net 4.3.0-rc6+ #1 SMP Fri Oct 23 16:40:25 BRT 2015 x86_64 x86_64 x86_64 GNU/Linux
> [acme@felicio linux]$
>
Please have a look at patch [1]. With that patch kernel will dump
something into
log buffer. In your case, you will see:
root@sandybridge:~# /tmp/perf record -e /tmp/test_config_base.o ls
libbpf: load bpf program failed: Invalid argument
libbpf: -- BEGIN DUMP LOG ---
libbpf:
Kernel version mismatch: 0x40400 != 0x40300
libbpf: -- END LOG --
libbpf: failed to load program 'func_write=sys_write'
libbpf: failed to load object '/tmp/test_config_base.o'
event syntax error: '/tmp/test_config_base.o'
\___ Invalid argument: Are you root and runing a
CONFIG_BPF_SYSCALL kernel?
(add -v to see detail)
Run 'perf list' for a list of valid events
...
And I'd like to improve the error message output by perf.
Do you want me to send a patch for fixing this problem or modifying
existing patches
in my git tree?
Thank you.
[1]
http://lkml.kernel.org/r/1445843588-143137-1-git-send-email-wangnan0@huawei.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | pi3orama <pi3orama@163.com> |
|---|---|
| Date | 2015-10-24 03:30 +0200 |
| Message-ID | <qmVOG-21k-13@gated-at.bofh.it> |
| In reply to | #1254715 |
发自我的 iPhone
> 在 2015年10月24日,上午12:58,Arnaldo Carvalho de Melo <acme@kernel.org> 写道:
>
> Em Wed, Oct 14, 2015 at 12:41:16PM +0000, Wang Nan escreveu:
>> This patch utilizes bpf_object__load() provided by libbpf to load all
>> objects into kernel.
>
> So, testing this, using that other proggie, I get;
>
> # perf record --event /tmp/foo.o sleep 1
> libbpf: load bpf program failed: Invalid argument
> libbpf: -- BEGIN DUMP LOG ---
> libbpf:
>
> libbpf: -- END LOG --
This means your kernel version and version section in your BPF object doesn't
match each other. Please try to pass a correct version code when compiling the
object. I think we should output something through error log so by -v we can see
the problem. I told Alexei about this problem once. Let me improve perf's
error message next week.
Thank you.
> libbpf: failed to load program 'fork=_do_fork'
> libbpf: failed to load object '/tmp/foo.o'
> event syntax error: '/tmp/foo.o'
> \___ Invalid argument: Are you root and runing a CONFIG_BPF_SYSCALL kernel?
>
> (add -v to see detail)
> Run 'perf list' for a list of valid events
>
> Usage: perf record [<options>] [<command>]
> or: perf record [<options>] -- <command> [<options>]
>
> -e, --event <event> event selector. use 'perf list' to list available events
>
> But:
>
> [root@felicio ~]# grep -i bpf /proc/kallsyms | wc -l
> 117
> [root@felicio ~]# grep -i sys_bpf /proc/kallsyms
> ffffffff811829d0 T SyS_bpf
> ffffffff811829d0 T sys_bpf
> [root@felicio ~]# uname -a
> Linux felicio.ghostprotocols.net 4.2.0 #1 SMP Mon Aug 31 12:25:38 BRT
> 2015 x86_64 x86_64 x86_64 GNU/Linux
> [root@felicio ~]#
>
>
> I'll try updating it to torvalds/master...
>
> For reference, that foo.o eBPF proggie was built with:
>
> [acme@felicio linux]$ cat ~/bin/hello-ebpf
> # Taken from 'perf test LLVM'
> # Thu Oct 22 12:07:26 BRT 2015
>
> export KERNEL_INC_OPTIONS="-nostdinc -isystem
> /usr/lib/gcc/x86_64-redhat-linux/4.8.3/include
> -I/home/acme/git/linux/arch/x86/include
> -Iarch/x86/include/generated/uapi -Iarch/x86/include/generated
> -I/home/acme/git/linux/include -Iinclude
> -I/home/acme/git/linux/arch/x86/include/uapi
> -Iarch/x86/include/generated/uapi -I/home/acme/git/linux/include/uapi
> -Iinclude/generated/uapi -include
> /home/acme/git/linux/include/linux/kconfig.h"
> export WORKING_DIR=/lib/modules/4.2.0/build
> export CLANG_SOURCE=-
> export CLANG_OPTIONS=-xc
>
> OBJ=/tmp/foo.o
> rm -f $OBJ
> echo '__attribute__((section("fork=_do_fork"), used)) int fork(void
> *ctx) {return 0;} char _license[] __attribute__((section("license"),
> used)) = "GPL";int _version __attribute__((section("version"), used)) =
> 0x40100;' | clang -D__KERNEL__ $CLANG_OPTIONS $KERNEL_INC_OPTIONS
> -Wno-unused-value -Wno-pointer-sign -working-directory $WORKING_DIR -c
> "$CLANG_SOURCE" -target bpf -O2 -o /tmp/foo.o && file $OBJ
>
> - Arnaldo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web