Skip to content

Instantly share code, notes, and snippets.

@wkz
Created June 30, 2022 22:54
Show Gist options
  • Save wkz/ef248a56ce499e4fb2c0f9b2017b0024 to your computer and use it in GitHub Desktop.
Save wkz/ef248a56ce499e4fb2c0f9b2017b0024 to your computer and use it in GitHub Desktop.
fzf + pahole = <3
#!/bin/sh
describe()
{
{
pfunct -f "$1"
echo
pfunct -f "$1" --no_parm_names | awk '
{
gsub("[a-zA-Z0-9_]+\\(","");
gsub("[*,;)]|static|const|signed|unsigned|char|short|int|long|void|struct|union|enum","");
gsub("[ \t]+","\n");
print;
}' | sort -u | xargs -n 1 pahole -qC
} | highlight -Sc -Oxterm256
}
if [ "$1" = "-f" ]; then
describe $2
exit 0
fi
awk '/ [tT] [a-zA-Z0-9_]+$/ { print($3); }' /proc/kallsyms | fzf --preview="$0 -f {}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment