Skip to content

Commit

Permalink
bpf, x86/sparc: show actual number of passes in bpf_jit_dump
Browse files Browse the repository at this point in the history
When bpf_jit_compile() got split into two functions via commit
f3c2af7 ("net: filter: x86: split bpf_jit_compile()"), bpf_jit_dump()
was changed to always show 0 as number of compiler passes. Change it to
dump the actual number. Also on sparc, we count passes starting from 0,
so add 1 for the debug dump as well.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@plumgrid.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Daniel Borkmann authored and David S. Miller committed Jul 30, 2015
1 parent 7b36f92 commit 485d651
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion arch/sparc/net/bpf_jit_comp.c
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@ cond_branch: f_offset = addrs[i + filter[i].jf];
}

if (bpf_jit_enable > 1)
bpf_jit_dump(flen, proglen, pass, image);
bpf_jit_dump(flen, proglen, pass + 1, image);

if (image) {
bpf_flush_icache(image, image + proglen);
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/net/bpf_jit_comp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1103,7 +1103,7 @@ void bpf_int_jit_compile(struct bpf_prog *prog)
}

if (bpf_jit_enable > 1)
bpf_jit_dump(prog->len, proglen, 0, image);
bpf_jit_dump(prog->len, proglen, pass + 1, image);

if (image) {
bpf_flush_icache(header, image + proglen);
Expand Down

0 comments on commit 485d651

Please sign in to comment.