0xtools
0xtools copied to clipboard
Use a /tmp file instead of RAM if duration exceeds 60 seconds
This PR resolves https://github.com/tanelpoder/0xtools/issues/48
Changes made: Updated to switch the SQLite database to a file (/tmp/psn_samples_${pid}.db) if the duration (args.sample_seconds) exceeds 60 seconds. Defined a cleanup function to remove the temporary database file if it was created. Register the cleanup function to be called on script exit or interruption using atexit if samples are not being persisted.