[PATCH v3] perf probe: fix kretprobe issue caused by GCC bug

2021-02-16 Thread Jianlin Lv
The kernel compiled with clang does not have this issue. FIX: This GCC issue only cause the registration failure of the kretprobe event which doesn't need debuginfo. So, stop using debuginfo for retprobe. map will be used to query the probe function address. Signed-off-by: Jianlin Lv

RE: [PATCH v2] perf probe: fix kretprobe issue caused by GCC bug

2021-02-12 Thread Jianlin Lv
> -Original Message- > From: Arnaldo Carvalho de Melo > Sent: Saturday, February 13, 2021 5:34 AM > To: Jianlin Lv > Cc: pet...@infradead.org; mi...@redhat.com; Mark Rutland > ; alexander.shish...@linux.intel.com; > jo...@redhat.com; namhy...@kernel.org; nat...@ke

[PATCH v3] perf tools: Fix arm64 build error with gcc-11

2021-02-12 Thread Jianlin Lv
Wformat-overflow warnings. Add ternary operator, The statement evaluates to "Unknown" if reg_name==NULL is met. Signed-off-by: Jianlin Lv --- v2: Add ternary operator to avoid similar errors in other arch. v3: Declared reg_name in inner block. --- tools/perf/builti

RE: [PATCH] perf tools: Fix arm64 build error with gcc-11

2021-02-09 Thread Jianlin Lv
> -Original Message- > From: Leo Yan > Sent: Tuesday, February 9, 2021 8:17 PM > To: Jianlin Lv > Cc: john.ga...@huawei.com; w...@kernel.org; mathieu.poir...@linaro.org; > pet...@infradead.org; mi...@redhat.com; a...@kernel.org; Mark Rutland > ; alexander.shish...@

[PATCH v2] perf tools: Fix arm64 build error with gcc-11

2021-02-09 Thread Jianlin Lv
Wformat-overflow warnings. Add ternary operator, The statement evaluates to "Unknown" if reg_name==NULL is met. Signed-off-by: Jianlin Lv --- v2: Add ternary operator to avoid similar errors in other arch. --- tools/perf/builtin-script.c| 4 +++- tools/perf/util

[PATCH v2] perf probe: fix kretprobe issue caused by GCC bug

2021-02-09 Thread Jianlin Lv
y option. The kernel compiled with clang does not have this issue. FIX: This GCC issue only cause the registration failure of the kretprobe event which doesn't need debuginfo. So, stop using debuginfo for retprobe. map will be used to query the probe function address. Signed-off-by: Jianlin Lv

RE: [PATCH v2] perf tools: Fix arm64 build error with gcc-11

2021-02-10 Thread Jianlin Lv
> -Original Message- > From: John Garry > Sent: Wednesday, February 10, 2021 5:38 PM > To: Jianlin Lv ; w...@kernel.org; > mathieu.poir...@linaro.org; leo@linaro.org; pet...@infradead.org; > mi...@redhat.com; a...@kernel.org; Mark Rutland > ; alexander.shish...@

[PATCH v4] perf tools: Fix arm64 build error with gcc-11

2021-02-17 Thread Jianlin Lv
Wformat-overflow warnings. Add helper function to convert NULL to "unknown". Signed-off-by: Jianlin Lv --- v2: Add ternary operator to avoid similar errors in other arch. v3: Declared reg_name in inner block. v4: Add helper function: perf_reg_name_str, update changelog. --- tools/perf/builti

[PATCH v5] perf tools: Fix arm64 build error with gcc-11

2021-02-17 Thread Jianlin Lv
Wformat-overflow warnings. Add helper function to convert NULL to "unknown". Signed-off-by: Jianlin Lv --- v2: Add ternary operator to avoid similar errors in other arch. v3: Declared reg_name in inner block. v4: Add helper function: perf_reg_name_str, update changelog. v5: Correct functio

[PATCH] perf probe: Added protection to avoid endless loop

2021-02-02 Thread Jianlin Lv
if dwarf_offdie() return NULL, the continue statement forces the next iteration of the loop without update variable off. It will cause an endless loop in the process of traversing the compilation unit. So added exception protection for loop CUs. Signed-off-by: Jianlin Lv --- tools/perf/util

[PATCH v2] perf probe: Added protection to avoid endless loop

2021-02-03 Thread Jianlin Lv
if dwarf_offdie() return NULL, the continue statement forces the next iteration of the loop without update variable off. It will cause an endless loop in the process of traversing the compilation unit. So added exception protection for loop CUs. Signed-off-by: Jianlin Lv --- v2: removed the

RE: [PATCH] tracing/kprobe: Fix to support kretprobe events on unloaded modules

2021-01-30 Thread Jianlin Lv
> -Original Message- > From: Masami Hiramatsu > Sent: Friday, January 29, 2021 9:45 PM > To: Jianlin Lv > Cc: Steven Rostedt ; Oleg Nesterov > ; Ingo Molnar ; linux- > ker...@vger.kernel.org > Subject: Re: [PATCH] tracing/kprobe: Fix to support kretprobe even

[PATCH] perf probe: fix kretprobe issue caused by GCC bug

2021-02-05 Thread Jianlin Lv
otential defect is that if -gno-record-gcc-switches option is enabled, the command-line options will not be recorded in debuginfo. This workaround solution will fail. Assume that this situation may not happen for kernel compilation. Signed-off-by: Jianlin Lv --- tools/perf/util/probe-event.c |

RE: [PATCH] perf probe: fix kretprobe issue caused by GCC bug

2021-02-08 Thread Jianlin Lv
> -Original Message- > From: Masami Hiramatsu > Sent: Monday, February 8, 2021 8:33 PM > To: Jianlin Lv > Cc: pet...@infradead.org; mi...@redhat.com; a...@kernel.org; Mark > Rutland ; alexander.shish...@linux.intel.com; > jo...@redhat.com; namhy...@kernel.org; nat

[PATCH] perf tools: Fix arm64 build error with gcc-11

2021-02-09 Thread Jianlin Lv
Wformat-overflow warnings by replacing the return value NULL of perf_reg_name with "unknown". Signed-off-by: Jianlin Lv --- tools/perf/arch/arm64/include/perf_regs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/perf/arch/arm64/include/perf_regs.h b/tools

[PATCH bpf-next] bpf: fix compilation warning of selftests

2020-07-30 Thread Jianlin Lv
e. Signed-off-by: Jianlin Lv --- .../selftests/bpf/prog_tests/send_signal.c| 37 ++- .../bpf/prog_tests/stacktrace_build_id_nmi.c | 3 +- .../selftests/bpf/test_tcpnotify_user.c | 15 ++-- 3 files changed, 41 insertions(+), 14 deletions(-) diff --git a/tools/testing

[PATCH bpf-next] bpf: fix load XDP program error in test_xdp_vlan

2020-08-12 Thread Jianlin Lv
XDP program already attached. ip will throw an error in case a XDP program is already attached to the networking interface, to prevent it from being overridden by accident. In order to replace the currently running XDP program with a new one, the -force option must be used. Signed-off-by: Jianlin Lv

[PATCH bpf-next v2] bpf: fix compilation warning of selftests

2020-08-06 Thread Jianlin Lv
e. Signed-off-by: Jianlin Lv --- v2: - replease CHECK_FAIL by CHECK - fix test_tcpnotify_user failed issue --- .../selftests/bpf/prog_tests/send_signal.c | 18 -- .../bpf/prog_tests/stacktrace_build_id_nmi.c | 4 +++- .../selftests/bpf/test_tcpnotify_user.c| 13 ++

[PATCH bpf-next] bpf: fix segmentation fault of test_progs

2020-08-07 Thread Jianlin Lv
unmap the second page fails, the length parameter to delete tmp1 mappings should be 3*page_size. Signed-off-by: Jianlin Lv --- tools/testing/selftests/bpf/prog_tests/mmap.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/bpf/prog_tests/mmap.c b

[PATCH bpf-next v2] bpf: fix segmentation fault of test_progs

2020-08-10 Thread Jianlin Lv
4 pages of anonymous mapping,then do all the mmap() with MAP_FIXED. Another issue is that when unmap the second page fails, the length parameter to delete tmp1 mappings should be 4*page_size. Signed-off-by: Jianlin Lv --- v2: - Update commit messages - Create 4 pages of anonymous mapping that

[PATCH] arm64: rename S_FRAME_SIZE to PT_REGS_SIZE

2021-01-11 Thread Jianlin Lv
S_FRAME_SIZE is the size of the pt_regs structure, no longer the size of the kernel stack frame, the name is misleading. In keeping with arm32, rename S_FRAME_SIZE to PT_REGS_SIZE. Signed-off-by: Jianlin Lv --- arch/arm64/kernel/asm-offsets.c | 2 +- arch/arm64/kernel/entry

