about summary refs log tree commit homepage
DateCommit message (Collapse)
2024-01-08README: fixup references to the Perl version HEAD master
That's where interesting developments happen, first.
2023-01-13extconf: remove unneeded checks
libdl is no longer needed since we no longer use dlsym(3). libc is assumed, not sure what I was smoking when I added an explicit check for that...
2023-01-13Merge remote-tracking branch 'perl/master'
* perl/master: use perror(3) instead of fprintf(3) script/*: shorten and point to docs move _GNU_SOURCE definition mwrap-perl: update manpage to synopsis to favor CSV fix uninitialized warnings rewrite README and update manpage to favor CSV %p => PID expansion for dump_path + dump_csv add mwrap-decode-csv tool support MWRAP=dump_csv:$FILENAME parameter simplify mw_perl_src_file_cstr to avoid gcc warning t/httpd.t: needs sqlite3 3.32.0+ for `.import --csv' s/X-Mwrap-BT-Depth/X-Mwrap-BT/ documentation updates
2023-01-13fix uninitialized .dump_csv for Mwrap.dump
.dump_csv was added to dump_args for the destructor, but not initialized properly for the Mwrap.dump API call.
2023-01-13resync docs, dump_csv: support from the Perl version
I somehow forgot about the existence of the perror(3) function :x
2023-01-13use perror(3) instead of fprintf(3)
perror(3) is standardized and reduces our binary text size a bit: text data bss dec hex filename 80330 1888 4352 86570 1522a before/Mwrap.so 80043 1896 4352 86291 15113 after/Mwrap.so
2023-01-13script/*: shorten and point to docs
Try to keep these scripts as short as possible so it's easier to find the manpage. For -rproxy, I guess a small note at the top will have to do...
2023-01-13move _GNU_SOURCE definition
This is to make the Ruby version happy.
2023-01-13mwrap-perl: update manpage to synopsis to favor CSV
2023-01-11fix uninitialized warnings
The `dump_fd' warning is legit but wasn't caught on my other system. The `lineno' warning pops up on my system with `-O0'
2023-01-11rewrite README and update manpage to favor CSV
The CSV format has far more info, is self-describing, and Devel::Mwrap->dump never existed. I'm not sure if I care to support a Perl API now that the AF_UNIX HTTP interface exists.
2023-01-11%p => PID expansion for dump_path + dump_csv
This makes it possible to dump per-PID files for processes which fork. `%p' matches what the Linux sys.kernel.core_pattern sysctl understands.
2023-01-11add mwrap-decode-csv tool
This is a useful companion to the dump_csv: directive. It also fixes a bug where HTML escaping was unnecessarily done to the CSV output by -rproxy.
2023-01-11support MWRAP=dump_csv:$FILENAME parameter
Just reusing code from httpd.
2023-01-09simplify mw_perl_src_file_cstr to avoid gcc warning
This works around a gcc (Debian 10.2.1-6) warning, and is less code, even
2023-01-09Merge back changes from the Ruby version
Mostly a few portability bits, but a few httpd UI/UX tweaks as well.
2023-01-09t/httpd.t: needs sqlite3 3.32.0+ for `.import --csv'
Just disable the test if CSV import doesn't work with the currently-installed sqlite3.
2023-01-09s/X-Mwrap-BT-Depth/X-Mwrap-BT/
This is more consistent with the `MWRAP=bt:' use, since adding `-Depth' seems unnecessary and makes curl commands too long.
2023-01-09documentation updates
Document the HTTP POST API and update the README with POP3 info and some minor rewording. We'll also consistently use `DIR' instead of `DIRECTORY' since it's shorter and well understood (`opendir', `readdir', etc.)
2023-01-093.0.0-pre1 v3.0.0-pre1
2023-01-09fix test_sigusr1_works
`p' will deadlock even with `STDOUT.sync=true', apparently :<
2023-01-09httpd: add CSV download link to /each/$MIN HTML
This makes the .CSV download discoverable so I don't have to document it in the manpage \o/
2023-01-09httpd: add notes about arenas and object heaps
We don't users being confused if an innocuous-looking line of code allocates unnexpectedly large values.
2023-01-09httpd: do not sort CSV output by default
CSV output is intended to be loaded by something else (e.g. SQLite, spreadsheet program, etc), so sorting it is likely a waste of time.
2023-01-09various doc updates, add mwrap(1) manpage
FreeBSD 12.x doesn't seem to work with the `pkg install'-ed ruby
2023-01-09httpd: s/X-Mwrap-BT-Depth/X-Mwrap-BT/
This is more consistent with the `MWRAP=bt:' use, since adding `-Depth' seems unnecessary and makes curl commands too long.
2023-01-09httpd: different URLs for Ruby vs Perl versions
They're different projects, still, I guess...
2023-01-09httpd: show GC count
We can't call rb_gc_count() safely outside of Ruby threads (especially during startup/teardown), but we can share it's last-known value safely.
2023-01-09test spawning non-Ruby process with socket_dir
This tests commit 649a0d3e3578 (httpd: undefine ruby_snprintf alias for non-Ruby processes, 2023-01-08)
2023-01-09make Ruby headers less intrusive
By including them at the bottom. This will be done for Perl headers in the future, too, since they break assert().
2023-01-08Rakefile: fix Ruby-only test case name
2023-01-08drop dlsym use for rb_stderr
A weak symbol works fine, here.
2023-01-08test_mwrap: fix test reliability
Not sure what drugs I was on when I wrote this :x
2023-01-08httpd: undefine ruby_snprintf alias for non-Ruby processes
ruby/subst.h (included by ruby.h) replaces `snprintf' with `ruby_snprintf'. This only works in processes linked to Ruby, but won't work in subprocesses spawned by Ruby.
2023-01-08update manifest
2023-01-08Merge changes from the Perl side
This contains many changes from https://80x24.org/mwrap-perl.git commit * Built-in RCU-friendly version of dlmalloc, no more fragile dlsym(3m) resolution of malloc-family functions in the constructor * Allocations are now backed by O_TMPFILE on $TMPDIR on modern Linux. Since mwrap increases memory usage greatly and I needed to use it on a system where I needed more VM space but lacked the ability to add swap. * Configurable C backtrace level via MWRAP=bt:$DEPTH where $DEPTH is a non-negative integer. Be careful about increasing it, even a depth of 3-4 can be orders-of-magnitude more expensive in time and space. This can be changed dynamically at runtime via local HTTP (see below). * Embedded per-process local-socket-only HTTP server obsoletes MwrapRack when combined with mwrap-rproxy from the Perl dist (set `MWRAP=socket_dir:/dir/of/sockets') See https://80x24.org/mwrap-perl/20221210015518.272576-4-e@80x24.org/ for more info. It now supports downloading CSV (suitable for importing into sqlite 3.32.0+) * License switched to GPL-3+ to be compatible with GNU binutils since we may take code from addr2line in the future. * libxxhash supported if XXH3_64bits is available.
2023-01-07picohttpparser: fix __SSE_4_2__ CPP check
This fixes a `-Wundef' warning with gcc, and `__SSE_4_2__' is a defined-ness check everywhere else.
2023-01-07mymalloc.h: set mode with O_TMPFILE
Although we never vivify the O_TMPFILE to an non-FS path (via linkat(2)), glibc may still complain about it since it doesn't know we never call linkat(2)
2023-01-07undefine Mwrap::SourceLocation.allocate
This quiets `undefining the allocator of T_DATA class Mwrap::SourceLocation' warnings.
2023-01-07mwrap_rack: lowercase response headers for Rack 3
Rack 3 requires lowercase headers, and they work with any Rack <=2.x version.
2023-01-07drop heap page support for Ruby <= 3.0
Ruby 3.1 uses mmap, nowadays, and I don't think it's worth the effort to suport it since mmap and munmap don't require the symmetry *memalign + free do.
2023-01-07rproxy: avoid uninitialized stat w/o debugperl
The `_' stat cache is cleared if `-x' fails, so ensure we capture it cheaply from the preceding `-e' before attempting `-x "/usr/bin/debugperl"'.
2023-01-03mymalloc: use ftruncate(2) when creating a sparse file
Unlike pwrite(2), it won't dirty the last page, and it's fewer arguments so argument passing is simpler.
2022-12-29rproxy: disable MWRAP+LD_PRELOAD for addr2line
GNU addr2line seems impossibly slow with MWRAP=bt:10 on FreeBSD. In any case, it's impossible for a single-process rproxy to inspect it's own addr2line processes; so just disable it.
2022-12-29rproxy: quiet down addr2line output on FreeBSD
No point in showing "?? at ??:0" to prefix everything.
2022-12-28rproxy: cache addr2line output
We'll hoist out exe resolution into its own sub and rely on reusing stat info (via `stat(_)') to give us ctime + size info to use as a cache key.
2022-12-28rproxy: improve addr2line support
We'll open scripts to resolve shebang lines (necessary for Perl scripts), and resolve non-absolute paths from to absolute paths based on $PATH (based on git). There's also a perl-debug||/usr/bin/debugperl special case for Debian, since there's (AFAIK) no -dbgsym package on Debian bullseye which covers /usr/bin/perl.
2022-12-28rproxy: close pipes in deterministic order
And always close our write end first so we can shut down addr2line slightly sooner.
2022-12-28rproxy: bail out early on errors reading /proc/$$/cmdline
I'm not sure if it's really an issue, but it it narrows down the places where uninitialized variable warnings can happen.
2022-12-28relicense to GPL-3 for future addr2line integration
Given the fragile change in https://80x24.org/mwrap-perl/20221227141712.1473379-1-e@80x24.org/ to support addr2line(1), I am considering integrating the GPL-3 code for GNU addr2line into httpd.h directly.