lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <55EADE52.5010701@163.com>
Date:	Sat, 05 Sep 2015 20:21:38 +0800
From:	Wang Nan <pi3orama@....com>
To:	Namhyung Kim <namhyung@...nel.org>, Wang Nan <wangnan0@...wei.com>
CC:	acme@...hat.com, mingo@...nel.org, ast@...mgrid.com,
	linux-kernel@...r.kernel.org, lizefan@...wei.com,
	Brendan Gregg <brendan.d.gregg@...il.com>,
	Daniel Borkmann <daniel@...earbox.net>,
	David Ahern <dsahern@...il.com>, He Kuang <hekuang@...wei.com>,
	Jiri Olsa <jolsa@...nel.org>, Kaixu Xia <xiakaixu@...wei.com>,
	Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>
Subject: Re: [PATCH 18/31] perf test: Add 'perf test BPF'



On 09/02/2015 08:45 PM, Namhyung Kim wrote:
> On Sat, Aug 29, 2015 at 04:21:52AM +0000, Wang Nan wrote:
>> This patch adds BPF testcase for testing BPF event filtering.
>>
>> By utilizing the result of 'perf test LLVM', this patch compiles the
>> eBPF sample program then test it ability. The BPF script in 'perf test
>> LLVM' collects half of execution of epoll_pwait(). This patch runs 111
>> times of it, so the resule should contains 56 samples.
>>
>> Signed-off-by: Wang Nan <wangnan0@...wei.com>
>> Cc: Arnaldo Carvalho de Melo <acme@...hat.com>
>> Cc: Alexei Starovoitov <ast@...mgrid.com>
>> Cc: Brendan Gregg <brendan.d.gregg@...il.com>
>> Cc: Daniel Borkmann <daniel@...earbox.net>
>> Cc: David Ahern <dsahern@...il.com>
>> Cc: He Kuang <hekuang@...wei.com>
>> Cc: Jiri Olsa <jolsa@...nel.org>
>> Cc: Kaixu Xia <xiakaixu@...wei.com>
>> Cc: Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
>> Cc: Namhyung Kim <namhyung@...nel.org>
>> Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
>> Cc: Zefan Li <lizefan@...wei.com>
>> Cc: pi3orama@....com
>> Link: http://lkml.kernel.org/n/1440151770-129878-16-git-send-email-wangnan0@huawei.com
>> ---
>
> [SNIP]
>
>> +static int prepare_bpf(void *obj_buf, size_t obj_buf_sz)
>> +{
>> +	int err;
>> +	char errbuf[BUFSIZ];
>> +
>> +	err = bpf__prepare_load_buffer(obj_buf, obj_buf_sz, NULL);
>> +	if (err) {
>> +		bpf__strerror_prepare_load("[buffer]", false, err, errbuf,
>> +					   sizeof(errbuf));
>> +		fprintf(stderr, " (%s)", errbuf);
>> +		return TEST_FAIL;
>> +	}
>> +
>> +	err = bpf__probe();
>> +	if (err) {
>> +		bpf__strerror_load(err, errbuf, sizeof(errbuf));
>> +		fprintf(stderr, " (%s)", errbuf);
>> +		if (getuid() != 0)
>
> geteuid() ?
>
> Thanks,
> Namhyung
>

Already changed.

Thank you.

>
>> +			fprintf(stderr, " (try run as root)");
>> +		return TEST_FAIL;
>> +	}
>> +
>> +	err = bpf__load();
>> +	if (err) {
>> +		bpf__strerror_load(err, errbuf, sizeof(errbuf));
>> +		fprintf(stderr, " (%s)", errbuf);
>> +		return TEST_FAIL;
>> +	}
>> +
>> +	return 0;
>> +}

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