summaryrefslogtreecommitdiff
path: root/trafgen_conf.h
blob: f92e14c2b4adfef9b24c712de74fc7698c24b93c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#ifndef TRAFGEN_CONF
#define TRAFGEN_CONF

#include <stdint.h>
#include <stdio.h>
#include <sys/types.h>

#define TYPE_INC	0
#define TYPE_DEC	1

enum csum {
	CSUM_IP,
	CSUM_UDP,
	CSUM_TCP,
};

struct counter {
	int type;
	uint8_t min, max, inc, val;
	off_t off;
};

struct randomizer {
	off_t off;
};

struct csum16 {
	off_t off, from, to;
	enum csum which;
};

struct packet {
	uint8_t *payload;
	size_t len;
};

struct packet_dyn {
	struct counter *cnt;
	size_t clen;
	struct randomizer *rnd;
	size_t rlen;
	struct csum16 *csum;
	size_t slen;
};

extern int compile_packets(char *file, int verbose, int cpu, bool invoke_cpp);
extern void cleanup_packets(void);

#endif /* TRAFGEN_CONF */
n, sys_epoll_wait, which we can find in /proc/kallsyms but not in vmlinux with CONFIG_DEBUG_INFO: [root@jouet ~]# grep -w sys_epoll_wait /proc/kallsyms ffffffffbd295b50 T sys_epoll_wait [root@jouet ~]# [root@jouet ~]# readelf -wi /lib/modules/4.7.0+/build/vmlinux | grep -w sys_epoll_wait [root@jouet ~]# If we try to use perf probe: [root@jouet ~]# perf probe sys_epoll_wait Failed to find debug information for address ffffffffbd295b50 Probe point 'sys_epoll_wait' not found. Error: Failed to add events. [root@jouet ~]# It all works if we use SyS_epoll_wait, that is just an alias to the probed function: [root@jouet ~]# grep -i sys_epoll_wait /proc/kallsyms ffffffffbd295b50 T SyS_epoll_wait ffffffffbd295b50 T sys_epoll_wait [root@jouet ~]# So use it: [root@jouet ~]# perf test BPF 37: Test BPF filter : 37.1: Test basic BPF filtering : Ok 37.2: Test BPF prologue generation : Ok 37.3: Test BPF relocation checker : Ok [root@jouet ~]# Further info: [root@jouet ~]# gcc --version gcc (GCC) 6.1.1 20160621 (Red Hat 6.1.1-3) [acme@jouet linux]$ cat /etc/fedora-release Fedora release 24 (Twenty Four) Investigation as to why it fails is still underway, but it was always going from sys_epoll_wait to SyS_epoll_wait when looking up the DWARF info in vmlinux, and this is what is breaking now. Switching to use SyS_epoll_wait allows this test to proceed and test the BPF code it was designed for, so lets have this in to allow passing this test while we fix the root cause. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Alexei Starovoitov <alexei.starovoitov@gmail.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/n/tip-7hekjp0bodwjbb419sl2b55h@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat