You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/trace-server/trace-server-dev-guide.md
+241-3Lines changed: 241 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,10 @@ An `analysis` module in Trace Compass is an entity that consumes trace events of
13
13
14
14
A `configuration` is the data structure to configure and customize the trace server back-end globally (e.g. load XML analysis) or to configure data providers with parameters.
15
15
16
+
### Configuration source
17
+
18
+
A configuration source is a source of configurations. It is responsible to manage global configurations (e.g. create, delete, update etc).
19
+
16
20
### Configuration source type
17
21
18
22
A configuration source type describes the input parameters to provide when creating a new data provider or to configure the trace server globally.
@@ -224,6 +228,238 @@ A trace type defines a parser for the raw trace file(s). It will parse the raw t
224
228
225
229
Trace compass provides a mechanism for different components to interact with each other using signals. The signals can carry information that is specific to each signal. In the Trace Server only uses a subset of the available signals, where `TmfTraceOpenedSignal` and `TmfTraceClosedSignal` are the most important signals, some other signals are not applicable when running in the trace server context. See the [Trace Compass Developer Guide for Eclipse](https://archive.eclipse.org/tracecompass/doc/nightly/org.eclipse.tracecompass.doc.dev/Component-Interaction.html#Component_Interaction) for more information about signals and how to send and receive them.
226
230
231
+
## Implementing a global configuration
232
+
233
+
Global configurations are used to load configuration parameters that configures the trace server application. For example, one can load XML analysis defintions using the global configuartion interface.
234
+
235
+
### Implementing a configuration source
236
+
237
+
To implement a configuration source use the extension point for configuration source with id `org.eclipse.tracecompass.tmf.core.config`. The following example explains for the XML anlaysis available in the Trace Compass core code base.
Return the configuration source type that this configuration source can handle. The configuration source type descibes the input parameter to pass when creating a global configuration. See chapter [Implementing a configuration source type](#implementing-a-configuration-source-type) about the class to return.
This method is called to create a global configuration base on the input configuration. It returns a `ITmfConfiguration` instance. It is repsonsible to persist the configuration in memory and on disk so that it is available after a server restart. To persist to disk the plug-in state location of workspace can be used which is accessible using Eclipse platform APIs.
This method is called to update an existing configuration with new parameters.
258
+
-`ITmfConfiguration remove(String id)`
259
+
This method is called to remove an existing configuration by ID. If the configuration exisits, this method is responsible to clean-up the peristed data. If, for example, analysis modules with state systems or other persisted data were created as result of an configuration, this method needs to make sure that those are clean-up.
260
+
-`List<ITmfConfiguration> getConfigurations()`
261
+
Gets all configuration instances.
262
+
-`boolean contains(String id)`
263
+
Method to check if a configuration with given ID exists
264
+
-`ITmfConfiguration get(String id)`
265
+
Returns a configuration with given ID if it exists
266
+
-`void dispose()`
267
+
Disposes the configuration source
268
+
269
+
The below the code for the `XmlConfigurationSource`. Note it reuses utilities that already existed for the integration with Eclipse Trace Compass.
Return one or more configuration source type that this configurator can handle. The configuration source type descibes the input parameter to pass when creating a data provider
1524
+
Return one or more configuration source type that this configurator can handle. The configuration source type describes the input parameter to pass when creating a data provider
This method is called to create derived data providers base on the input configuration. It returns a data provider descriptor of the derived data provider. The descriptor has to have the configuration set, has to have the capability of `canDelete` (so that it can be deleted) as well as it has to have an ID that has the configuration ID appended, which will be used by the corresponding data provider factory to create an instance of the data provider. It is responsible to create and manage analysis modules (e.g. add to ITmfTrace object) and persist the configuration in memory and disk so that it available after a server restart.
@@ -1306,7 +1542,11 @@ The actual data provider needs to apply the configuration. The easiest way is to
1306
1542
1307
1543
### Implementing a configuration source type
1308
1544
1545
+
<<<<<<< HEAD
1309
1546
The configuration source type describes the input parameters to provide when to pass when creating a new data provider or global configuration.
1547
+
=======
1548
+
The configuration source type descibes the input parameters to provide when to pass when creating a new data provider or global configuration.
1549
+
>>>>>>> 222504c42f (doc: Add global configuration to trace-server developer guide)
1310
1550
1311
1551
The interface to implement is `ITmfConfigurationSourceType`. You can use the `TmfConfigurationSourceType.Builder` class to build such type. It has name, description, unique ID, an optional JSON schema file or a list of simple `TmfConfigurationParameter` instances. Use schema as much as you can. The schema will describe the JSON parameters, that `ITmfConfiguration.getParameters()` will return when passed to the configurator.
1312
1552
@@ -1323,7 +1563,6 @@ The interface to implement is `ITmfConfigurationSourceType`. You can use the `Tm
1323
1563
}
1324
1564
```
1325
1565
1326
-
1327
1566
### Implementing a configurable data provider without analysis module
1328
1567
1329
1568
To demonstrate how to implement a configurable data provider that doesn't use an analyis module, we will modify the data provider of chapter [Implementing data provider without analysis module](#implementing-a-data-provider-without-analysis-module). Please note that the class name and package names are different to be able to have independent examples in the example plug-in.
@@ -2912,7 +3151,6 @@ The interfaces for configurable data providers gives the developer the freedom t
2912
3151
2913
3152
## To Do
2914
3153
Provide guides for other features relevant for developing a custom trace server using Trace Compass core APIs, e.g.
0 commit comments