An open API service indexing awesome lists of open source software.

https://github.com/fukamachi/supertrace

Superior Common Lisp `trace` functionality for debugging/profiling real world applications.
https://github.com/fukamachi/supertrace

common-lisp debugging profiling

Last synced: 2 months ago
JSON representation

Superior Common Lisp `trace` functionality for debugging/profiling real world applications.

Awesome Lists containing this project

README

          

# supertrace

[![Build Status](https://github.com/fukamachi/supertrace/workflows/CI/badge.svg)](https://github.com/fukamachi/supertrace/actions?query=workflow%3ACI)

Superior Common Lisp `trace` functionality for debugging/profiling real world applications.

## Warning

This software is still ALPHA quality. The APIs will be likely to change.

## Usage

```
;; List a function names to trace
(supertrace dbi:execute dbi:prepare)

;; Trace all exported functions from 'dbi' package and 'dex:request'
(supertrace (package dbi) dex:request)

;; Custom before/after functions
(supertrace (package dbi) dex:request
:before #'before-logger ;; <- A function takes 2 arguments -- a function name and arguments
:after #'after-logger) ;; <- A function takes 4 arguments -- a function name, arguments, returned value and elapsed time in microsecond.
```

Output is like as follows:

```
running (prepare # "SELECT COUNT(*) AS \"count\" FROM \"entry\" WHERE \"user_id\" = ?")
0.210ms (prepare # "SELECT COUNT(*) AS \"count\" FROM \"entry\" WHERE \"user_id\" = ?") -> #
running (execute # "eb073a91-d098-4c38-805b-cede8e39d278")
0.565ms (execute # "eb073a91-d098-4c38-805b-cede8e39d278") -> #
```

### Options

- `:before`: A function to run _before_ the function call
- `:after`: A function to run _after_ the function call
- `:threshold`: Run `:after` function only when the elapsed time exceeded this value. (in microsecond)

## Supported implementations

- [x] SBCL
- [ ] Clozure CL
- [ ] Others

## Author

* Eitaro Fukamachi (e.arrows@gmail.com)

## Copyright

Copyright (c) 2020 Eitaro Fukamachi (e.arrows@gmail.com)

## License

Licensed under the BSD 2-Clause License.