Hi, On Sun, Oct 12, 2014 at 02:11:39PM +1100, Angus Gratton wrote: > Does sigrok include tools to slice up an existing debug session, ie > extract a subset of samples?
Not yet, no. The *.sr files are currently relatively simple ZIP files so with some scripting it could be done as a "quick hack", but we really need proper tool support for this, IMHO (e.g. in sigrok-cli, Pulseview). The file format will change quite a bit in the future as well, making this kind of hack quite a bit more tedious, I think. > This is a problem I'm particularly sensitive to as I'm using fx2lafw > to take long-running captures of debugger sessions, but then only > really wanting to look at a few events out of thousands. Yup, I find myself wanting this feature again and again too. We should certainly support it. It's very handy for a number of use-cases, and almost required for some of them (e.g. when different protocols or protocol versions/parameters are time-multiplexed on the same pins, and you thus want to only run a PD on a subset of a full capture). > I've looked on the wiki but I might be searching the wrong terms (in > which case I apologise in advance for inadequate RTFM.) > > I also noticed sigrok-cli's --samples option doesn't seem to do > anything if reading from a session, so you can't use something like: > > sigrok-cli -i new.sr --samples 250k <blah> > > to limit the number of samples you read from the session. Hm, possible, though that should be fixable. > If there isn't an easy way to do this at the moment, I was thinking I > could look at implementing it in sigrok-cli as follows: > > * amend the --samples option so it works when reading from a session file. Yup, sounds good to me. > * Add a --skip-samples option that skips N samples from the beginning > of the capture (or after triggering if a trigger point is > specified). > > So then you can do something like: > > sigrok-cli -i new.sr -o subset.sr --samples 1k --skip-samples 100k > > To extract 1000 samples from 100000 samples into the capture. Yeah, sounds good. A simple skip+count mechanism like 'dd' supports it should work pretty nicely here. > * Possibly even a --skip-time option would be useful, so you can > extract a subset by looking at timestamps in pulseview. Yeah, that can be another handy option (probably not too much harder to do than --skip-samples). > Does this sound useful, or would it be totally redundant? It's certainly useful, yeah. I'd like the same functionality in PulseView as well. There are cursors already, but so far you can only measure a width/time with those. Another useful thing for that kind of cursors is to run a decoder on only a certain subset of the samples in a larger capture as you mentioned indeed. Uwe. -- http://hermann-uwe.de | http://randomprojects.org | http://sigrok.org ------------------------------------------------------------------------------ Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer http://p.sf.net/sfu/Zoho _______________________________________________ sigrok-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/sigrok-devel

