Skip to content

Commit

Permalink
linux.core: Generalize ResourcesStatusDataProvider
Browse files Browse the repository at this point in the history
The original ResourcesStatusDataProvider was parameterized to require
a KernelAnalysisModule. Now ResourcesStatusDataProvider is requires a
TmfStateSystemAnalysisModule, making it available for other analysis
modules such as DataDrivenAnalysisModule. The expected information
can then be provided by other analysis module with state systems
in the same structure.

Note: this class is internal and thus would need a factory to take
advantage of the increased modularity.

[Changed] ResourceStatusDataProvider depends on TmfStateSystemAnalysisModule

Signed-off-by: Siwei Zhang <manbearpig10086@gmail.com>
Change-Id: I45030de7319bfab4092e49cf10a92309b3bf0724
Reviewed-on: https://git.eclipse.org/r/c/tracecompass/org.eclipse.tracecompass/+/201928
Reviewed-by: Patrick Tasse <patrick.tasse@gmail.com>
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Tested-by: Trace Compass Bot <tracecompass-bot@eclipse.org>
Tested-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
  • Loading branch information
siwei-zhang-work authored and MatthewKhouzam committed Aug 30, 2023
1 parent 7ea58f6 commit b26495e
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -34,7 +34,7 @@
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.osgi.util.NLS;
import org.eclipse.tracecompass.analysis.os.linux.core.kernel.KernelAnalysisModule;
import org.eclipse.tracecompass.tmf.core.statesystem.TmfStateSystemAnalysisModule;
import org.eclipse.tracecompass.analysis.os.linux.core.kernel.StateValues;
import org.eclipse.tracecompass.analysis.os.linux.core.model.OsStrings;
import org.eclipse.tracecompass.analysis.os.linux.core.trace.IKernelTrace;
Expand Down Expand Up @@ -95,7 +95,7 @@
*
* @author Loic Prieur-Drevon
*/
public class ResourcesStatusDataProvider extends AbstractTimeGraphDataProvider<@NonNull KernelAnalysisModule, @NonNull ResourcesEntryModel> implements IOutputAnnotationProvider, IOutputStyleProvider {
public class ResourcesStatusDataProvider extends AbstractTimeGraphDataProvider<@NonNull TmfStateSystemAnalysisModule, @NonNull ResourcesEntryModel> implements IOutputAnnotationProvider, IOutputStyleProvider {

/**
* Extension point ID.
Expand Down Expand Up @@ -212,10 +212,10 @@ public StringBuffer format(Object obj, StringBuffer toAppendTo, FieldPosition po
* @param trace
* The trace for which this provider will be built.
* @param module
* the {@link KernelAnalysisModule} to access the underlying
* the {@link TmfStateSystemAnalysisModule} to access the underlying
* {@link ITmfStateSystem}
*/
protected ResourcesStatusDataProvider(@NonNull ITmfTrace trace, @NonNull KernelAnalysisModule module) {
protected ResourcesStatusDataProvider(@NonNull ITmfTrace trace, @NonNull TmfStateSystemAnalysisModule module) {
super(trace, module);
Predicate<@NonNull ResourcesEntryModel> additional = model -> ResourcesEntryModel.Type.CURRENT_THREAD.equals(model.getType());
fEventAnnotatonProvider = new EventAnnotationProvider<>(TmfStrings.cpu(), additional,
Expand Down

0 comments on commit b26495e

Please sign in to comment.