1 /*******************************************************************************
2 * Copyright (c) 2014 Ericsson
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * Alexandre Montplaisir - Initial API and implementation
11 * Patrick Tasse - Add methods to get attribute paths
12 *******************************************************************************/
14 package org
.eclipse
.tracecompass
.tmf
.ui
.views
.callstack
;
16 import org
.eclipse
.jdt
.annotation
.NonNullByDefault
;
17 import org
.eclipse
.tracecompass
.tmf
.core
.callstack
.CallStackStateProvider
;
18 import org
.eclipse
.tracecompass
.tmf
.core
.statesystem
.TmfStateSystemAnalysisModule
;
19 import org
.eclipse
.tracecompass
.tmf
.ui
.analysis
.TmfAnalysisViewOutput
;
22 * The base classes for analyses who want to populate the CallStack View.
24 * @author Alexandre Montplaisir
27 public abstract class AbstractCallStackAnalysis
extends TmfStateSystemAnalysisModule
{
29 private static final String
[] DEFAULT_PROCESSES_PATTERN
=
30 new String
[] { CallStackStateProvider
.PROCESSES
, "*" }; //$NON-NLS-1$
32 private static final String DEFAULT_THREADS_PATTERN
= ".*"; //$NON-NLS-1$
34 private static final String
[] DEFAULT_CALL_STACK_PATH
=
35 new String
[] { CallStackStateProvider
.CALL_STACK
};
38 * Abstract constructor (should only be called via the sub-classes'
41 protected AbstractCallStackAnalysis() {
43 registerOutput(new TmfAnalysisViewOutput(CallStackView
.ID
));
47 * The quark pattern to get the list of attributes representing the
48 * different processes.
50 * It is passed as-is to
51 * {@link org.eclipse.tracecompass.statesystem.core.ITmfStateSystem#getQuarks}
53 * @return The quark pattern to find the processes attribute
56 public String
[] getProcessesPattern() {
57 return DEFAULT_PROCESSES_PATTERN
;
61 * The regex to match sub-attributes of each Process attributes representing
62 * the threads of this process.
64 * This will be passed as-is to
65 * {@link org.eclipse.tracecompass.statesystem.core.ITmfStateSystem#getSubAttributes(int, boolean, String)}
67 * @return The regex to pass
70 public String
getThreadsForProcessPattern() {
71 return DEFAULT_THREADS_PATTERN
;
75 * Get the call stack attribute path relative to a thread attribute found by
76 * {@link #getThreadsForProcessPattern()}. Override this method if the state
77 * system attributes do not match the default pattern defined by
78 * {@link CallStackStateProvider}.
80 * @return the relative path of the call stack attribute
83 public String
[] getCallStackPathForThread() {
84 return DEFAULT_CALL_STACK_PATH
;