Linux-kselftest Archive on
 help / color / Atom feed
From: Hao Luo <>
To: Yonghong Song <>
Cc: Networking <>, bpf <>,,,,
	Stanislav Fomichev <>,
	Shuah Khan <>,
	Alexei Starovoitov <>,
	Andrii Nakryiko <>,
	Daniel Borkmann <>,
	Martin KaFai Lau <>, Song Liu <>,
	John Fastabend <>,
	KP Singh <>, Bill Wendling <>
Subject: Re: [PATCH bpf-next] selftests/bpf: Switch test_vmlinux to use hrtimer_range_start_ns.
Date: Tue, 30 Jun 2020 15:48:43 -0700
Message-ID: <> (raw)
In-Reply-To: <>

On Tue, Jun 30, 2020 at 1:37 PM Yonghong Song <> wrote:
> On 6/30/20 11:49 AM, Hao Luo wrote:
> > The test_vmlinux test uses hrtimer_nanosleep as hook to test tracing
> > programs. But it seems Clang may have done an aggressive optimization,
> > causing fentry and kprobe to not hook on this function properly on a
> > Clang build kernel.
> Could you explain why it does not on clang built kernel? How did you
> build the kernel? Did you use [thin]lto?
> hrtimer_nanosleep is a global function who is called in several
> different files. I am curious how clang optimization can make
> function disappear, or make its function signature change, or
> rename the function?


We didn't enable LTO. It also puzzled me. But I can confirm those
fentry/kprobe test failures via many different experiments I've done.
After talking to my colleague on kernel compiling tools (Bill, cc'ed),
we suspected this could be because of clang's aggressive inlining. We
also noticed that all the callsites of hrtimer_nanosleep() are tail

For a better explanation, I can reach out to the people who are more
familiar to clang in the compiler team to see if they have any
insights. This may not be of high priority for them though.


  reply index

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-30 18:49 Hao Luo
2020-06-30 20:36 ` Yonghong Song
2020-06-30 22:48   ` Hao Luo [this message]
2020-07-01  0:06     ` Bill Wendling
2020-07-01  0:10     ` Hao Luo
2020-07-01  2:26       ` Yonghong Song
2020-07-01 17:02         ` Hao Luo
2020-06-30 21:26 ` Andrii Nakryiko

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:

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

  git send-email \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-kselftest Archive on

Archives are clonable:
	git clone --mirror linux-kselftest/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-kselftest linux-kselftest/ \
	public-inbox-index linux-kselftest

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone