Skip to content

Instantly share code, notes, and snippets.

@Ending2015a
Last active April 20, 2020 03:13
Show Gist options
  • Save Ending2015a/30ee5a4620bd9e99469b50d35609eb03 to your computer and use it in GitHub Desktop.
Save Ending2015a/30ee5a4620bd9e99469b50d35609eb03 to your computer and use it in GitHub Desktop.
#!/bin/bash
# https://ppt.cc/fgUIKx
sudo apt-get install -y git
if [ ! -f "dmesg-initcall.pl" ] ; then
wget https://raw.githubusercontent.com/tinyclub/tinydraw/master/histogram/examples/linux-boot-graph/dmesg-initcall.pl -O dmesg-initcall.pl
fi
if [ ! -f "bootgraph.pl" ] ; then
wget https://raw.githubusercontent.com/torvalds/linux/master/scripts/bootgraph.pl -O bootgraph.pl
fi
if [ ! -d "./tinydraw" ] ; then
git clone https://github.com/tinyclub/tinydraw.git ./tinydraw
fi
mkdir -p system-log
echo "Gemerating system info"
dmesg > system-log/dmesg.log
cat system-log/dmesg.log | perl dmesg-initcall.pl > system-log/initcall.log
cat system-log/dmesg.log | perl bootgraph.pl > system-log/bootgraph.svg
./tinydraw/histogram/histogram.sh system-log/initcall.log > system-log/linux-boot-histogram.svg
systemd-analyze plot > system-log/systemd-plot.svg
systemd-analyze blame > system-log/systemd-log.txt
echo "DONE!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment