tmf: Add a package-info file to the callstack package
[deliverable/tracecompass.git] / tmf / org.eclipse.tracecompass.tmf.core / src / org / eclipse / tracecompass / tmf / core / callstack / CallStackAnalysis.java
1 /*******************************************************************************
2 * Copyright (c) 2013, 2015 Ericsson
3 *
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;
10
11 import org.eclipse.tracecompass.tmf.core.statesystem.TmfStateSystemAnalysisModule;
12
13 /**
14 * The base classes for analyses who want to populate the CallStack state
15 * system.
16 *
17 * @author Matthew Khouzam
18 * @since 2.1
19 */
20 public abstract class CallStackAnalysis extends TmfStateSystemAnalysisModule {
21
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 };
25
26 /**
27 * Abstract constructor (should only be called via the sub-classes'
28 * constructors.
29 */
30 protected CallStackAnalysis() {
31 super();
32 }
33
34 /**
35 * The quark pattern, relative to the root, to get the list of attributes
36 * representing the different processes of a trace.
37 * <p>
38 * If the trace does not define processes, an empty array can be returned.
39 * <p>
40 * The pattern is passed as-is to
41 * {@link org.eclipse.tracecompass.statesystem.core.ITmfStateSystem#getQuarks(String...)}.
42 * <p>
43 * Override this method if the state system attributes do not match the
44 * default pattern defined by {@link CallStackStateProvider}.
45 *
46 * @return The quark pattern to find the process attributes
47 */
48 public String[] getProcessesPattern() {
49 return DEFAULT_PROCESSES_PATTERN;
50 }
51
52 /**
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.
57 * <p>
58 * If the trace does not define threads, an empty array can be returned.
59 * <p>
60 * This will be passed as-is to
61 * {@link org.eclipse.tracecompass.statesystem.core.ITmfStateSystem#getQuarks(int, String...)}.
62 * <p>
63 * Override this method if the state system attributes do not match the
64 * default pattern defined by {@link CallStackStateProvider}.
65 *
66 * @return The quark pattern to find the thread attributes
67 */
68 public String[] getThreadsPattern() {
69 return DEFAULT_THREADS_PATTERN;
70 }
71
72 /**
73 * Get the call stack attribute path, relative to an attribute found by the
74 * combination of {@link #getProcessesPattern()} and
75 * {@link #getThreadsPattern()}.
76 * <p>
77 * Override this method if the state system attributes do not match the
78 * default pattern defined by {@link CallStackStateProvider}.
79 *
80 * @return the relative path of the call stack attribute
81 */
82 public String[] getCallStackPath() {
83 return DEFAULT_CALL_STACK_PATH;
84 }
85
86 }
This page took 0.03653 seconds and 5 git commands to generate.