-
When I trace the nv driver OS-agnostic function "rmapiFreeWithSecInfo" by eBPF tools(command: sudo ./bpftrace -e 'kprobe:rmapiFreeWithSecInfo { print(kstack); }'), I got the messages as below:
Is anyone can help with this? How to build the driver with "probe" enabled so that I would debug the nvidia driver issue? |
Beta Was this translation helpful? Give feedback.
Answered by
mtijanic
Jul 15, 2024
Replies: 1 comment 6 replies
-
Hey there, I think something like this should make it easier to profile: diff --git a/src/nvidia/Makefile b/src/nvidia/Makefile
index 423414af..22f98fea 100644
--- a/src/nvidia/Makefile
+++ b/src/nvidia/Makefile
@@ -151,6 +151,12 @@ CFLAGS += -fdata-sections
NV_KERNEL_O_LDFLAGS += --gc-sections
EXPORTS_LINK_COMMAND = exports_link_command.txt
+CFLAGS += -pg
+CFLAGS += -mfentry
+CFLAGS += -mrecord-mcount
+CFLAGS += -fno-omit-frame-pointer
+CFLAGS += -fno-optimize-sibling-calls
+
ifeq ($(TARGET_ARCH),x86_64)
COMPILER_TYPE := $(call GET_COMPILER_TYPE, $(CC))
ENDBR_SUPPORTED := $(call AS_HAS_INSTR, endbr64)
diff --git a/src/nvidia/nv-kernel.ld b/src/nvidia/nv-kernel.ld
index 89ce3669..e525ec26 100644
--- a/src/nvidia/nv-kernel.ld
+++ b/src/nvidia/nv-kernel.ld
@@ -30,6 +30,8 @@ SECTIONS {
.bss : { *(.bss) *(.bss.*) }
+ __mcount_loc : { KEEP(*(__mcount_loc)) }
+
/* The rest of the sections ("orphaned sections") will just be copied from
the input to the output */
} Please let me know if it works or not. |
Beta Was this translation helpful? Give feedback.
6 replies
Answer selected by
PGKANG
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey there, I think something like this should make it easier to profile: