linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Stringer <joe@ovn.org>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	netdev <netdev@vger.kernel.org>, Wang Nan <wangnan0@huawei.com>,
	ast@fb.com, Daniel Borkmann <daniel@iogearbox.net>,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: Re: [PATCH perf/core REBASE 2/5] samples/bpf: Switch over to libbpf
Date: Thu, 15 Dec 2016 14:00:48 -0800	[thread overview]
Message-ID: <CAPWQB7GhHZOf4c5mu=__mNNyFFeq+jOZMawweMBg=sNiPpt-zg@mail.gmail.com> (raw)
In-Reply-To: <20161215183440.GH6866@kernel.org>

On 15 December 2016 at 10:34, Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> Em Thu, Dec 15, 2016 at 03:29:18PM -0300, Arnaldo Carvalho de Melo escreveu:
>> Em Thu, Dec 15, 2016 at 12:50:22PM -0300, Arnaldo Carvalho de Melo escreveu:
>> > Em Wed, Dec 14, 2016 at 02:43:39PM -0800, Joe Stringer escreveu:
>> > > Now that libbpf under tools/lib/bpf/* is synced with the version from
>> > > samples/bpf, we can get rid most of the libbpf library here.
>> > >
>> > > Signed-off-by: Joe Stringer <joe@ovn.org>
>> > > Cc: Alexei Starovoitov <ast@fb.com>
>> > > Cc: Daniel Borkmann <daniel@iogearbox.net>
>> > > Cc: Wang Nan <wangnan0@huawei.com>
>> > > Link: http://lkml.kernel.org/r/20161209024620.31660-6-joe@ovn.org
>> > > [ Use -I$(srctree)/tools/lib/ to support out of source code tree builds, as noticed by Wang Nan ]
>>
>> So, the above comment no longer applied to this adjusted patch from you,
>> as you removed one hunk too much, that, after applied, gets samples/bpf/
>> to build successfully:
>>
>> diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile
>> index add514e2984a..81b0ef2f7994 100644
>> --- a/samples/bpf/Makefile
>> +++ b/samples/bpf/Makefile
>> @@ -107,6 +107,7 @@ always += lwt_len_hist_kern.o
>>  always += xdp_tx_iptunnel_kern.o
>>
>>  HOSTCFLAGS += -I$(objtree)/usr/include
>> +HOSTCFLAGS += -I$(srctree)/tools/lib/
>>  HOSTCFLAGS += -I$(srctree)/tools/testing/selftests/bpf/
>>
>>  HOSTCFLAGS_bpf_load.o += -I$(objtree)/usr/include -Wno-unused-variable
>>
>> ---------------------
>>
>> I added it, continuing...
>
> But then, when I tried to run offwaketime with it, it fails:
>
> [root@jouet bpf]# ./offwaketime  ls
> bpf_load_program() err=22
> BPF_LDX uses reserved fields
> bpf_load_program() err=22
> BPF_LDX uses reserved fields
> [root@jouet bpf]#
>
> If I remove this patch and try again, it works:
>
> [root@jouet bpf]# ./offwaketime | head -4
> swapper/1;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule;__schedule;-;---;; 46
> chrome;return_from_SYSCALL_64;do_syscall_64;exit_to_usermode_loop;schedule;__schedule;-;try_to_wake_up;do_futex;sys_futex;do_syscall_64;return_from_SYSCALL_64;;Chrome_ChildIOT 1
> firefox;entry_SYSCALL_64_fastpath;sys_poll;do_sys_poll;poll_schedule_timeout;schedule_hrtimeout_range;schedule_hrtimeout_range_clock;schedule;__schedule;-;try_to_wake_up;pollwake;__wake_up_common;__wake_up_sync_key;pipe_write;__vfs_write;vfs_write;sys_write;entry_SYSCALL_64_fastpath;;Timer 3
> dockerd-current;entry_SYSCALL_64_fastpath;sys_select;core_sys_select;do_select;poll_schedule_timeout;schedule_hrtimeout_range;schedule_hrtimeout_range_clock;schedule;__schedule;-;try_to_wake_up;futex_wake;do_futex;sys_futex;entry_SYSCALL_64_fastpath;;dockerd-current 2
> [root@jouet bpf]#
>
>
> So, I'm stopping here so that I can push what I have to Ingo, then I'll get
> back to this, hopefully by then you beat me and I have just to retest 8-)

OK, thanks for the report. Looks like there was another difference
between the two libbpfs - one used total program size for its
load_program API; the actual kernel API uses instruction count. This
incremental should do the trick:

https://github.com/joestringer/linux/commit/6ff7726f20077bed66fb725f5189c13690154b6a

  parent reply	other threads:[~2016-12-15 22:01 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-14 22:43 [PATCH perf/core REBASE 0/5] Reuse libbpf from samples/bpf Joe Stringer
2016-12-14 22:43 ` [PATCH perf/core REBASE 1/5] samples/bpf: Make samples more libbpf-centric Joe Stringer
2016-12-20 19:28   ` [tip:perf/urgent] " tip-bot for Joe Stringer
2016-12-14 22:43 ` [PATCH perf/core REBASE 2/5] samples/bpf: Switch over to libbpf Joe Stringer
2016-12-15 15:50   ` Arnaldo Carvalho de Melo
2016-12-15 18:29     ` Arnaldo Carvalho de Melo
2016-12-15 18:34       ` Arnaldo Carvalho de Melo
2016-12-15 18:36         ` Arnaldo Carvalho de Melo
2016-12-15 22:00         ` Joe Stringer [this message]
2016-12-16  1:48           ` Joe Stringer
2016-12-16 14:21             ` Arnaldo Carvalho de Melo
2016-12-16 15:42             ` Arnaldo Carvalho de Melo
2016-12-20 13:41             ` Arnaldo Carvalho de Melo
2016-12-15 18:29     ` Joe Stringer
2016-12-15 19:04       ` Arnaldo Carvalho de Melo
2016-12-14 22:43 ` [PATCH perf/core REBASE 3/5] tools lib bpf: Add bpf_prog_{attach,detach} Joe Stringer
2016-12-20 14:18   ` Arnaldo Carvalho de Melo
2016-12-20 14:32     ` Arnaldo Carvalho de Melo
2016-12-20 18:50       ` Joe Stringer
2016-12-21 16:06         ` Arnaldo Carvalho de Melo
2016-12-14 22:43 ` [PATCH perf/core REBASE 4/5] samples/bpf: Remove perf_event_open() declaration Joe Stringer
2016-12-14 22:43 ` [PATCH perf/core REBASE 5/5] samples/bpf: Move open_raw_sock to separate header Joe Stringer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPWQB7GhHZOf4c5mu=__mNNyFFeq+jOZMawweMBg=sNiPpt-zg@mail.gmail.com' \
    --to=joe@ovn.org \
    --cc=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=ast@fb.com \
    --cc=daniel@iogearbox.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=wangnan0@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).