1 /*******************************************************************************
2 * Copyright (c) 2013, 2015 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
8 *******************************************************************************/
9 package org
.eclipse
.tracecompass
.tmf
.core
.callstack
;
11 import org
.eclipse
.tracecompass
.tmf
.core
.statesystem
.TmfStateSystemAnalysisModule
;
14 * The base classes for analyses who want to populate the CallStack state
17 * @author Matthew Khouzam
20 public abstract class CallStackAnalysis
extends TmfStateSystemAnalysisModule
{
22 private static final String
[] DEFAULT_PROCESSES_PATTERN
= new String
[] { CallStackStateProvider
.PROCESSES
, "*" }; //$NON-NLS-1$
23 private static final String
[] DEFAULT_THREADS_PATTERN
= new String
[] { "*" }; //$NON-NLS-1$
24 private static final String
[] DEFAULT_CALL_STACK_PATH
= new String
[] { CallStackStateProvider
.CALL_STACK
};
27 * Abstract constructor (should only be called via the sub-classes'
30 protected CallStackAnalysis() {
35 * The quark pattern, relative to the root, to get the list of attributes
36 * representing the different processes of a trace.
38 * If the trace does not define processes, an empty array can be returned.
40 * The pattern is passed as-is to
41 * {@link org.eclipse.tracecompass.statesystem.core.ITmfStateSystem#getQuarks(String...)}.
43 * Override this method if the state system attributes do not match the
44 * default pattern defined by {@link CallStackStateProvider}.
46 * @return The quark pattern to find the process attributes
48 public String
[] getProcessesPattern() {
49 return DEFAULT_PROCESSES_PATTERN
;
53 * The quark pattern, relative to an attribute found by
54 * {@link #getProcessesPattern()}, to get the list of attributes
55 * representing the threads of a process, or the threads a trace if the
56 * process pattern was empty.
58 * If the trace does not define threads, an empty array can be returned.
60 * This will be passed as-is to
61 * {@link org.eclipse.tracecompass.statesystem.core.ITmfStateSystem#getQuarks(int, String...)}.
63 * Override this method if the state system attributes do not match the
64 * default pattern defined by {@link CallStackStateProvider}.
66 * @return The quark pattern to find the thread attributes
68 public String
[] getThreadsPattern() {
69 return DEFAULT_THREADS_PATTERN
;
73 * Get the call stack attribute path, relative to an attribute found by the
74 * combination of {@link #getProcessesPattern()} and
75 * {@link #getThreadsPattern()}.
77 * Override this method if the state system attributes do not match the
78 * default pattern defined by {@link CallStackStateProvider}.
80 * @return the relative path of the call stack attribute
82 public String
[] getCallStackPath() {
83 return DEFAULT_CALL_STACK_PATH
;