Skip to content

Conversation

@nrorzol
Copy link

@nrorzol nrorzol commented Jan 24, 2023

The code uses archive.h to support reading compressed files. It is based off the old archive support code from before the merging of qtdis into qtreader.

I wasn't sure the best way to handle determining whether to read compressed vs. uncompressed so I left that up to the user and added:
qtreader_initialize_fd_compressed
qtreader_next_record_compressed
and assumed the user would call the correct one. Perhaps qtreader_next_record_compressed could be removed, but I wasn't sure how to automatically determine if the qtrace file was compressed and the initialization of the compressed qtreader_state is a bit different.

I also added a test5.c that compares an uncompressed (arg1) qtrace to a compressed (arg2) qtrace and ensures that the lengths and records from each are the same. I ran it on a couple qtraces with bz2 compression and it worked.

The code uses archive.h to support reading compressed files.  It is
based off the old archive support code from before the merging of qtdis
into qtreader.

I wasn't sure the best way to handle determining whether to read
compressed vs. uncompressed so I left that up to the user and added:
  qtreader_initialize_fd_compressed
  qtreader_next_record_compressed
and assumed the user would call the correct one.  Perhaps
qtreader_next_record_compressed could be removed, but I wasn't sure how
to automatically determine if the qtrace file was compressed and the
initialization of the compressed qtreader_state is a bit different.

I also added a test5.c that compares an uncompressed (arg1) qtrace to a
compressed (arg2) qtrace and ensures that the lengths and records from
each are the same.  I ran it on a couple qtraces with bz2 compression
and it worked.

Signed-off-by: Nick Orzol <nrorzol@us.ibm.com>
@nrorzol
Copy link
Author

nrorzol commented Jan 24, 2023

I wasn't sure if there is a debug flag that should be used somewhere for the debug print statements I found helpful, so I left them commented out.

I also wasn't sure about adding the archive dependency and if it would be desirable to have a flag to enable/disable the feature in compilation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant