sunlin7 / compile-db-gen Goto Github PK
View Code? Open in Web Editor NEWGenerate compilation database from make (or other compile commands)
License: MIT License
Generate compilation database from make (or other compile commands)
License: MIT License
I just wanted to thank you for this project. About a year ago I found myself in a situation, when I had to work on a project with an unusual build system. I tried every other compile_commands.json
generation tools, but they all were failing to capture compiler invocations properly. Your idea of using strace
is brilliant and worked nicely!
Some time later I decided to improve on your idea and develop compile_commands.json
generator of my own. The main idea was to use ptrace
directly instead or relying on parsing strace
logs which are not meant to be machine-readable. Now it is more or less ready for use - https://github.com/i-ky/basset. I will appreciate if you give it a spin and test it in your usage scenarios to find any issues that I have missed.
Newer versions of strace
support --seccomp-bpf
option introduced in version 5.3:
Implemented usage of seccomp-bpf for stopping tracees only for filtered
syscalls. Use --seccomp-bpf option to enable.
It has huge impact on performance. According to my tests, strace
command currently used by compile-db-gen
adds ~100% overhead (i.e. build time doubles under strace
). Simply adding --seccomp-bpf
reduces overhead to ~10% making it almost unnoticeable.
I honestly don't know why strace
developers did not make --seccomp-bpf
a new default, but it definitely makes sense to use it in compile-db-gen
, if available.
compile-db-gen
is already picking only successful syscalls due to = 0
in regular expressions:
compile-db-gen/compile-db-gen.py
Lines 92 to 93 in 6a29446
Filtering them on strace side would reduce the amount of data compile-db-gen
needs to parse.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.