aboutsummaryrefslogtreecommitdiffstats
path: root/nvdebug_entry.c
diff options
context:
space:
mode:
authorJoshua Bakita <jbakita@cs.unc.edu>2024-04-11 13:42:54 -0400
committerJoshua Bakita <jbakita@cs.unc.edu>2024-04-11 13:42:54 -0400
commit7cfa24cebeaf144b446d07e15fb25e78bb14841e (patch)
tree639db3695c54a1e50b3f10e1abb2bfaf5b8dd906 /nvdebug_entry.c
parenta8fd5a8dee066d0008e7667b0c9e6a60cd5f3a2e (diff)
Linux 5.17+ support and allow including nvdebug.h independently
- Move Linux-specific functions to nvdebug_linux.h and .c - Workaround PDE_DATA() being pde_data() on Linux 5.17+
Diffstat (limited to 'nvdebug_entry.c')
-rw-r--r--nvdebug_entry.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/nvdebug_entry.c b/nvdebug_entry.c
index 68e4d71..0caa289 100644
--- a/nvdebug_entry.c
+++ b/nvdebug_entry.c
@@ -9,7 +9,7 @@
9#include <linux/pci.h> // For PCI device scanning 9#include <linux/pci.h> // For PCI device scanning
10#include <linux/proc_fs.h> // So we can set up entries in /proc 10#include <linux/proc_fs.h> // So we can set up entries in /proc
11 11
12#include "nvdebug.h" 12#include "nvdebug_linux.h"
13#include "stubs.h" 13#include "stubs.h"
14 14
15// Enable to intercept and log GPU interrupts. Historically used to benchmark 15// Enable to intercept and log GPU interrupts. Historically used to benchmark
@@ -93,7 +93,7 @@ int probe_and_cache_devices(void) {
93 // Search for GP10B (Jetson TX2) 93 // Search for GP10B (Jetson TX2)
94 while (!dev && (temp_dev = bus_find_device_by_name(&platform_bus_type, dev, "17000000.gp10b"))) 94 while (!dev && (temp_dev = bus_find_device_by_name(&platform_bus_type, dev, "17000000.gp10b")))
95 dev = temp_dev; 95 dev = temp_dev;
96 // Search for GM10A (Jetson TX1) 96 // Search for GM20B (Jetson TX1)
97 while (!dev && (temp_dev = bus_find_device_by_name(&platform_bus_type, dev, "57000000.gpu"))) 97 while (!dev && (temp_dev = bus_find_device_by_name(&platform_bus_type, dev, "57000000.gpu")))
98 dev = temp_dev; 98 dev = temp_dev;
99 // TODO: Support other platform bus devices (gk20a - TK1) 99 // TODO: Support other platform bus devices (gk20a - TK1)
@@ -173,7 +173,7 @@ int create_runlist_files(int device_id, struct proc_dir_entry *dir) {
173 max_rl_id = info.runlist_enum; 173 max_rl_id = info.runlist_enum;
174 } 174 }
175 // Create files to read each runlist. The read handling code looks at the 175 // Create files to read each runlist. The read handling code looks at the
176 // PDE_DATA associated with the file to determine what the runlist ID is. 176 // `pde_data` associated with the file to determine what the runlist ID is.
177 for (rl_id = 0; rl_id <= max_rl_id; rl_id++) { 177 for (rl_id = 0; rl_id <= max_rl_id; rl_id++) {
178 snprintf(runlist_name, 12, "runlist%d", rl_id); 178 snprintf(runlist_name, 12, "runlist%d", rl_id);
179 rl_entry = proc_create_data( 179 rl_entry = proc_create_data(