From 6f40b641a0dda7baf779beb8b47026c6a8174ca4 Mon Sep 17 00:00:00 2001 From: Bernd Hufmann Date: Mon, 9 Feb 2015 11:17:58 -0500 Subject: [PATCH] control: display file rotation properties (Bug: 459483) Change-Id: I7f15d718de92fbd60357600ecd3c49b68fd727a3 Signed-off-by: Bernd Hufmann Reviewed-on: https://git.eclipse.org/r/41535 Reviewed-by: Hudson CI Reviewed-by: Patrick Tasse Tested-by: Patrick Tasse Reviewed-by: Bernd Hufmann --- .../tests/model/impl/ChannelInfoTest.java | 4 +- .../control/core/model/IChannelInfo.java | 4 +- .../control/core/model/impl/ChannelInfo.java | 8 +-- .../component/TraceControlPropertiesTest.java | 4 +- .../testfiles/ListInfoTest.cfg | 8 ++- .../control/ui/views/messages/Messages.java | 4 +- .../ui/views/messages/messages.properties | 4 +- .../views/model/impl/TargetNodeComponent.java | 10 ++++ .../model/impl/TraceChannelComponent.java | 15 +++++- .../property/TraceChannelPropertySource.java | 52 +++++++++++++++---- .../ui/views/service/LTTngControlService.java | 9 ++++ .../service/LTTngControlServiceConstants.java | 8 +++ .../views/service/LTTngControlServiceMI.java | 2 +- 13 files changed, 106 insertions(+), 26 deletions(-) diff --git a/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/tracecompass/lttng2/control/core/tests/model/impl/ChannelInfoTest.java b/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/tracecompass/lttng2/control/core/tests/model/impl/ChannelInfoTest.java index 14606fe7b3..0e3b24728e 100644 --- a/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/tracecompass/lttng2/control/core/tests/model/impl/ChannelInfoTest.java +++ b/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/tracecompass/lttng2/control/core/tests/model/impl/ChannelInfoTest.java @@ -1,5 +1,5 @@ /********************************************************************** - * Copyright (c) 2012, 2014 Ericsson + * Copyright (c) 2012, 2015 Ericsson * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v1.0 which @@ -192,7 +192,7 @@ public class ChannelInfoTest { long subBufferSize = fixture.getSubBufferSize(); assertEquals(1L, subBufferSize); - int maxSizeTraceFiles = fixture.getMaxSizeTraceFiles(); + long maxSizeTraceFiles = fixture.getMaxSizeTraceFiles(); assertEquals(1024, maxSizeTraceFiles); int maxNumberTraceFiles = fixture.getMaxNumberTraceFiles(); diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/tracecompass/internal/lttng2/control/core/model/IChannelInfo.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/tracecompass/internal/lttng2/control/core/model/IChannelInfo.java index 7867841193..6291f6bc04 100644 --- a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/tracecompass/internal/lttng2/control/core/model/IChannelInfo.java +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/tracecompass/internal/lttng2/control/core/model/IChannelInfo.java @@ -131,7 +131,7 @@ public interface IChannelInfo extends ITraceInfo { * Sets the maximum size of trace files * @param maxSizeTraceFiles - maximum size */ - void setMaxSizeTraceFiles(int maxSizeTraceFiles); + void setMaxSizeTraceFiles(long maxSizeTraceFiles); /** * Sets the maximum number of trace files * @param maxNumberTraceFiles - maximum number @@ -140,7 +140,7 @@ public interface IChannelInfo extends ITraceInfo { /** * @return maximum size of trace files */ - int getMaxSizeTraceFiles(); + long getMaxSizeTraceFiles(); /** * @return maximum number of trace files */ diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/tracecompass/internal/lttng2/control/core/model/impl/ChannelInfo.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/tracecompass/internal/lttng2/control/core/model/impl/ChannelInfo.java index 85aabde44d..e588100394 100644 --- a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/tracecompass/internal/lttng2/control/core/model/impl/ChannelInfo.java +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/tracecompass/internal/lttng2/control/core/model/impl/ChannelInfo.java @@ -1,5 +1,5 @@ /********************************************************************** - * Copyright (c) 2012, 2014 Ericsson + * Copyright (c) 2012, 2015 Ericsson * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v1.0 which @@ -68,7 +68,7 @@ public class ChannelInfo extends TraceInfo implements IChannelInfo { /** * The maximum size of trace files */ - private int fMaxSizeTraceFiles; + private long fMaxSizeTraceFiles; /** * The maximum number of trace files */ @@ -322,7 +322,7 @@ public class ChannelInfo extends TraceInfo implements IChannelInfo { } @Override - public void setMaxSizeTraceFiles(int maxSizeTraceFiles) { + public void setMaxSizeTraceFiles(long maxSizeTraceFiles) { fMaxSizeTraceFiles = maxSizeTraceFiles; } @@ -332,7 +332,7 @@ public class ChannelInfo extends TraceInfo implements IChannelInfo { } @Override - public int getMaxSizeTraceFiles() { + public long getMaxSizeTraceFiles() { return fMaxSizeTraceFiles; } diff --git a/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/TraceControlPropertiesTest.java b/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/TraceControlPropertiesTest.java index ca5eae54da..a33f2ea9f9 100644 --- a/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/TraceControlPropertiesTest.java +++ b/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/TraceControlPropertiesTest.java @@ -127,7 +127,7 @@ public class TraceControlPropertiesTest { assertEquals("myNode", source.getPropertyValue(TargetNodePropertySource.TARGET_NODE_NAME_PROPERTY_ID)); assertEquals("localhost", source.getPropertyValue(TargetNodePropertySource.TARGET_NODE_ADDRESS_PROPERTY_ID)); assertEquals(TargetNodeState.CONNECTED.name(), source.getPropertyValue(TargetNodePropertySource.TARGET_NODE_STATE_PROPERTY_ID)); - assertEquals("2.1.0", source.getPropertyValue(TargetNodePropertySource.TARGET_NODE_VERSION_PROPERTY_ID)); + assertEquals("2.5.0", source.getPropertyValue(TargetNodePropertySource.TARGET_NODE_VERSION_PROPERTY_ID)); assertNull(source.getPropertyValue("test")); adapter = node.getAdapter(IChannelInfo.class); @@ -265,6 +265,8 @@ public class TraceControlPropertiesTest { assertEquals(String.valueOf(200), channelSource.getPropertyValue(TraceChannelPropertySource.TRACE_CHANNEL_READ_TIMER_PROPERTY_ID)); assertEquals(String.valueOf(262144), channelSource.getPropertyValue(TraceChannelPropertySource.TRACE_CHANNEL_SUBBUFFER_SIZE_PROPERTY_ID)); assertEquals(String.valueOf(0), channelSource.getPropertyValue(TraceChannelPropertySource.TRACE_CHANNEL_SWITCH_TIMER_PROPERTY_ID)); + assertEquals(Integer.valueOf(2), channelSource.getPropertyValue(TraceChannelPropertySource.TRACE_CHANNEL_TRACE_FILE_COUNT_PROPERTY_ID)); + assertEquals(Long.valueOf(262144), channelSource.getPropertyValue(TraceChannelPropertySource.TRACE_CHANNEL_TRACE_FILE_SIZE_PROPERTY_ID)); // ------------------------------------------------------------------------ // Verify Event Properties (adapter) diff --git a/org.eclipse.tracecompass.lttng2.control.ui.tests/testfiles/ListInfoTest.cfg b/org.eclipse.tracecompass.lttng2.control.ui.tests/testfiles/ListInfoTest.cfg index 6c28ba18dd..95d3b52780 100644 --- a/org.eclipse.tracecompass.lttng2.control.ui.tests/testfiles/ListInfoTest.cfg +++ b/org.eclipse.tracecompass.lttng2.control.ui.tests/testfiles/ListInfoTest.cfg @@ -1,5 +1,5 @@ #################################################################### -# Copyright (c) 2012 Ericsson +# Copyright (c) 2012, 2015 Ericsson # # All rights reserved. This program and the accompanying materials are # made available under the terms of the Eclipse Public License v1.0 which @@ -22,7 +22,7 @@ lttng version 0 -lttng version 2.1.0 - Basse Messe +lttng version 2.5.0 - 20120129-084256 Web site: http://lttng.org/ lttng is free software and under the GPL license and part LGPL @@ -64,6 +64,8 @@ Channels: number of subbufers: 4 switch timer interval: 0 read timer interval: 200 + trace file count: 2 + trace file size (bytes): 262144 output: splice() Events: @@ -101,6 +103,8 @@ Channels: number of subbufers: 8 switch timer interval: 200 read timer interval: 100 + trace file count: 2 + trace file size (bytes): 8192 output: mmap() Events: diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/messages/Messages.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/messages/Messages.java index 578915b001..5944aba3b8 100644 --- a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/messages/Messages.java +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/messages/Messages.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2012, 2014 Ericsson + * Copyright (c) 2012, 2015 Ericsson * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v1.0 which @@ -298,6 +298,8 @@ public final class Messages extends NLS { public static String TraceControl_SwitchTimerPropertyName; public static String TraceControl_ReadTimerPropertyName; public static String TraceControl_OutputTypePropertyName; + public static String TraceControl_TraceFileCountPropertyName; + public static String TraceControl_TraceFileSizePropertyName; public static String TraceControl_HostNamePropertyName; public static String TraceControl_HostAddressPropertyName; public static String TraceControl_SessionPathPropertyName; diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/messages/messages.properties b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/messages/messages.properties index 5fe9132829..7ac5155160 100644 --- a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/messages/messages.properties +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/messages/messages.properties @@ -1,5 +1,5 @@ ############################################################################### -# Copyright (c) 2012, 2014 Ericsson. +# Copyright (c) 2012, 2015 Ericsson. # # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 @@ -284,6 +284,8 @@ TraceControl_NbSubBuffersPropertyName=Number of Sub Buffers TraceControl_SwitchTimerPropertyName=Switch Timer Interval TraceControl_ReadTimerPropertyName=Read Timer Interval TraceControl_OutputTypePropertyName=Output Type +TraceControl_TraceFileCountPropertyName=Trace File Count +TraceControl_TraceFileSizePropertyName=Trace File Size TraceControl_HostNamePropertyName=Connection Name TraceControl_HostAddressPropertyName=Host Name TraceControl_SessionPathPropertyName=Session Path diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/model/impl/TargetNodeComponent.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/model/impl/TargetNodeComponent.java index f4bb15a6a8..9cd28c123c 100644 --- a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/model/impl/TargetNodeComponent.java +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/model/impl/TargetNodeComponent.java @@ -284,6 +284,16 @@ public class TargetNodeComponent extends TraceControlComponent implements IRemot return !getControlService().isVersionSupported("2.2.0"); //$NON-NLS-1$ } + /** + * Checks if given version is supported by this ILTTngControlService implementation. + * + * @param version The version to check + * @return true if version is supported else false + */ + public boolean isVersionSupported(String version) { + return getControlService().isVersionSupported(version); + } + // ------------------------------------------------------------------------ // Operations // ------------------------------------------------------------------------ diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/model/impl/TraceChannelComponent.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/model/impl/TraceChannelComponent.java index 6dc0ea638e..bfdf766a94 100644 --- a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/model/impl/TraceChannelComponent.java +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/model/impl/TraceChannelComponent.java @@ -1,5 +1,5 @@ /********************************************************************** - * Copyright (c) 2012, 2014 Ericsson + * Copyright (c) 2012, 2015 Ericsson * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v1.0 which @@ -230,6 +230,19 @@ public class TraceChannelComponent extends TraceControlComponent { fChannelInfo.setState(stateName); } + /** + * @return maximum size of trace files + */ + public long getMaxSizeTraceFiles() { + return fChannelInfo.getMaxSizeTraceFiles(); + } + /** + * @return maximum number of trace files + */ + public int getMaxNumberTraceFiles() { + return fChannelInfo.getMaxNumberTraceFiles(); + } + @Override public Object getAdapter(Class adapter) { if (adapter == IPropertySource.class) { diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/property/TraceChannelPropertySource.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/property/TraceChannelPropertySource.java index 1e999ca631..786c1cea56 100644 --- a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/property/TraceChannelPropertySource.java +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/property/TraceChannelPropertySource.java @@ -1,5 +1,5 @@ /********************************************************************** - * Copyright (c) 2012, 2014 Ericsson + * Copyright (c) 2012, 2015 Ericsson * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v1.0 which @@ -11,6 +11,9 @@ **********************************************************************/ package org.eclipse.tracecompass.internal.lttng2.control.ui.views.property; +import java.util.ArrayList; +import java.util.List; + import org.eclipse.tracecompass.internal.lttng2.control.ui.views.messages.Messages; import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent; import org.eclipse.tracecompass.tmf.ui.properties.ReadOnlyTextPropertyDescriptor; @@ -60,6 +63,14 @@ public class TraceChannelPropertySource extends BasePropertySource { * The trace channel 'output type' property ID. */ public static final String TRACE_CHANNEL_OUTPUT_TYPE_PROPERTY_ID = "trace.channel.output.type"; //$NON-NLS-1$ + /** + * The trace channel 'trace file count' property ID. + */ + public static final String TRACE_CHANNEL_TRACE_FILE_COUNT_PROPERTY_ID = "trace.channel.trace.file.count"; //$NON-NLS-1$ + /** + * The trace channel 'trace file size' property ID. + */ + public static final String TRACE_CHANNEL_TRACE_FILE_SIZE_PROPERTY_ID = "trace.channel.trace.file.size"; //$NON-NLS-1$ /** * The trace channel 'name' property name. */ @@ -92,8 +103,15 @@ public class TraceChannelPropertySource extends BasePropertySource { * The trace channel 'output type' property name. */ public static final String TRACE_CHANNEL_OUTPUT_TYPEPROPERTY_NAME = Messages.TraceControl_OutputTypePropertyName; + /** + * The trace channel 'trace file count' property name. + */ + public static final String TRACE_CHANNEL_TRACE_FILE_COUNT_PROPERTY_NAME = Messages.TraceControl_TraceFileCountPropertyName; + /** + * The trace channel 'trace file size' property name. + */ + public static final String TRACE_CHANNEL_TRACE_FILE_SIZE_PROPERTY_NAME = Messages.TraceControl_TraceFileSizePropertyName; - // ------------------------------------------------------------------------ // Attributes // ------------------------------------------------------------------------ /** @@ -118,15 +136,21 @@ public class TraceChannelPropertySource extends BasePropertySource { @Override public IPropertyDescriptor[] getPropertyDescriptors() { - return new IPropertyDescriptor[] { - new ReadOnlyTextPropertyDescriptor(TRACE_CHANNEL_NAME_PROPERTY_ID, TRACE_CHANNEL_NAME_PROPERTY_NAME), - new ReadOnlyTextPropertyDescriptor(TRACE_CHANNEL_STATE_PROPERTY_ID, TRACE_CHANNEL_STATE_PROPERTY_NAME), - new ReadOnlyTextPropertyDescriptor(TRACE_CHANNEL_OVERWRITE_MODE_PROPERTY_ID, TRACE_CHANNEL_OVERWRITE_MODE_PROPERTY_NAME), - new ReadOnlyTextPropertyDescriptor(TRACE_CHANNEL_SUBBUFFER_SIZE_PROPERTY_ID, TRACE_CHANNEL_SUBBUFFER_SIZE_PROPERTY_NAME), - new ReadOnlyTextPropertyDescriptor(TRACE_CHANNEL_NO_SUBBUFFERS_PROPERTY_ID, TRACE_CHANNEL_NO_SUBBUFFERS_PROPERTY_NAME), - new ReadOnlyTextPropertyDescriptor(TRACE_CHANNEL_SWITCH_TIMER_PROPERTY_ID, TRACE_CHANNEL_SWITCH_TIMER_PROPERTY_NAME), - new ReadOnlyTextPropertyDescriptor(TRACE_CHANNEL_READ_TIMER_PROPERTY_ID, TRACE_CHANNEL_READ_TIMER_PROPERTY_NAME), - new ReadOnlyTextPropertyDescriptor(TRACE_CHANNEL_OUTPUT_TYPE_PROPERTY_ID, TRACE_CHANNEL_OUTPUT_TYPEPROPERTY_NAME)}; + List properties = new ArrayList<>(); + properties.add(new ReadOnlyTextPropertyDescriptor(TRACE_CHANNEL_NAME_PROPERTY_ID, TRACE_CHANNEL_NAME_PROPERTY_NAME)); + properties.add(new ReadOnlyTextPropertyDescriptor(TRACE_CHANNEL_STATE_PROPERTY_ID, TRACE_CHANNEL_STATE_PROPERTY_NAME)); + properties.add(new ReadOnlyTextPropertyDescriptor(TRACE_CHANNEL_OVERWRITE_MODE_PROPERTY_ID, TRACE_CHANNEL_OVERWRITE_MODE_PROPERTY_NAME)); + properties.add(new ReadOnlyTextPropertyDescriptor(TRACE_CHANNEL_SUBBUFFER_SIZE_PROPERTY_ID, TRACE_CHANNEL_SUBBUFFER_SIZE_PROPERTY_NAME)); + properties.add(new ReadOnlyTextPropertyDescriptor(TRACE_CHANNEL_NO_SUBBUFFERS_PROPERTY_ID, TRACE_CHANNEL_NO_SUBBUFFERS_PROPERTY_NAME)); + properties.add(new ReadOnlyTextPropertyDescriptor(TRACE_CHANNEL_SWITCH_TIMER_PROPERTY_ID, TRACE_CHANNEL_SWITCH_TIMER_PROPERTY_NAME)); + properties.add(new ReadOnlyTextPropertyDescriptor(TRACE_CHANNEL_READ_TIMER_PROPERTY_ID, TRACE_CHANNEL_READ_TIMER_PROPERTY_NAME)); + properties.add(new ReadOnlyTextPropertyDescriptor(TRACE_CHANNEL_OUTPUT_TYPE_PROPERTY_ID, TRACE_CHANNEL_OUTPUT_TYPEPROPERTY_NAME)); + + if (fChannel.getTargetNode().isVersionSupported("2.5.0")) { //$NON-NLS-1$ + properties.add(new ReadOnlyTextPropertyDescriptor(TRACE_CHANNEL_TRACE_FILE_COUNT_PROPERTY_ID, TRACE_CHANNEL_TRACE_FILE_COUNT_PROPERTY_NAME)); + properties.add(new ReadOnlyTextPropertyDescriptor(TRACE_CHANNEL_TRACE_FILE_SIZE_PROPERTY_ID, TRACE_CHANNEL_TRACE_FILE_SIZE_PROPERTY_NAME)); + } + return properties.toArray(new IPropertyDescriptor[0]); } @Override @@ -155,6 +179,12 @@ public class TraceChannelPropertySource extends BasePropertySource { if(TRACE_CHANNEL_OUTPUT_TYPE_PROPERTY_ID.equals(id)) { return fChannel.getOutputType().getInName(); } + if (TRACE_CHANNEL_TRACE_FILE_COUNT_PROPERTY_ID.equals(id)) { + return fChannel.getMaxNumberTraceFiles(); + } + if (TRACE_CHANNEL_TRACE_FILE_SIZE_PROPERTY_ID.equals(id)) { + return fChannel.getMaxSizeTraceFiles(); + } return null; } diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/service/LTTngControlService.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/service/LTTngControlService.java index 763ab23a09..ba3f32317f 100644 --- a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/service/LTTngControlService.java +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/service/LTTngControlService.java @@ -1192,6 +1192,15 @@ public class LTTngControlService implements ILttngControlService { channelInfo.setOutputType(getAttributeValue(subLine)); } + } else if (LTTngControlServiceConstants.TRACE_FILE_COUNT_ATTRIBUTE.matcher(subLine).matches()) { + if (channelInfo != null) { + channelInfo.setMaxNumberTraceFiles(Integer.valueOf(getAttributeValue(subLine))); + } + + } else if (LTTngControlServiceConstants.TRACE_FILE_SIZE_ATTRIBUTE.matcher(subLine).matches()) { + if (channelInfo != null) { + channelInfo.setMaxSizeTraceFiles(Long.valueOf(getAttributeValue(subLine))); + } } else if (LTTngControlServiceConstants.EVENT_SECTION_PATTERN.matcher(subLine).matches()) { List events = new ArrayList<>(); index = parseEvents(output, index, events); diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/service/LTTngControlServiceConstants.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/service/LTTngControlServiceConstants.java index 30510c6f26..0355552f6e 100644 --- a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/service/LTTngControlServiceConstants.java +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/service/LTTngControlServiceConstants.java @@ -409,6 +409,14 @@ public interface LTTngControlServiceConstants { * Pattern to match for channel (output type) information (lttng list ) */ Pattern OUTPUT_ATTRIBUTE = checkNotNull(Pattern.compile("\\s+output\\:.*")); //$NON-NLS-1$ + /** + * Pattern to match for channel (trace file size) information (lttng list ) + */ + Pattern TRACE_FILE_COUNT_ATTRIBUTE = Pattern.compile("\\s+trace\\s+file\\s+count\\:.*"); //$NON-NLS-1$ + /** + * Pattern to match for channel (trace file size) information (lttng list ) + */ + Pattern TRACE_FILE_SIZE_ATTRIBUTE = Pattern.compile("\\s+trace\\s+file\\s+size\\s+\\(bytes\\)\\:.*"); //$NON-NLS-1$ /** * Pattern to match for provider information (lttng list -k/-u) */ diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/service/LTTngControlServiceMI.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/service/LTTngControlServiceMI.java index 6db159ee10..d7e1e7aca1 100644 --- a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/service/LTTngControlServiceMI.java +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/service/LTTngControlServiceMI.java @@ -446,7 +446,7 @@ public class LTTngControlServiceMI extends LTTngControlService { channel.setOutputType(attribute.getTextContent()); break; case MIStrings.TRACEFILE_SIZE: - channel.setMaxSizeTraceFiles(Integer.parseInt(attribute.getTextContent())); + channel.setMaxSizeTraceFiles(Long.parseLong(attribute.getTextContent())); break; case MIStrings.TRACEFILE_COUNT: channel.setMaxNumberTraceFiles(Integer.parseInt(attribute.getTextContent())); -- 2.34.1