From: Alexei Starovoitov <ast@fb.com>
To: Josef Bacik <josef@toxicpanda.com>, <davem@davemloft.net>,
<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<ast@kernel.org>, <kernel-team@fb.com>
Cc: Josef Bacik <jbacik@fb.com>
Subject: Re: [PATCH 2/2] samples/bpf: add a test for bpf_override_return
Date: Mon, 30 Oct 2017 18:37:16 -0700 [thread overview]
Message-ID: <a6514f94-8b9d-02c2-da2a-d5c035a0048f@fb.com> (raw)
In-Reply-To: <1509398375-11927-3-git-send-email-josef@toxicpanda.com>
On 10/30/17 2:19 PM, Josef Bacik wrote:
> +
> +rm -f testfile.img
> +dd if=/dev/zero of=testfile.img bs=1M seek=1000 count=1
> +DEVICE=$(losetup --show -f testfile.img)
> +mkfs.btrfs -f $DEVICE
> +mkdir tmpmnt
> +./tracex7 $DEVICE
> +if [ $? -eq 0 ]
> +then
> + echo "SUCCESS!"
> +else
> + echo "FAILED!"
> +fi
> +losetup -d $DEVICE
nice test!
> diff --git a/samples/bpf/tracex7_kern.c b/samples/bpf/tracex7_kern.c
> new file mode 100644
> index 000000000000..a2f74f736e66
> --- /dev/null
> +++ b/samples/bpf/tracex7_kern.c
> @@ -0,0 +1,15 @@
> +#include <uapi/linux/ptrace.h>
> +#include <uapi/linux/bpf.h>
> +#include <linux/version.h>
> +#include "bpf_helpers.h"
> +
> +SEC("kprobe/open_ctree")
> +int bpf_prog1(struct pt_regs *ctx)
> +{
> + unsigned long rc = -12;
pls add empty line here.
> + bpf_override_return(ctx, rc);
> + return 0;
> +}
next prev parent reply other threads:[~2017-10-31 1:37 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-30 21:19 [PATCH 0/2] Add the ability to do BPF directed error injection Josef Bacik
2017-10-30 21:19 ` [PATCH 1/2] bpf: add a bpf_override_function helper Josef Bacik
2017-10-31 1:35 ` Alexei Starovoitov
2017-10-30 21:19 ` [PATCH 2/2] samples/bpf: add a test for bpf_override_return Josef Bacik
2017-10-31 1:37 ` Alexei Starovoitov [this message]
2017-10-31 15:45 [PATCH 0/2][v2] Add the ability to do BPF directed error injection Josef Bacik
2017-10-31 15:45 ` [PATCH 2/2] samples/bpf: add a test for bpf_override_return Josef Bacik
2017-11-01 17:00 [PATCH 0/2][v3] Add the ability to do BPF directed error injection Josef Bacik
2017-11-01 17:00 ` [PATCH 2/2] samples/bpf: add a test for bpf_override_return Josef Bacik
2017-11-01 17:23 ` Alexei Starovoitov
2017-11-02 14:37 [PATCH 0/2][v4] Add the ability to do BPF directed error injection Josef Bacik
2017-11-02 14:37 ` [PATCH 2/2] samples/bpf: add a test for bpf_override_return Josef Bacik
2017-11-07 20:28 [PATCH 0/2][v5] Add the ability to do BPF directed error injection Josef Bacik
2017-11-07 20:28 ` [PATCH 2/2] samples/bpf: add a test for bpf_override_return Josef Bacik
2017-11-08 2:29 ` Daniel Borkmann
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=a6514f94-8b9d-02c2-da2a-d5c035a0048f@fb.com \
--to=ast@fb.com \
--cc=ast@kernel.org \
--cc=davem@davemloft.net \
--cc=jbacik@fb.com \
--cc=josef@toxicpanda.com \
--cc=kernel-team@fb.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/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
all inboxes | Powered by JetHome®