Get the latest tech news

Show HN: Timep – a next-gen profiler and flamegraph-generator for bash code


`timep` is an efficient and state-of-the-art trap-based profiler for bash code. `timep` does much more than "providing per-command execution times" -- it maps the full call-stack tree for...

-f,-s, and-c: Use these flags to force timep to treat the input as a function, script, or list of raw commands (respectively). record previous command endtime figure out if nesting lvl has changed (e.g., due to entering/exiting a subshell/function) so we can write the log in the correct place write log line (start/end time + metadata) for previous command in a logfile in timep s tmpdir that is named based on nesting lvl. To actually run the code, timep gathers all required function definitions and saves them in the tmpdir at functions.bash, then generates a main.bash script that initializes the requires timep metadata variables, sets the DEBUG / EXIT / RETURN traps, then runs whatever is being profiled.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of generator

generator

Photo of bash code

bash code

Photo of gen profiler

gen profiler

Related news:

News photo

Google's got a new AI image-to-video generator, but Pixels aren't first on the list

News photo

Show HN: Feedsmith — Fast parser & generator for RSS, Atom, OPML feed namespaces

News photo

Home Battery versus Generator