Skip to content

src,http2: refactor + generalize http2 debugging

Rodrigo Muino Tomonari requested to merge github/fork/addaleax/re-debug into master

tl;dr: Instead of having to compile with ./configure --debug-http2, get the same output with NODE_DEBUG_NATIVE=http2 node at runtime, in a way that makes implementing similar debugging for other core modules easier.

  • src: implement debug output utilities

    Implement utilities for easier debugging of Node.js core code, inspired by the HTTP/2 debugging code. Debugging is, however, implemented at runtime rather than at compile time, controlled through a new through a new NODE_DEBUG_NATIVE=categories environment variable.

    The runtime overhead in the debugging-disabled case amounts to 1 well-cachable one-byte read per debug call.

  • http2: switch to new runtime-controlled debugging system

    Remove --debug-http2 as a compile-time feature and make all debug statements available using NODE_DEBUG_NATIVE=http2 at runtime.

    This probably makes the debugging-enabled case a bit slower due to additional string concatenations, but switching to a runtime-checking system makes debugging more flexible and can be applied more easily to other parts of the source code as well.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

Merge request reports

Loading