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.
- Host: GitHub
- URL: https://github.com/fukamachi/supertrace
- Owner: fukamachi
- Created: 2020-02-24T01:23:02.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-03-06T11:55:20.000Z (about 6 years ago)
- Last Synced: 2025-09-10T17:02:45.074Z (7 months ago)
- Topics: common-lisp, debugging, profiling
- Language: Common Lisp
- Size: 26.4 KB
- Stars: 32
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-cl - supertrace - Superior Common Lisp `trace` functionality for debugging/profiling. Trace many functions at once, use before and after hooks. [BSD_2Clause][17]. (Online editors ## / Third-party APIs)
README
# supertrace
[](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.