linux/arch
Tiezhu Yang 19bc6cb640 LoongArch: Add uprobes support
Uprobes is the user-space counterpart to kprobes, this patch adds
uprobes support for LoongArch.

Here is a simple example with CONFIG_UPROBE_EVENTS=y:

  # cat test.c
  #include <stdio.h>

  int add(int a, int b)
  {
  	  return a + b;
  }

  int main()
  {
	  return add(2, 7);
  }
  # gcc test.c -o /tmp/test
  # nm /tmp/test | grep add
  0000000120004194 T add
  # cd /sys/kernel/debug/tracing
  # echo > uprobe_events
  # echo "p:myuprobe /tmp/test:0x4194 %r4 %r5" > uprobe_events
  # echo "r:myuretprobe /tmp/test:0x4194 %r4" >> uprobe_events
  # echo 1 > events/uprobes/enable
  # echo 1 > tracing_on
  # /tmp/test
  # cat trace
  ...
  #           TASK-PID     CPU#  |||||  TIMESTAMP  FUNCTION
  #              | |         |   |||||     |         |
              test-1060    [001] DNZff  1015.770620: myuprobe: (0x120004194) arg1=0x2 arg2=0x7
              test-1060    [001] DNZff  1015.770930: myuretprobe: (0x1200041f0 <- 0x120004194) arg1=0x9

Tested-by: Jeff Xie <xiehuan09@gmail.com>
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
2023-06-29 20:58:44 +08:00
..
alpha Locking changes in v6.4: 2023-05-05 12:56:55 -07:00
arc Locking changes in v6.4: 2023-05-05 12:56:55 -07:00
arm ARM: 2023-06-22 17:54:10 -07:00
arm64 ARM: SoC fixes for 6.4, part 3 2023-06-23 16:21:59 -07:00
csky arch/csky patches for 6.4 2023-05-04 12:25:05 -07:00
hexagon Locking changes in v6.4: 2023-05-05 12:56:55 -07:00
ia64 Locking changes in v6.4: 2023-05-05 12:56:55 -07:00
loongarch LoongArch: Add uprobes support 2023-06-29 20:58:44 +08:00
m68k m68k: Move signal frame following exception on 68020/030 2023-05-22 13:51:20 +02:00
microblaze Kconfig: introduce HAS_IOPORT option and select it as necessary 2023-04-05 22:15:19 +02:00
mips mips: Move initrd_start check after initrd address sanitisation. 2023-05-23 11:01:38 +02:00
nios2 nios2: dts: Fix tse_mac "max-frame-size" property 2023-06-13 16:59:46 -05:00
openrisc Locking changes in v6.4: 2023-05-05 12:56:55 -07:00
parisc parisc: Delete redundant register definitions in <asm/assembly.h> 2023-06-17 06:48:11 +02:00
powerpc powerpc fixes for 6.4 #5 2023-06-22 17:49:40 -07:00
riscv 19 hotfixes. 14 are cc:stable and the remainder address issues which were 2023-06-12 16:14:34 -07:00
s390 s390 updates for 6.4-rc6 2023-06-09 09:29:51 -07:00
sh Locking changes in v6.4: 2023-05-05 12:56:55 -07:00
sparc Locking changes in v6.4: 2023-05-05 12:56:55 -07:00
um um: harddog: fix modular build 2023-05-10 00:21:30 +02:00
x86 - Drop the __weak attribute from a function prototype as it otherwise 2023-06-25 10:13:17 -07:00
xtensa Xtensa fixes for v6.4: 2023-05-23 15:21:34 -07:00
.gitignore
Kconfig