Hi Michel, 

I think that the "This is a file type that I handle" return value would be 
useful if it was not just boolean, but rather a rank of some sort. A generic 
CTF reader could handle many different types of traces, and yet there will be 
handlers that have specialized knowledge of the trace schema. Say the return 
value was an integer. If a given filter cannot handle it, it returns 0. If it 
is the generic CTF filter and sees that this is in fact a properly formatted 
trace/directory then it returns 1. If it additionally looks at the trace 
metadata and figures out that it is a trade for a particular operating system 
and it knows that it is a specialized filter for that particular trace, then it 
returns a higher value. The highest value returned would be used to 
automatically "do the right thing" when simply double clicking a file. If you 
need to specify exactly what you want to use for a given trace then selecting 
from the ordered list of filters that support the trace which one you want. 

I am sure I am not alone in being annoyed that I have to tell TMF what the 
trace is when I import it. It should be able to know much more often. 

regards, 
Aaron Spear, VMware 

----- Original Message -----

> TMF must open several "trace" types, some of which are stored in directories
> and others as almost arbitrary text files. Thus, it does not fit too well
> with the usual file open dialog pattern. Yet, we often feel that TMF does
> not just open the file as it should... Here is a proposed "algorithm" to
> open files. Comments / use cases welcome.

> We start from a directory containing files and possibly sub-directories. Each
> will be passed to the "filters" registered by the different file handlers
> (e.g. CTF file handler, Text file handler...).

> The filter can return one of the following:

> - This is a file type I handle, allow it to be opened, place this icon to
> represent it.
> - This is a "trace" directory type I handle, it contains a single trace,
> allow it to be opened just as a trace file, place this icon to represent it.
> - This is a "trace" directory type I handle, it contains several traces,
> allow it to be opened as a "traceset" or to be stepped into, place this icon
> to represent it.
> - This is an unknown type, it may be a trace, allow it to be opened.
> - This is a known type that should not be allowed to be opened, gray it

> With the dialog showing the files and directories along with the associated
> icons, the following actions are available:

> - double click to open a file, a directory containing a single trace, or to
> descend into a directory.
> - click on a file to select it.
> - shift click on a file to add to the selection
> - click on open button to open the selected files
> - click on the open button to open all traces in the selected trace directory
> - click on open button to descend in the selected normal directory
> - click on cancel to not open anything
> - should we have a button to select all traces in the current directory?

> _______________________________________________
> linuxtools-dev mailing list
> linuxtools-dev@eclipse.org
> https://urldefense.proofpoint.com/v1/url?u=https://dev.eclipse.org/mailman/listinfo/linuxtools-dev&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=vdoISiB3xBJd1v2JoLPqf5ueLD0%2FEi5LXNDUVTri7hk%3D%0A&m=gdH3iOkNVJCUIqLckC7S3qLQIRlqOdNnYxPhJme96pk%3D%0A&s=313c503476d49a7a68fc0cf173efb725847008d4dbdede37db3ff92cf4200ba9
_______________________________________________
linuxtools-dev mailing list
linuxtools-dev@eclipse.org
https://dev.eclipse.org/mailman/listinfo/linuxtools-dev

Reply via email to