Skip to content

Commit a632564

Browse files
committed
doc: Minor updates in the trace-server-dev-guide.md
- Fix typos - Move Utility section to more fitting place - Fix indentations Signed-off-by: Bernd Hufmann <[email protected]>
1 parent 57457a5 commit a632564

File tree

1 file changed

+17
-22
lines changed

1 file changed

+17
-22
lines changed

doc/trace-server/trace-server-dev-guide.md

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,18 @@
4242
- [Supported query parameters](#supported-query-parameters-2)
4343
- [Virtual Table](#virtual-table)
4444
- [Supported query parameters](#supported-query-parameters-3)
45-
- [Using the data provider manager to access data providers](#using-the-data-provider-manager-to-access-data-providers)
46-
- [Implementing a Data Provider Factory](#implementing-a-data-provider-factory)
47-
- [Extension point](#extension-point)
48-
- [Using data provider factories with experiments](#using-data-provider-factories-with-experiments)
4945
- [Utilities](#utilities)
50-
- [Registering a data provider factory programmatically](#registering-a-data-provider-factory-programmatically)
51-
- [Implementing a facotry for single-instance data providers](#implementing-a-facotry-for-single-instance-data-providers)
46+
- [Using the data provider manager to access data providers](#using-the-data-provider-manager-to-access-data-providers)
47+
- [Implementing a Data Provider Factory](#implementing-a-data-provider-factory)
48+
- [Extension point](#extension-point)
49+
- [Using data provider factories with experiments](#using-data-provider-factories-with-experiments)
50+
- [Registering a data provider factory programmatically](#registering-a-data-provider-factory-programmatically)
51+
- [Implementing a factory for single-instance data providers](#implementing-a-factory-for-single-instance-data-providers)
5252
- [Implementing a facotry for multi-instance data providers](#implementing-a-facotry-for-multi-instance-data-providers)
5353
- [Grouping of data providers](#grouping-of-data-providers)
5454
- [Implementing a data provider without analysis module](#implementing-a-data-provider-without-analysis-module)
55-
- [Implementing a configurable data provider](#implementing-a-configurable-data-provider)
55+
- [Implementing a configurable data provider](#implementing-a-configurable-data-provider)
5656
- [Implementing a configuration source type](#implementing-a-configuration-source-type)
57-
- [The configuration source type describes the input parameters to provide when to pass when creating a new data provider or global configuration.](#the-configuration-source-type-describes-the-input-parameters-to-provide-when-to-pass-when-creating-a-new-data-provider-or-global-configuration)
5857
- [Implementing a configurable data provider without analysis module](#implementing-a-configurable-data-provider-without-analysis-module)
5958
- [Implementing an `ITmfDataProviderConfigurator` without analysis module](#implementing-an-itmfdataproviderconfigurator-without-analysis-module)
6059
- [Updating data provider factory for configurable data provider (without analysis module)](#updating-data-provider-factory-for-configurable-data-provider-without-analysis-module)
@@ -1312,7 +1311,11 @@ No parameters need to be added. Just pass an empty map.
13121311
| `table_search_expressions` | For searching providing a map <columnId, regular expression> Returned lines that match the search expression will be taggged by setting the highlight bit (8) in the properties bit mask of the return line model |
13131312
| `table_search_direction` | Optional, the search direction string NEXT or PREVIOUS. If omitted and `table_search_expressions` exists then NEXT will be used|
13141313

1315-
## Using the data provider manager to access data providers
1314+
### Utilities
1315+
1316+
Abstract base classes are provided for TreeXY and time graph data providers based on `TmfStateSystemAnalysisModule`s (`AbstractTreeCommonXDataProvider` and `AbstractTimeGraphDataProvider`, respectively). They handle concurrency, mapping of state system attributes to unique IDs, exceptions, caching and encapsulating the model in a response with the correct status.
1317+
1318+
### Using the data provider manager to access data providers
13161319

13171320
Data providers can be managed by the `DataProviderManager` class, which uses an [extension point](#extension-point) and factories for data providers. Factories can also programatically be registered (and deregistered) to (from) the `DataProviderManager`, see [here](#registering-a-data-provider-factory-programmatically for more details.
13181321

@@ -1399,7 +1402,7 @@ public class ExampleTimeGraphProviderFactory implements IDataProviderFactory {
13991402
}
14001403
}
14011404
```
1402-
### Extension point
1405+
#### Extension point
14031406
This extension needs to be added to the plugin's plugin.xml file:
14041407

14051408
```xml
@@ -1415,7 +1418,7 @@ This extension needs to be added to the plugin's plugin.xml file:
14151418
</extension>
14161419
```
14171420

1418-
### Using data provider factories with experiments
1421+
#### Using data provider factories with experiments
14191422

14201423
The Trace Compass framework allows to use the `DataProviderFactory` with single traces or experiments. The trace server will always create experiments even if a trace is a single trace.
14211424

@@ -1425,11 +1428,7 @@ In the data provider manager, experiments also get a unique instance of a data p
14251428
- the getDescriptor(ITmfTrace) returns only a single data provider descriptor for the same type
14261429
- it creates composite data provider instances (e.g. `TmfTimeGraphCompositeDataProvider`) with an array of data providers for each applicable sub-trace
14271430

1428-
### Utilities
1429-
1430-
Abstract base classes are provided for TreeXY and time graph data providers based on `TmfStateSystemAnalysisModule`s (`AbstractTreeCommonXDataProvider` and `AbstractTimeGraphDataProvider`, respectively). They handle concurrency, mapping of state system attributes to unique IDs, exceptions, caching and encapsulating the model in a response with the correct status.
1431-
1432-
### Registering a data provider factory programmatically
1431+
#### Registering a data provider factory programmatically
14331432

14341433
The most common way to register data provider factories is using the extension point as described above. However, the `DataProviderManager` has APIs to register and deregister factories programmatically. This allows to manage the lifecycle of custom data provider factories from extension code.
14351434

@@ -1445,7 +1444,7 @@ The most common way to register data provider factories is using the extension p
14451444
//..
14461445
```
14471446

1448-
#### Implementing a facotry for single-instance data providers
1447+
#### Implementing a factory for single-instance data providers
14491448
If you would like to create a `DataProviderFactory` for a data provider that is using one single analysis module, you can get the analysis module from the trace as shown in the example below.
14501449

14511450
```java
@@ -1582,7 +1581,7 @@ Data providers can be grouped under a common parent. A common parent is indicate
15821581

15831582
Data providers can use analysis modules, but they don't have to. For example, you can implement a data provider that gets the event statistics for the whole trace by reading all the events of a trace. See [Creating a Data Tree Data Provider](#creating-a-data-tree-data-provider) for an example.
15841583

1585-
## Implementing a configurable data provider
1584+
### Implementing a configurable data provider
15861585

15871586
Defining data providers statically as described in the previous chapters is not always flexible enough for user's needs. It's often required to create derived data providers from an existing data provider or data providers based on some configuration parameters. For example, it might be interesting to derive a CPU usage data provider from the original CPU usage data provider, that shows the CPU usage for a given CPU only. Another use case is to derive a virtual table data provider from the events table data provider, that shows only trace events with a certain event type.
15881587

@@ -1612,11 +1611,7 @@ The actual data provider needs to apply the configuration. The easiest way is to
16121611

16131612
### Implementing a configuration source type
16141613

1615-
<<<<<<< HEAD
16161614
The configuration source type describes the input parameters to provide when to pass when creating a new data provider or global configuration.
1617-
=======
1618-
The configuration source type descibes the input parameters to provide when to pass when creating a new data provider or global configuration.
1619-
>>>>>>> 222504c42f (doc: Add global configuration to trace-server developer guide)
16201615

16211616
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.
16221617

0 commit comments

Comments
 (0)