[PATCH] tools lib bpf: fix maps resolution

2016-11-08 Thread Wang Nan
From: Eric Leblond It is not correct to assimilate the elf data of the maps section to an array of map definition. In fact the sizes differ. The offset provided in the symbol section has to be used instead. This patch fixes a bug causing a elf with two maps not to load correctly. Wang Nan

[RFC PATCH net-next 2/4] perf tools: Introduce bpf-output event

2015-10-28 Thread Wang Nan
sys_write perf 12927 [004] 355971.129279: 0 evt=bpf-output/no-inherit/: 811ed5f1 sys_write ... Signed-off-by: Wang Nan Cc: Alexei Starovoitov Cc: Arnaldo Carvalho de Melo Cc: Brendan Gregg Cc: David S. Miller --- tools/perf/util/evsel.c| 6

[RFC PATCH net-next 3/4] perf data: Add u32_hex data type

2015-10-28 Thread Wang Nan
Add hexdamical u32 to base data type, which is useful for raw output because raw data are u32 aligned. Signed-off-by: Wang Nan Cc: Alexei Starovoitov Cc: Arnaldo Carvalho de Melo Cc: Brendan Gregg Cc: Jiri Olsa --- tools/perf/util/data-convert-bt.c | 2 ++ 1 file changed, 2 insertions

[RFC PATCH net-next 0/4] perf tools: Support receiving output through BPF programs

2015-10-28 Thread Wang Nan
;) for event in tc.events: if not event.name.startswith('evt='): continue raw_data = event['raw_data'] print(raw_data[0] + raw_data[1] << 32, raw_data[2])); Wang Nan (4): perf tools: Enable pre-event inherit setting by config term

[RFC PATCH net-next 4/4] perf data: Support converting data from bpf_perf_event_output()

2015-10-28 Thread Wang Nan
startswith('evt='): continue raw_data = event['raw_data'] print(raw_data[0] + raw_data[1] << 32, raw_data[2])); Signed-off-by: Wang Nan Cc: Alexei Starovoitov Cc: Arnaldo Carvalho de Melo Cc: Brendan Gregg Cc: Jiri Olsa --- tools/perf/util/data-co

[RFC PATCH net-next 1/4] perf tools: Enable pre-event inherit setting by config terms

2015-10-28 Thread Wang Nan
# Samples: 23K of event 'cycles/inherit/' # Event count (approx.): 23285400229 ... # Samples: 11K of event 'instructions' # Event count (approx.): 14969050259 Signed-off-by: Wang Nan Cc: Arnaldo Carvalho de Melo Cc: Alexei Starovoitov Cc: Peter Zijlstra Cc: Li Zefan Cc: pi3or..

[PATCH v2] bpf: fix a bug in verification logic when SUB operation taken on FRAME_PTR

2015-06-18 Thread Wang Nan
ully. This is because the verifier allows only BPF_ADD instruction on a FRAME_PTR reigster to forge PTR_TO_STACK register, but makes BPF_SUB on FRAME_PTR reigster to get a UNKNOWN_VALUE register. This patch fix it by adding BPF_SUB in stack_relative checking. Signed-off-by: Wang Nan --- V1 is incor

[PATCH] bpf: fix a bug in verification logic when SUB operation taken on FRAME_PTR

2015-06-18 Thread Wang Nan
ully. This is because the verifier allows only BPF_ADD instruction on a FRAME_PTR reigster to forge PTR_TO_STACK register, but makes BPF_SUB on FRAME_PTR reigster to get a UNKNOWN_VALUE register. This patch fix it by adding BPF_SUB in stack_relative checking. Signed-off-by: Wang Nan --- kernel/bpf/