-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathmodparams
More file actions
25 lines (21 loc) · 901 Bytes
/
modparams
File metadata and controls
25 lines (21 loc) · 901 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/bash
# Description: Print all global symbols of relevant types in a kernel module
# Usage: ./modparams <module>
# Example: ./modparams zfs
# If you run the script without any arguments, it'll grab all modules.
# Copyright 2014 Kirill.Davydychev@nexenta.com, Paul.Nienaber@nexenta.com
mdb -k <<<"::nm -t objt -g -n -x -f ctype,name $1" | tail -n +1 \
| perl -pe 's/\|\n/\|/' \
| perl -ne '%a=("uint64_t"=>"/E",
"int64_t"=>"/e",
"int"=>"/D",
"offset_t"=>"/U",
"ssize_t"=>"/U",
"hrtime_t"=>"/U",
"uint_t"=>"/U",
"uint32_t"=>"/U",
"boolean_t"=>"/U",
"uint8_t"=>"/V");
chomp;s/ +\|/\|/;@b=split /\|/;
defined $a{$b[0]} && print "$b[1]$a{$b[0]}\n"' \
| mdb -k | tr -s ' ' | egrep -v ':$'