scalopus icon indicating copy to clipboard operation
scalopus copied to clipboard

Scalopus record script improvements

Open efernandez opened this issue 6 years ago • 3 comments

Improvements for the record script contributed in https://github.com/iwanders/scalopus/pull/9:

  • [ ] -o filename for writing to a directly named file, detect .gz extension and zip if appropriate. It should still default to stdin.
  • [ ] Limit recording to number of events. (!) This might required some support from the backend.
  • [ ] Add logging for -v(v) that displays numbers of traces, etc. (!) Logging should probably be disabled if the script is writing to stdin.

@iwanders Any comments/corrections? This is based on your comment in https://github.com/iwanders/scalopus/pull/9#issuecomment-537010464

efernandez avatar Oct 01 '19 12:10 efernandez

I think this captures it. We can do logging to stderr if we are writing the traces to stdout. That way we can still get info if piping it into a file.

We may need a 'streaming' mode in the native trace source to support limiting number of events and allow us to say, grep in the streaming output.

iwanders avatar Oct 01 '19 12:10 iwanders

streaming | grep would be awesome!

efernandez avatar Oct 02 '19 18:10 efernandez

Yeah, we should be able to do that by moving parts of this function to another function that yields a vector of jsons from the internal collection container (recorded_data_) in this class.

One problem we will have is that, at the moment we just can get away with one getMapping call at the end of the recording interval, which is gauranteed to include all mappings that were used in this interval. When we do streaming we need to retrieve the mappings at the beginning, but maybe also in between if we encounter tracepoints for which we don't have a mapping. This is obviously less than ideal. We need to think a bit whether we want to support encountering new tracepoints while streaming, or whether we expect all tracepoints to have already been encountered.

iwanders avatar Oct 03 '19 13:10 iwanders