--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2016 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.lttng2.ust.core.tests.callstack;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.Collection;
+import java.util.Set;
+
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.tracecompass.internal.lttng2.ust.core.callstack.LttngUstCallStackAnalysisRequirement;
+import org.eclipse.tracecompass.lttng2.ust.core.trace.LttngUstTrace;
+import org.eclipse.tracecompass.lttng2.ust.core.trace.layout.ILttngUstEventLayout;
+import org.eclipse.tracecompass.tmf.ctf.core.event.CtfTmfEventType;
+import org.junit.Test;
+
+import com.google.common.collect.ImmutableSet;
+
+/**
+ * Test the {@link LttngUstCallStackAnalysisRequirement} class
+ *
+ * @author Bernd Hufmann
+ */
+public class LTTngUstCallStackAnalysisRequirementTest {
+
+ private static final @NonNull String FUNC_EXIT_FAST = "lttng_ust_cyg_profile_fast:func_exit";
+ private static final @NonNull String FUNC_EXIT = "lttng_ust_cyg_profile:func_exit";
+ private static final @NonNull String FUNC_ENTRY_FAST = "lttng_ust_cyg_profile_fast:func_entry";
+ private static final @NonNull String FUNC_ENTRY = "lttng_ust_cyg_profile:func_entry";
+ private static final @NonNull String OTHER_EVENT = "OTHER";
+
+ private static final @NonNull String CONTEXT_VTID = "context._vtid";
+ private static final @NonNull String CONTEXT_PROCNAME = "context._procname";
+ private static final @NonNull String CONTEXT_OTHER = "context._other";
+
+ private static final @NonNull Collection<String> validFields = ImmutableSet.of(CONTEXT_VTID, CONTEXT_PROCNAME);
+ private static final @NonNull Collection<String> badFields = ImmutableSet.of(CONTEXT_OTHER, CONTEXT_PROCNAME);
+
+ enum EventType {
+ EVT_EXIT_FAST (FUNC_EXIT_FAST, validFields),
+ EVT_EXIT (FUNC_EXIT, validFields),
+ EVT_ENTRY_FAST (FUNC_ENTRY_FAST, validFields),
+ EVT_ENTRY (FUNC_ENTRY, validFields),
+ EVT_OTHER (OTHER_EVENT, validFields),
+ EVT_ENTRY_BAD_FIELDS (FUNC_ENTRY, badFields),
+ EVT_ENTRY_FAST_BAD_FIELDS (FUNC_ENTRY_FAST, badFields),
+ EVT_ENTRY_FAST_EMPTY_FIELDS (FUNC_ENTRY_FAST, ImmutableSet.of());
+
+ private final @NonNull CtfTmfEventType fType;
+
+ EventType(@NonNull String name, @NonNull Collection<String> fields) {
+ fType = new CtfTmfEventType(name, null) {
+ @Override
+ public String getName() {
+ return name;
+ }
+ @Override
+ public @NonNull Collection<String> getFieldNames() {
+ return fields;
+ }
+ };
+ }
+
+ @NonNull CtfTmfEventType getEventType() {
+ return fType;
+ }
+ }
+
+ enum TestData {
+ TRACE_WITH_VALID_EVENTS(EventType.EVT_ENTRY, EventType.EVT_EXIT, true),
+ TRACE_WITH_VALID_EVENTS_FAST(EventType.EVT_ENTRY_FAST, EventType.EVT_EXIT_FAST, true),
+ TRACE_WITH_VALID_EVENTS_MISSING_FIELDS(EventType.EVT_ENTRY_BAD_FIELDS,
+ EventType.EVT_EXIT, false),
+ TRACE_WITH_VALID_EVENTS_MISSING_FIELDS_FAST(EventType.EVT_ENTRY_FAST_BAD_FIELDS,
+ EventType.EVT_EXIT_FAST, false),
+ TRACE_WITH_VALID_EVENTS_WRONG_FIELDS(EventType.EVT_ENTRY_FAST_EMPTY_FIELDS,
+ EventType.EVT_EXIT_FAST, false),
+ TRACE_WITH_MISSING_EVENTS(EventType.EVT_OTHER,
+ EventType.EVT_EXIT_FAST, false),
+ TRACE_MISMATCH_EVENTS(EventType.EVT_ENTRY_FAST, EventType.EVT_EXIT, false);
+
+ private final @NonNull LttngUstTrace fTrace;
+ private final boolean fIsValid;
+
+ TestData(EventType first, EventType second, boolean isValid) {
+ fTrace = new LttngUstTrace() {
+ @Override
+ public Set<CtfTmfEventType> getContainedEventTypes() {
+ return ImmutableSet.of(first.getEventType(), second.getEventType());
+ }
+ };
+ fIsValid = isValid;
+ }
+
+ @NonNull LttngUstTrace getTrace() {
+ return fTrace;
+ }
+
+ boolean isValid() {
+ return fIsValid;
+ }
+
+ }
+
+ /**
+ * Test Call Stack Analysis requirements
+ */
+ @Test
+ public void testCallStackRequirements() {
+ LttngUstCallStackAnalysisRequirement req = new LttngUstCallStackAnalysisRequirement(ILttngUstEventLayout.DEFAULT_LAYOUT);
+ for (TestData item: TestData.values()) {
+ assertEquals(item.name(), item.isValid(), req.test(item.getTrace()));
+ }
+ }
+}
Bundle-Name = Trace Compass LTTng Userspace Tracer Analysis Core Plug-in
tracetype.type.ust = LTTng UST Trace
+
+analysis.callstack = LTTng-UST CallStack
class="org.eclipse.tracecompass.lttng2.ust.core.trace.LttngUstTrace">
</tracetype>
</module>
+ <module
+ analysis_module="org.eclipse.tracecompass.internal.lttng2.ust.core.callstack.LttngUstCallStackAnalysis"
+ automatic="false"
+ id="org.eclipse.linuxtools.lttng2.ust.analysis.callstack"
+ name="%analysis.callstack">
+ <tracetype
+ applies="true"
+ class="org.eclipse.tracecompass.lttng2.ust.core.trace.LttngUstTrace">
+ </tracetype>
+ </module>
</extension>
</plugin>
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2014, 2016 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.internal.lttng2.ust.core.callstack;
+
+import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
+
+import java.util.Set;
+
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.Nullable;
+import org.eclipse.tracecompass.lttng2.ust.core.trace.LttngUstTrace;
+import org.eclipse.tracecompass.lttng2.ust.core.trace.layout.ILttngUstEventLayout;
+import org.eclipse.tracecompass.tmf.core.analysis.requirements.TmfAbstractAnalysisRequirement;
+import org.eclipse.tracecompass.tmf.core.callstack.CallStackAnalysis;
+import org.eclipse.tracecompass.tmf.core.exceptions.TmfAnalysisException;
+import org.eclipse.tracecompass.tmf.core.statesystem.ITmfStateProvider;
+import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
+
+import com.google.common.collect.ImmutableSet;
+
+/**
+ * Call-stack analysis to populate the TMF CallStack View from UST cyg-profile
+ * events.
+ *
+ * @author Alexandre Montplaisir
+ */
+public class LttngUstCallStackAnalysis extends CallStackAnalysis {
+
+ /**
+ * ID
+ */
+ public static final String ID = "org.eclipse.linuxtools.lttng2.ust.analysis.callstack"; //$NON-NLS-1$
+
+ private @Nullable Set<@NonNull TmfAbstractAnalysisRequirement> fAnalysisRequirements = null;
+
+ @Override
+ public boolean setTrace(ITmfTrace trace) throws TmfAnalysisException {
+ if (!(trace instanceof LttngUstTrace)) {
+ return false;
+ }
+ return super.setTrace(trace);
+ }
+
+ @Override
+ protected LttngUstTrace getTrace() {
+ return (LttngUstTrace) super.getTrace();
+ }
+
+ @Override
+ protected ITmfStateProvider createStateProvider() {
+ return new LttngUstCallStackProvider(checkNotNull(getTrace()));
+ }
+
+ @Override
+ public @NonNull Iterable<@NonNull TmfAbstractAnalysisRequirement> getAnalysisRequirements() {
+
+ Set<@NonNull TmfAbstractAnalysisRequirement> requirements = fAnalysisRequirements;
+ if (requirements == null) {
+ LttngUstTrace trace = getTrace();
+ ILttngUstEventLayout layout = ILttngUstEventLayout.DEFAULT_LAYOUT;
+ if (trace != null) {
+ layout = trace.getEventLayout();
+ }
+ requirements = ImmutableSet.of(new LttngUstCallStackAnalysisRequirement(layout));
+ fAnalysisRequirements = requirements;
+ }
+ return requirements;
+ }
+
+}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2016 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.tracecompass.internal.lttng2.ust.core.callstack;
+
+import static org.eclipse.tracecompass.common.core.NonNullUtils.nullToEmptyString;
+
+import java.util.Collection;
+import java.util.Set;
+
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.eclipse.tracecompass.lttng2.ust.core.trace.layout.ILttngUstEventLayout;
+import org.eclipse.tracecompass.tmf.core.analysis.requirements.TmfAbstractAnalysisRequirement;
+import org.eclipse.tracecompass.tmf.core.analysis.requirements.TmfAnalysisEventFieldRequirement;
+import org.eclipse.tracecompass.tmf.core.analysis.requirements.TmfCompositeAnalysisRequirement;
+
+import com.google.common.collect.ImmutableSet;
+
+/**
+ * Analysis requirement implementation for LTTng Call Stack Analysis.
+ *
+ * @author Bernd Hufmann
+ *
+ */
+@NonNullByDefault
+public class LttngUstCallStackAnalysisRequirement extends TmfCompositeAnalysisRequirement {
+
+ /**
+ * Constructor
+ *
+ * @param layout
+ * The event layout (non-null)
+ */
+ public LttngUstCallStackAnalysisRequirement(ILttngUstEventLayout layout) {
+ super(getSubRequirements(layout), PriorityLevel.AT_LEAST_ONE);
+
+ addInformation(nullToEmptyString(Messages.LttnUstCallStackAnalysisModule_EventsLoadingInformation));
+ }
+
+ private static Collection<TmfAbstractAnalysisRequirement> getSubRequirements(ILttngUstEventLayout layout) {
+ Set<@NonNull String> requiredEventsFields = ImmutableSet.of(
+ layout.contextProcname(),
+ layout.contextVtid());
+
+ // Requirement for the cyg_profile events
+ TmfAnalysisEventFieldRequirement entryReq = new TmfAnalysisEventFieldRequirement(
+ layout.eventCygProfileFuncEntry(),
+ requiredEventsFields,
+ PriorityLevel.MANDATORY);
+
+ TmfAbstractAnalysisRequirement exitReq = new TmfAnalysisEventFieldRequirement(
+ layout.eventCygProfileFuncExit(),
+ requiredEventsFields,
+ PriorityLevel.MANDATORY);
+
+ TmfAbstractAnalysisRequirement cygProfile = new TmfCompositeAnalysisRequirement(ImmutableSet.of(entryReq, exitReq), PriorityLevel.MANDATORY);
+
+ // Requirement for the cyg_profile_fast events
+ entryReq = new TmfAnalysisEventFieldRequirement(
+ layout.eventCygProfileFastFuncEntry(),
+ requiredEventsFields,
+ PriorityLevel.MANDATORY);
+
+ exitReq = new TmfAnalysisEventFieldRequirement(
+ layout.eventCygProfileFastFuncExit(),
+ requiredEventsFields,
+ PriorityLevel.MANDATORY);
+ TmfAbstractAnalysisRequirement cygProfileFast = new TmfCompositeAnalysisRequirement(ImmutableSet.of(entryReq, exitReq), PriorityLevel.MANDATORY);
+
+ return ImmutableSet.of(cygProfile, cygProfileFast);
+ }
+
+}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2016 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.tracecompass.internal.lttng2.ust.core.callstack;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * Message bundle for the call stack analysis module
+ *
+ * @author Sonia Farrah
+ */
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = Messages.class.getPackage().getName() + ".messages"; //$NON-NLS-1$
+
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ /** Information regarding events loading prior to the analysis execution */
+ public static String LttnUstCallStackAnalysisModule_EventsLoadingInformation;
+
+ private Messages() {
+ }
+}
--- /dev/null
+###############################################################################
+# Copyright (c) 2016 Ericsson
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Ericsson - Initial API and implementation
+###############################################################################
+LttnUstCallStackAnalysisModule_EventsLoadingInformation=Add the ''vtid'' and ''procname'' contexts to your trace session. \n\
+Preload the ''liblttng-ust-cyg-profile'' library when running your program: \n\
+LD_PRELOAD=/usr/lib/liblttng-ust-cyg-profile.so ./myprogram
org.eclipse.tracecompass.tmf.core.tests,
org.eclipse.tracecompass.lttng2.ust.core;bundle-version="2.0.0",
org.eclipse.tracecompass.tmf.ctf.core;bundle-version="2.0.0"
-Export-Package: org.eclipse.tracecompass.lttng2.ust.ui.tests,
- org.eclipse.tracecompass.lttng2.ust.ui.tests.analysis.callstack
+Export-Package: org.eclipse.tracecompass.lttng2.ust.ui.tests
Import-Package: com.google.common.collect,
com.google.common.primitives
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2016 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-
-package org.eclipse.tracecompass.lttng2.ust.ui.tests.analysis.callstack;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.Collection;
-import java.util.Set;
-
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.tracecompass.internal.lttng2.ust.ui.analysis.callstack.LttngUstCallStackAnalysisRequirement;
-import org.eclipse.tracecompass.lttng2.ust.core.trace.LttngUstTrace;
-import org.eclipse.tracecompass.lttng2.ust.core.trace.layout.ILttngUstEventLayout;
-import org.eclipse.tracecompass.tmf.ctf.core.event.CtfTmfEventType;
-import org.junit.Test;
-
-import com.google.common.collect.ImmutableSet;
-
-/**
- * Test the {@link LttngUstCallStackAnalysisRequirement} class
- *
- * @author Bernd Hufmann
- */
-public class LTTngUstCallStackAnalysisRequirementTest {
-
- private static final @NonNull String FUNC_EXIT_FAST = "lttng_ust_cyg_profile_fast:func_exit";
- private static final @NonNull String FUNC_EXIT = "lttng_ust_cyg_profile:func_exit";
- private static final @NonNull String FUNC_ENTRY_FAST = "lttng_ust_cyg_profile_fast:func_entry";
- private static final @NonNull String FUNC_ENTRY = "lttng_ust_cyg_profile:func_entry";
- private static final @NonNull String OTHER_EVENT = "OTHER";
-
- private static final @NonNull String CONTEXT_VTID = "context._vtid";
- private static final @NonNull String CONTEXT_PROCNAME = "context._procname";
- private static final @NonNull String CONTEXT_OTHER = "context._other";
-
- private static final @NonNull Collection<String> validFields = ImmutableSet.of(CONTEXT_VTID, CONTEXT_PROCNAME);
- private static final @NonNull Collection<String> badFields = ImmutableSet.of(CONTEXT_OTHER, CONTEXT_PROCNAME);
-
- enum EventType {
- EVT_EXIT_FAST (FUNC_EXIT_FAST, validFields),
- EVT_EXIT (FUNC_EXIT, validFields),
- EVT_ENTRY_FAST (FUNC_ENTRY_FAST, validFields),
- EVT_ENTRY (FUNC_ENTRY, validFields),
- EVT_OTHER (OTHER_EVENT, validFields),
- EVT_ENTRY_BAD_FIELDS (FUNC_ENTRY, badFields),
- EVT_ENTRY_FAST_BAD_FIELDS (FUNC_ENTRY_FAST, badFields),
- EVT_ENTRY_FAST_EMPTY_FIELDS (FUNC_ENTRY_FAST, ImmutableSet.of());
-
- private final @NonNull CtfTmfEventType fType;
-
- EventType(@NonNull String name, @NonNull Collection<String> fields) {
- fType = new CtfTmfEventType(name, null) {
- @Override
- public String getName() {
- return name;
- }
- @Override
- public @NonNull Collection<String> getFieldNames() {
- return fields;
- }
- };
- }
-
- @NonNull CtfTmfEventType getEventType() {
- return fType;
- }
- }
-
- enum TestData {
- TRACE_WITH_VALID_EVENTS(EventType.EVT_ENTRY, EventType.EVT_EXIT, true),
- TRACE_WITH_VALID_EVENTS_FAST(EventType.EVT_ENTRY_FAST, EventType.EVT_EXIT_FAST, true),
- TRACE_WITH_VALID_EVENTS_MISSING_FIELDS(EventType.EVT_ENTRY_BAD_FIELDS,
- EventType.EVT_EXIT, false),
- TRACE_WITH_VALID_EVENTS_MISSING_FIELDS_FAST(EventType.EVT_ENTRY_FAST_BAD_FIELDS,
- EventType.EVT_EXIT_FAST, false),
- TRACE_WITH_VALID_EVENTS_WRONG_FIELDS(EventType.EVT_ENTRY_FAST_EMPTY_FIELDS,
- EventType.EVT_EXIT_FAST, false),
- TRACE_WITH_MISSING_EVENTS(EventType.EVT_OTHER,
- EventType.EVT_EXIT_FAST, false),
- TRACE_MISMATCH_EVENTS(EventType.EVT_ENTRY_FAST, EventType.EVT_EXIT, false);
-
- private final @NonNull LttngUstTrace fTrace;
- private final boolean fIsValid;
-
- TestData(EventType first, EventType second, boolean isValid) {
- fTrace = new LttngUstTrace() {
- @Override
- public Set<CtfTmfEventType> getContainedEventTypes() {
- return ImmutableSet.of(first.getEventType(), second.getEventType());
- }
- };
- fIsValid = isValid;
- }
-
- @NonNull LttngUstTrace getTrace() {
- return fTrace;
- }
-
- boolean isValid() {
- return fIsValid;
- }
-
- }
-
- /**
- * Test Call Stack Analysis requirements
- */
- @Test
- public void testCallStackRequirements() {
- LttngUstCallStackAnalysisRequirement req = new LttngUstCallStackAnalysisRequirement(ILttngUstEventLayout.DEFAULT_LAYOUT);
- for (TestData item: TestData.values()) {
- assertEquals(item.name(), item.isValid(), req.test(item.getTrace()));
- }
- }
-}
org.eclipse.tracecompass.tmf.ui,
org.eclipse.tracecompass.tmf.ctf.core
Export-Package: org.eclipse.tracecompass.internal.lttng2.ust.ui;x-friends:="org.eclipse.tracecompass.lttng2.ust.ui.tests",
- org.eclipse.tracecompass.internal.lttng2.ust.ui.analysis.callstack;x-friends:="org.eclipse.tracecompass.lttng2.ust.ui.tests",
org.eclipse.tracecompass.internal.lttng2.ust.ui.analysis.debuginfo;x-internal:=true,
org.eclipse.tracecompass.internal.lttng2.ust.ui.views.memusage;x-friends:="org.eclipse.tracecompass.lttng2.ust.ui.tests,org.eclipse.tracecompass.lttng2.ust.ui.swtbot.tests",
org.eclipse.tracecompass.lttng2.ust.ui.analysis.callstack
tracetype.type.ust = LTTng UST Trace
memoryusage.view.name = UST Memory Usage
-
-analysis.callstack = LTTng-UST CallStack
</extension>
<extension
point="org.eclipse.linuxtools.tmf.core.analysis">
- <module
- analysis_module="org.eclipse.tracecompass.lttng2.ust.ui.analysis.callstack.LttngUstCallStackAnalysis"
- automatic="false"
- id="org.eclipse.linuxtools.lttng2.ust.analysis.callstack"
- name="%analysis.callstack">
- <tracetype
- applies="true"
- class="org.eclipse.tracecompass.lttng2.ust.core.trace.LttngUstTrace">
- </tracetype>
- </module>
<output
class="org.eclipse.tracecompass.tmf.ui.analysis.TmfAnalysisViewOutput"
id="org.eclipse.linuxtools.lttng2.ust.memoryusage">
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2016 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.tracecompass.internal.lttng2.ust.ui.analysis.callstack;
-
-import static org.eclipse.tracecompass.common.core.NonNullUtils.nullToEmptyString;
-
-import java.util.Collection;
-import java.util.Set;
-
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.jdt.annotation.NonNullByDefault;
-import org.eclipse.tracecompass.lttng2.ust.core.trace.layout.ILttngUstEventLayout;
-import org.eclipse.tracecompass.tmf.core.analysis.requirements.TmfAbstractAnalysisRequirement;
-import org.eclipse.tracecompass.tmf.core.analysis.requirements.TmfAnalysisEventFieldRequirement;
-import org.eclipse.tracecompass.tmf.core.analysis.requirements.TmfCompositeAnalysisRequirement;
-
-import com.google.common.collect.ImmutableSet;
-
-/**
- * Analysis requirement implementation for LTTng Call Stack Analysis.
- *
- * @author Bernd Hufmann
- *
- */
-@NonNullByDefault
-public class LttngUstCallStackAnalysisRequirement extends TmfCompositeAnalysisRequirement {
-
- /**
- * Constructor
- *
- * @param layout
- * The event layout (non-null)
- */
- public LttngUstCallStackAnalysisRequirement(ILttngUstEventLayout layout) {
- super(getSubRequirements(layout), PriorityLevel.AT_LEAST_ONE);
-
- addInformation(nullToEmptyString(Messages.LttnUstCallStackAnalysisModule_EventsLoadingInformation));
- }
-
- private static Collection<TmfAbstractAnalysisRequirement> getSubRequirements(ILttngUstEventLayout layout) {
- Set<@NonNull String> requiredEventsFields = ImmutableSet.of(
- layout.contextProcname(),
- layout.contextVtid());
-
- // Requirement for the cyg_profile events
- TmfAnalysisEventFieldRequirement entryReq = new TmfAnalysisEventFieldRequirement(
- layout.eventCygProfileFuncEntry(),
- requiredEventsFields,
- PriorityLevel.MANDATORY);
-
- TmfAbstractAnalysisRequirement exitReq = new TmfAnalysisEventFieldRequirement(
- layout.eventCygProfileFuncExit(),
- requiredEventsFields,
- PriorityLevel.MANDATORY);
-
- TmfAbstractAnalysisRequirement cygProfile = new TmfCompositeAnalysisRequirement(ImmutableSet.of(entryReq, exitReq), PriorityLevel.MANDATORY);
-
- // Requirement for the cyg_profile_fast events
- entryReq = new TmfAnalysisEventFieldRequirement(
- layout.eventCygProfileFastFuncEntry(),
- requiredEventsFields,
- PriorityLevel.MANDATORY);
-
- exitReq = new TmfAnalysisEventFieldRequirement(
- layout.eventCygProfileFastFuncExit(),
- requiredEventsFields,
- PriorityLevel.MANDATORY);
- TmfAbstractAnalysisRequirement cygProfileFast = new TmfCompositeAnalysisRequirement(ImmutableSet.of(entryReq, exitReq), PriorityLevel.MANDATORY);
-
- return ImmutableSet.of(cygProfile, cygProfileFast);
- }
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2016 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.tracecompass.internal.lttng2.ust.ui.analysis.callstack;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Message bundle for the call stack analysis module
- *
- * @author Sonia Farrah
- */
-
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.tracecompass.internal.lttng2.ust.ui.analysis.callstack.messages"; //$NON-NLS-1$
-
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- /** Information regarding events loading prior to the analysis execution */
- public static String LttnUstCallStackAnalysisModule_EventsLoadingInformation;
-
- private Messages() {
- }
-}
+++ /dev/null
-###############################################################################
-# Copyright (c) 2016 Ericsson
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Ericsson - Initial API and implementation
-###############################################################################
-LttnUstCallStackAnalysisModule_EventsLoadingInformation=Add the ''vtid'' and ''procname'' contexts to your trace session. \n\
-Preload the ''liblttng-ust-cyg-profile'' library when running your program: \n\
-LD_PRELOAD=/usr/lib/liblttng-ust-cyg-profile.so ./myprogram
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
+import org.eclipse.tracecompass.internal.lttng2.ust.core.callstack.LttngUstCallStackAnalysisRequirement;
import org.eclipse.tracecompass.internal.lttng2.ust.core.callstack.LttngUstCallStackProvider;
-import org.eclipse.tracecompass.internal.lttng2.ust.ui.analysis.callstack.LttngUstCallStackAnalysisRequirement;
import org.eclipse.tracecompass.lttng2.ust.core.trace.LttngUstTrace;
import org.eclipse.tracecompass.lttng2.ust.core.trace.layout.ILttngUstEventLayout;
import org.eclipse.tracecompass.tmf.core.analysis.requirements.TmfAbstractAnalysisRequirement;
* events.
*
* @author Alexandre Montplaisir
+ * @deprecated This analysis was moved to core as
+ * {@link org.eclipse.tracecompass.internal.lttng2.ust.core.callstack.LttngUstCallStackAnalysis}
+ * and is now internal
*/
+@Deprecated
public class LttngUstCallStackAnalysis extends AbstractCallStackAnalysis {
/**
id="org.eclipse.linuxtools.tmf.core.statistics.analysis">
</analysisId>
</output>
+ <listener
+ class="org.eclipse.tracecompass.tmf.ui.views.callstack.CallStackAnalysisListener">
+ </listener>
</extension>
<extension
point="org.eclipse.linuxtools.tmf.ui.tracetypeui">
* The base classes for analyses who want to populate the CallStack View.
*
* @author Alexandre Montplaisir
+ * @deprecated Use the {@link CallStackAnalysis} from the core plugins instead
+ * of this class which was there only to register the view as output
*/
-/*
- * FIXME: deprecate at next release when we can move the callstack view to an
- * extension point
- */
+@Deprecated
@NonNullByDefault
public abstract class AbstractCallStackAnalysis extends CallStackAnalysis {
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2016 École Polytechnique de Montréal
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.tmf.ui.views.callstack;
+
+import org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule;
+import org.eclipse.tracecompass.tmf.core.analysis.ITmfNewAnalysisModuleListener;
+import org.eclipse.tracecompass.tmf.core.callstack.CallStackAnalysis;
+import org.eclipse.tracecompass.tmf.ui.analysis.TmfAnalysisViewOutput;
+
+/**
+ * Registers the {@link CallStackView} to {@link CallStackAnalysis}. The
+ * analysis being an abstract class, it is not possible to use the output
+ * extension to add the view, but the listener fixes the issue.
+ *
+ * @author Geneviève Bastien
+ * @since 2.1
+ */
+public class CallStackAnalysisListener implements ITmfNewAnalysisModuleListener {
+
+ @Override
+ public void moduleCreated(IAnalysisModule module) {
+ if (module instanceof CallStackAnalysis) {
+ module.registerOutput(new TmfAnalysisViewOutput(CallStackView.ID));
+ }
+ }
+
+}
import org.eclipse.tracecompass.statesystem.core.interval.ITmfStateInterval;
import org.eclipse.tracecompass.statesystem.core.statevalue.ITmfStateValue;
import org.eclipse.tracecompass.statesystem.core.statevalue.ITmfStateValue.Type;
+import org.eclipse.tracecompass.tmf.core.callstack.CallStackAnalysis;
import org.eclipse.tracecompass.tmf.core.signal.TmfSelectionRangeUpdatedSignal;
import org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler;
import org.eclipse.tracecompass.tmf.core.signal.TmfTraceClosedSignal;
}
/* Continue with the call stack view specific operations */
- AbstractCallStackAnalysis module = getCallStackModule(trace);
+ CallStackAnalysis module = getCallStackModule(trace);
if (module == null) {
addUnavailableEntry(trace, parentTrace);
return;
return fPrevEventAction;
}
- private static @Nullable AbstractCallStackAnalysis getCallStackModule(@NonNull ITmfTrace trace) {
+ private static @Nullable CallStackAnalysis getCallStackModule(@NonNull ITmfTrace trace) {
/*
* Since we cannot know the exact analysis ID (in separate plugins), we
* will search using the analysis type.
*/
- Iterable<AbstractCallStackAnalysis> modules =
- TmfTraceUtils.getAnalysisModulesOfClass(trace, AbstractCallStackAnalysis.class);
- Iterator<AbstractCallStackAnalysis> it = modules.iterator();
+ Iterable<CallStackAnalysis> modules =
+ TmfTraceUtils.getAnalysisModulesOfClass(trace, CallStackAnalysis.class);
+ Iterator<CallStackAnalysis> it = modules.iterator();
if (!it.hasNext()) {
/* This trace does not provide a call-stack analysis */
return null;
* TODO Handle the advanced case where one trace provides more than one
* call-stack analysis.
*/
- AbstractCallStackAnalysis module = it.next();
+ CallStackAnalysis module = it.next();
/* This analysis is not automatic, we need to schedule it on-demand */
module.schedule();
if (!module.waitForInitialization()) {