fixed spinlocks
This commit is contained in:
@@ -12,7 +12,7 @@ Make sure you're running a modern kernel version (4.x+, tested on 7.0.9) on an x
|
||||
1. Comment out `#define USE_ATOMICS` if you'd rather use spinlocks
|
||||
1. Run `sudo make install` to compile and load the module
|
||||
1. Run `sudo make test` to view the module's debugfs output via the included Scripts
|
||||
or view raw output at `/sys/kernel/debug/syscall_counter`
|
||||
or view raw output at `/sys/kernel/debug/syscall_counter`
|
||||
1. Run `echo 0 | sudo tee /sys/module/syscall_counter/parameters/enabled` to pause counting (`echo 1` to resume)
|
||||
|
||||
## Scripts
|
||||
|
||||
+4
-2
@@ -153,9 +153,11 @@ static int syscall_counter_show(struct seq_file *m, void *v)
|
||||
#endif
|
||||
|
||||
#ifndef USE_ATOMICS
|
||||
spin_lock_irqsav(&syscalls_lock);
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&syscalls_lock, flags);
|
||||
unsigned long value = syscalls[id];
|
||||
spin_unlock_irqrestore(&syscalls_lock);
|
||||
spin_unlock_irqrestore(&syscalls_lock, flags);
|
||||
#else
|
||||
unsigned long value = atomic64_read(&syscalls[id]);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user