Our great sponsors
-
sdc-headnode
Responsible for building and setting up the Triton (formerly SmartDataCenter) headnode.
-
unix-shell-script-kit
Unix shell script kit with many utility functions, constant exit codes, and POSIX helpers.
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
It's actually possible to produce a stack trace of sorts, if you use a lot of bash functions. One possible implementation is: https://github.com/TritonDataCenter/sdc-headnode/blob/master...
to produce a stack trace and exit the shell in case of non-zero exit status from some-command.
[1]: https://github.com/runag/runag/blob/main/lib/fail.sh
We use a couple nice home-grown functions in ZFSBootMenu to help debug things. We have a zdebug logging function that's peppered liberally throughout the code base - https://github.com/zbm-dev/zfsbootmenu/blob/master/zfsbootme...
Hitting ctrl-t on our main menu will, when booting with debug logging enabled, show a screen like this: https://imgur.com/Ge75zkP
We also have a flamegraph profiling mechanism that can be enabled with https://github.com/zbm-dev/zfsbootmenu/blob/master/zfsbootme... . That will dump data to a serial port, which when re-assembled, can be used to produce a graph like https://raw.githubusercontent.com/zbm-dev/zfsbootmenu/master...
Bash is suprisingly flexible.
Plug and slightly related. I once created a bash pipeline debugger that preserves the intermediate outputs. Has a few limitations but maybe generally useful: https://github.com/ketancmaheshwari/pd
When I was at Facebook, I wrote a Python script to extract shell scripts from GitHub Actions workflows, so we could run them all through ShellCheck: https://github.com/pytorch/pytorch/blob/69e0bda9996865e319db...
You can use the bash 'caller' builtin to print a stack trace, e.g.: https://github.com/theimpostor/templates/blob/main/bash%2Fte...
Related posts
- penzai: JAX research toolkit for building, editing, and visualizing neural nets
- Tinygrad: Hacked 4090 driver to enable P2P
- Functions and operators for Dot and Matrix multiplication and Element-wise calculation in PyTorch
- Building a GPT Model from the Ground Up!
- Best AI Tools for Students Learning Development and Engineering