Userspace cores seem to work:
```
$ sysctl kern. | grep compress
kern.compress_user_cores_zstdlevel: 6
kern.compress_user_cores: 2
$ sysctl kern.corefile
kern.corefile: %N.core
$ python2 -c 'import os; os.abort()'
[1] 1156 abort (core dumped) python2 -c 'import os; os.abort()'
$ ls -l python2.7.core.zst
-rw------- 1 conrad conrad 429K Nov 15 12:17 python2.7.core.zst
$ zstd --test ./python2.7.core.zst
./python2.7.core.zst: 12894208 bytes
$ echo $(( 12894208 / 1024 ))
12592
$ echo $(( 100 * 429 / 12592 ))
3 # compressed size as percent of uncompressed core size
$ zstd -d ./python2.7.core.zst
./python2.7.core.zst: 12894208 bytes
$ file python2.7.core
python2.7.core: ELF 64-bit LSB core file x86-64, version 1 (FreeBSD), FreeBSD-style, from ' -c import os; os.abort()'
```
Kernel full dumps also work:
```
$ dumpon -l
gpt/freebsd-swap
$ dumpon -Z /dev/$(dumpon -l)
$ sysctl debug.{trace,debugger}_on_panic debug.minidump
debug.trace_on_panic: 1
debug.debugger_on_panic: 1
debug.minidump: 1
$ debug.minidump=0
$ sysctl kern.kerneldump_zstdlevel
kern.kerneldump_zstdlevel: 6
$ sysctl debug.kdb.panic=1
(core is dumped, reboot)
messages / console:
Nov 15 13:54:33 n savecore: reboot after panic: kdb_sysctl_panic
Nov 15 13:54:33 n savecore: writing core to /var/crash/vmcore.1.zst
$ cd /var/crash ; ls -lhtr
...
-rw------- 1 root wheel 77M Nov 15 13:54 vmcore.1.zst
lrwxr-xr-x 1 root wheel 6B Nov 15 13:54 info.last -> info.1
lrwxr-xr-x 1 root wheel 12B Nov 15 13:54 vmcore.last.zstd -> vmcore.1.zst
-rw-r--r-- 1 root wheel 30B Nov 15 13:54 core.txt.1
$ zstd --test ./vmcore.1.zst ; echo $?
./vmcore.1.zst : 34235252736 bytes
0
$ less core.txt.1
/var/crash/vmcore.1 not found
(That integration would be nice to fix, but requires unpacking the core somewhere, or creating seekable coredumps.)
$ zstdcat ./vmcore.1.zst | file -
/dev/stdin: ELF 64-bit LSB core file x86-64, invalid version (embedded)
```
And here's minidumps:
```
$ dumpon -Z /dev/$(dumpon -l)
$ sysctl debug.kdb.panic=1
(core is dumped, reboot)
Nov 19 19:38:17 n savecore: reboot after panic: kdb_sysctl_panic
Nov 19 19:38:17 n savecore: writing core to /var/crash/vmcore.2.zst
$ cd /var/crash ; ls -lhtr
...
lrwxr-xr-x 1 root wheel 12B Nov 15 13:54 vmcore.last.zstd -> vmcore.2.zst
-rw-r--r-- 1 root wheel 2B Nov 19 19:38 bounds
-rw------- 1 root wheel 534B Nov 19 19:38 info.2
-rw------- 1 root wheel 39M Nov 19 19:38 vmcore.2.zst
lrwxr-xr-x 1 root wheel 6B Nov 19 19:38 info.last -> info.2
-rw-r--r-- 1 root wheel 30B Nov 19 19:38 core.txt.2
$ cat info.2
Dump header from device: /dev/gpt/freebsd-swap
...
Compression: zstd
$ zstd -d --keep < ./vmcore.2.zst | strings | head -n1
minidump FreeBSD/amd64
```