[PATCH] tracing: precise log info for kretprobe addr err

2021-01-19 Thread Jianlin Lv
ch is as follows: $ echo 'r:myprobe ERROR_SYMBOL_XXX ret=%x0' >> kprobe_events bash: echo: write error: Invalid argument $ cat error_log [415.89]trace_kprobe: error: Retprobe address must be an function entry Command: r:myprobe ERROR_SYMBOL_XXX ret=%x0

Re: [PATCH bpf-next v2] bpf: Simplify expression for identify bpf mem type

2021-03-18 Thread Jianlin Lv
On Thu, Mar 18, 2021 at 11:58 PM Daniel Borkmann wrote: > > On 3/18/21 7:36 AM, Jianlin Lv wrote: > > Added BPF_LD_ST_SIZE_MASK macro as mask of size modifier that help to > > reduce the evaluation of expressions in if statements, > > and remove BPF_SIZE_MASK in netronom

Re: [PATCH bpf-next] bpf: arm64: Redefine MOV consistent with arch insn

2021-03-31 Thread Jianlin Lv
On Tue, Mar 30, 2021 at 5:31 PM Will Deacon wrote: > > On Tue, Mar 30, 2021 at 03:42:35PM +0800, Jianlin Lv wrote: > > A64_MOV is currently mapped to Add Instruction. Architecturally MOV > > (register) is an alias of ORR (shifted register) and MOV (to or from SP) > > is an

Re: [PATCH bpf-next] bpf: arm64: Redefine MOV consistent with arch insn

2021-03-31 Thread Jianlin Lv
On Wed, Mar 31, 2021 at 5:28 PM Will Deacon wrote: > > On Wed, Mar 31, 2021 at 05:22:18PM +0800, Jianlin Lv wrote: > > On Tue, Mar 30, 2021 at 5:31 PM Will Deacon wrote: > > > > > > On Tue, Mar 30, 2021 at 03:42:35PM +0800, Jianlin Lv wrote: > > > > A64_

[PATCH bpf-next] bpf: arm64: Redefine MOV consistent with arch insn

2021-03-30 Thread Jianlin Lv
... 14: mov x25, sp f9 03 00 91 ... 24: mov x19, x0 f3 03 00 aa ... 8c: mov x0, x7 e0 03 07 aa Signed-off-by: Jianlin Lv --- arch/arm64/net/bpf_jit.h | 7 +-- arch/arm64/net/bpf_jit_comp.c | 4 ++-- 2 files changed, 7 insert

[PATCH bpf-next] bpf: trace jit code when enable BPF_JIT_ALWAYS_ON

2021-03-26 Thread Jianlin Lv
When CONFIG_BPF_JIT_ALWAYS_ON is enabled, the value of bpf_jit_enable in /proc/sys is limited to SYSCTL_ONE. This is not convenient for debugging. This patch modifies the value of extra2 (max) to 2 that support developers to emit traces on kernel log. Signed-off-by: Jianlin Lv --- net/core

RE: [PATCH bpf-next] bpf: trace jit code when enable BPF_JIT_ALWAYS_ON

2021-03-27 Thread Jianlin Lv
> -Original Message- > From: Alexei Starovoitov > Sent: Friday, March 26, 2021 10:25 PM > To: Jianlin Lv > Cc: bpf ; David S. Miller ; > Jakub Kicinski ; Alexei Starovoitov ; > Daniel Borkmann ; Andrii Nakryiko > ; Martin KaFai Lau ; Song Liu > ; Yonghong S

Re: [PATCH bpf-next] bpf: trace jit code when enable BPF_JIT_ALWAYS_ON

2021-03-27 Thread Jianlin Lv
On Sat, Mar 27, 2021 at 11:19 PM Alexei Starovoitov wrote: > > On Sat, Mar 27, 2021 at 1:19 AM Jianlin Lv wrote: > > > > > On Fri, Mar 26, 2021 at 5:40 AM Jianlin Lv wrote: > > > > > > > > When CONFIG_BPF_JIT_ALWAYS_ON is enabled, the value of

[PATCH bpf-next 1/2] bpf: Remove bpf_jit_enable=2 debugging mode

2021-04-15 Thread Jianlin Lv
to explain how to use bpf_jit_disasm tool after this change. Signed-off-by: Jianlin Lv --- arch/arm/net/bpf_jit_32.c | 4 arch/arm64/net/bpf_jit_comp.c | 4 arch/mips/net/bpf_jit.c | 4 arch/mips/net/ebpf_jit.c | 4 arch/powerpc/net/bpf_

[PATCH bpf-next 2/2] docs: bpf: bpf_jit_enable mode changed

2021-04-15 Thread Jianlin Lv
Remove information about bpf_jit_enable=2 mode and added description for how to use the bpf_jit_disasm tool after get rid of =2 mode. Signed-off-by: Jianlin Lv --- Documentation/admin-guide/sysctl/net.rst | 1 - Documentation/networking/filter.rst | 25 ++-- 2 files

Re: [PATCH bpf-next 1/2] bpf: Remove bpf_jit_enable=2 debugging mode

2021-04-16 Thread Jianlin Lv
On Thu, Apr 15, 2021 at 10:38 PM Daniel Borkmann wrote: > > On 4/15/21 11:32 AM, Jianlin Lv wrote: > > For debugging JITs, dumping the JITed image to kernel log is discouraged, > > "bpftool prog dump jited" is much better way to examine JITed dumps. > > This pa

[PATCH bpf-next] bpf: Simplify expression for identify bpf mem type

2021-03-17 Thread Jianlin Lv
Added BPF_SIZE_MASK macro as mask of size modifier that help to reduce the evaluation of expressions in if statements, and remove BPF_SIZE_MASK in netronome driver. Signed-off-by: Jianlin Lv --- drivers/net/ethernet/netronome/nfp/bpf/main.h | 2 -- include/uapi/linux/bpf.h

[PATCH bpf-next] bpf: Remove insn_buf[] declaration in inner block

2021-03-17 Thread Jianlin Lv
Two insn_buf[16] variables are declared in the function, which act on function scope and block scope respectively. The statement in the inner blocks is redundant, so remove it. Signed-off-by: Jianlin Lv --- kernel/bpf/verifier.c | 1 - 1 file changed, 1 deletion(-) diff --git a/kernel/bpf

[PATCH bpf-next v2] bpf: Simplify expression for identify bpf mem type

2021-03-17 Thread Jianlin Lv
Added BPF_LD_ST_SIZE_MASK macro as mask of size modifier that help to reduce the evaluation of expressions in if statements, and remove BPF_SIZE_MASK in netronome driver. Signed-off-by: Jianlin Lv --- v2: Move the bpf_LD_ST_SIZE_MASK macro definition to include/linux/bpf.h --- drivers/net

[PATCH net-next] bonding: Added -ENODEV interpret for slaves option

2021-03-13 Thread Jianlin Lv
After upgrading the kernel, the slave interface name is changed, Systemd cannot use the original configuration to create bond interface, thereby losing the connection with the host. Adding log for ENODEV will make it easier to find out such problem lies. Signed-off-by: Jianlin Lv --- drivers

[PATCH net-next v2] bonding: Added -ENODEV interpret for slaves option

2021-03-14 Thread Jianlin Lv
When the incorrect interface name is stored in the slaves/active_slave option of the bonding sysfs, the kernel does not record the log that interface does not exist. This patch adds a log for -ENODEV error, which will facilitate users to figure out such issue. Signed-off-by: Jianlin Lv --- v2

[PATCH v2] tracing: precise log info for kretprobe addr err

2021-01-20 Thread Jianlin Lv
ch is as follows: $ echo 'r:myprobe ERROR_SYMBOL_XXX ret=%x0' >> kprobe_events bash: echo: write error: Invalid argument $ cat error_log [415.89]trace_kprobe: error: Retprobe address must be an function entry Command: r:myprobe ERROR_SYMBOL_XXX ret=%x0

[PATCH v3] tracing: precise log info for kretprobe addr err

2021-01-25 Thread Jianlin Lv
ch is as follows: $ echo 'r:myprobe ERROR_SYMBOL_XXX ret=%x0' >> kprobe_events bash: echo: write error: Invalid argument $ cat error_log [415.89]trace_kprobe: error: Retprobe address must be an function entry Command: r:myprobe ERROR_SYMBOL_XXX ret=%x0

RE: [PATCH v3] tracing: precise log info for kretprobe addr err

2021-01-26 Thread Jianlin Lv
> -Original Message- > From: Masami Hiramatsu > Sent: Tuesday, January 26, 2021 12:16 PM > To: Steven Rostedt > Cc: Oleg Nesterov ; Jianlin Lv ; > mi...@redhat.com; mhira...@kernel.org; linux-kernel@vger.kernel.org > Subject: Re: [PATCH v3] tracing: precise log in

RE: [PATCH v3] tracing: precise log info for kretprobe addr err

2021-01-26 Thread Jianlin Lv
> -Original Message- > From: Masami Hiramatsu > Sent: Wednesday, January 27, 2021 10:02 AM > To: Oleg Nesterov > Cc: Steven Rostedt ; Jianlin Lv ; > mi...@redhat.com; linux-kernel@vger.kernel.org > Subject: Re: [PATCH v3] tracing: precise log info for kretprobe ad

RE: [PATCH v2] tracing: precise log info for kretprobe addr err

2021-01-23 Thread Jianlin Lv
> -Original Message- > From: Masami Hiramatsu > Sent: Thursday, January 21, 2021 10:29 AM > To: Steven Rostedt > Cc: Jianlin Lv ; mi...@redhat.com; linux- > ker...@vger.kernel.org; Masami Hiramatsu ; > o...@redhat.com > Subject: Re: [PATCH v2] tracing: precis

RE: [PATCH v2] tracing: precise log info for kretprobe addr err

2021-01-24 Thread Jianlin Lv
Message- > From: Masami Hiramatsu > Sent: Sunday, January 24, 2021 4:53 PM > To: Jianlin Lv > Cc: Steven Rostedt ; mi...@redhat.com; linux- > ker...@vger.kernel.org; o...@redhat.com > Subject: Re: [PATCH v2] tracing: precise log info for kretprobe addr err > > Hi Jianli

RE: [PATCH v3] tracing: precise log info for kretprobe addr err

2021-01-27 Thread Jianlin Lv
> -Original Message- > From: Masami Hiramatsu > Sent: Wednesday, January 27, 2021 9:28 PM > To: Jianlin Lv > Cc: Oleg Nesterov ; Steven Rostedt > ; mi...@redhat.com; linux-kernel@vger.kernel.org > Subject: Re: [PATCH v3] tracing: precise log info for kretprobe ad

[PATCH v4] tracing: precise log info for kretprobe addr err

2021-01-27 Thread Jianlin Lv
^ v2 changes: - Added !strchr(symbol, ':') to check whether symbol is really bad or from a module. Signed-off-by: Jianlin Lv --- v2: added !strchr(symbol, ':') to check really bad symbol or from module. v4: added changelog and code comments. --- kernel/trace/trace_kprobe.c

[PATCH bpf-next] docs: correct subject prefix and update LLVM info

2020-08-20 Thread Jianlin Lv
bpf_devel_QA.rst:152 The subject prefix information is not accurate, it should be 'PATCH bpf-next v2' Also update LLVM version info and add information about ‘-DLLVM_TARGETS_TO_BUILD’ to prompt the developer to build the desired target. Signed-off-by: Jianlin Lv --- Documen

[PATCH net-next] net: remove redundant variable in vxlan_xmit_one

2020-08-20 Thread Jianlin Lv
: Jianlin Lv --- drivers/net/vxlan.c | 40 +++- 1 file changed, 15 insertions(+), 25 deletions(-) diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index b9fefe27e3e8..679260e1d9f1 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c @@ -2597,7 +2597,6

[PATCH net-next] net: Remove unnecessary intermediate variables

2020-08-21 Thread Jianlin Lv
It is not necessary to use src/dst as an intermediate variable for assignment operation; Delete src/dst intermediate variables to avoid unnecessary variable declarations. Signed-off-by: Jianlin Lv --- drivers/net/vxlan.c | 16 1 file changed, 4 insertions(+), 12 deletions

[PATCH bpf-next] bpf: Generate cookie for new non-initial net NS

2020-07-20 Thread Jianlin Lv
initial and non-initial network namespace. Signed-off-by: Jianlin Lv --- net/core/net_namespace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c index dcd61aca343e..5937bd0df56d 100644 --- a/net/core/net_namespace.c +++ b

RE: [PATCH bpf-next] bpf: Generate cookie for new non-initial net NS

2020-07-21 Thread Jianlin Lv
> -Original Message- > From: bpf-ow...@vger.kernel.org On Behalf > Of Daniel Borkmann > Sent: Wednesday, July 22, 2020 4:18 AM > To: Jianlin Lv ; b...@vger.kernel.org > Cc: da...@davemloft.net; k...@kernel.org; a...@kernel.org; y...@fb.com; > Song Zhu ; linux-k