| 1 | /********************************************************************** |
| 2 | * Copyright (c) 2012 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 | * Contributors: |
| 10 | * Bernd Hufmann - Initial API and implementation |
| 11 | **********************************************************************/ |
| 12 | package org.eclipse.linuxtools.lttng.ui.views.control.service; |
| 13 | |
| 14 | import java.util.List; |
| 15 | |
| 16 | import org.eclipse.core.commands.ExecutionException; |
| 17 | import org.eclipse.core.runtime.IProgressMonitor; |
| 18 | import org.eclipse.linuxtools.lttng.ui.views.control.model.IBaseEventInfo; |
| 19 | import org.eclipse.linuxtools.lttng.ui.views.control.model.IChannelInfo; |
| 20 | import org.eclipse.linuxtools.lttng.ui.views.control.model.ISessionInfo; |
| 21 | import org.eclipse.linuxtools.lttng.ui.views.control.model.IUstProviderInfo; |
| 22 | import org.eclipse.linuxtools.lttng.ui.views.control.model.LogLevelType; |
| 23 | import org.eclipse.linuxtools.lttng.ui.views.control.model.TraceLogLevel; |
| 24 | |
| 25 | |
| 26 | /** <b><u>ILttngControlService</u></b> |
| 27 | * <p> |
| 28 | * Interface for LTTng trace control command service. |
| 29 | * </p> |
| 30 | */ |
| 31 | public interface ILttngControlService { |
| 32 | /** |
| 33 | * Retrieves the existing sessions names from the node. |
| 34 | * @param monitor - a progress monitor |
| 35 | * @return an array with session names. |
| 36 | * @throws ExecutionException |
| 37 | */ |
| 38 | public String[] getSessionNames(IProgressMonitor monitor) throws ExecutionException; |
| 39 | |
| 40 | /** |
| 41 | * Retrieves the session information with the given name the node. |
| 42 | * @param sessionName - the session name |
| 43 | * @param monitor - a progress monitor |
| 44 | * @return session information |
| 45 | * @throws ExecutionException |
| 46 | */ |
| 47 | public ISessionInfo getSession(String sessionName, IProgressMonitor monitor) throws ExecutionException; |
| 48 | |
| 49 | /** |
| 50 | * Retrieves the kernel provider information (i.e. the kernel events) |
| 51 | * @param monitor - a progress monitor |
| 52 | * @return the list of existing kernel events. |
| 53 | * @throws ExecutionException |
| 54 | */ |
| 55 | public List<IBaseEventInfo> getKernelProvider(IProgressMonitor monitor) throws ExecutionException; |
| 56 | |
| 57 | /** |
| 58 | * Retrieves the UST provider information from the node. |
| 59 | * @return - the UST provider information. |
| 60 | * @throws ExecutionException |
| 61 | */ |
| 62 | public List<IUstProviderInfo> getUstProvider() throws ExecutionException; |
| 63 | /** |
| 64 | * Retrieves the UST provider information from the node. |
| 65 | * @param monitor - a progress monitor |
| 66 | * @return the UST provider information. |
| 67 | * @throws ExecutionException |
| 68 | */ |
| 69 | public List<IUstProviderInfo> getUstProvider(IProgressMonitor monitor) throws ExecutionException; |
| 70 | |
| 71 | /** |
| 72 | * Creates a session with given session name and location. |
| 73 | * @param sessionName - a session name to create |
| 74 | * @param sessionPath - a path for storing the traces (use null for default) |
| 75 | * @param monitor - a progress monitor |
| 76 | * @return the session information |
| 77 | * @throws ExecutionException |
| 78 | */ |
| 79 | public ISessionInfo createSession(String sessionName, String sessionPath, IProgressMonitor monitor) throws ExecutionException; |
| 80 | |
| 81 | /** |
| 82 | * Destroys a session with given session name. |
| 83 | * @param sessionName - a session name to destroy |
| 84 | * @param monitor - a progress monitor |
| 85 | * @throws ExecutionException |
| 86 | */ |
| 87 | public void destroySession(String sessionName, IProgressMonitor monitor) throws ExecutionException; |
| 88 | |
| 89 | /** |
| 90 | * Starts a session with given session name. |
| 91 | * @param sessionName - a session name to start |
| 92 | * @param monitor - a progress monitor |
| 93 | * @throws ExecutionException |
| 94 | */ |
| 95 | public void startSession(String sessionName, IProgressMonitor monitor) throws ExecutionException; |
| 96 | |
| 97 | /** |
| 98 | * Stops a session with given session name. |
| 99 | * @param sessionName - a session name to stop |
| 100 | * @param monitor - a progress monitor |
| 101 | * @throws ExecutionException |
| 102 | */ |
| 103 | public void stopSession(String sessionName, IProgressMonitor monitor) throws ExecutionException; |
| 104 | |
| 105 | |
| 106 | /** |
| 107 | * Enables a list of channels for given session and given channel information (configuration). |
| 108 | * @param sessionName - a session name to create |
| 109 | * @param channelNames - a list of channel names to be enabled |
| 110 | * @param isKernel - a flag to indicate Kernel or UST (true for Kernel, false for UST) |
| 111 | * @param info - channel information used for creation of a channel (or null for default) |
| 112 | * @param monitor - a progress monitor |
| 113 | * @throws ExecutionException |
| 114 | */ |
| 115 | public void enableChannels(String sessionName, List<String> channelNames, boolean isKernel, IChannelInfo info, IProgressMonitor monitor) throws ExecutionException; |
| 116 | |
| 117 | /** |
| 118 | * Disables a list of channels for given session and given channel information (configuration). |
| 119 | * @param sessionName - a session name to create |
| 120 | * @param channelNames - a list of channel names to be enabled |
| 121 | * @param isKernel - a flag to indicate Kernel or UST (true for Kernel, false for UST) |
| 122 | * @param monitor - a progress monitor |
| 123 | * @throws ExecutionException |
| 124 | */ |
| 125 | public void disableChannels(String sessionName, List<String> channelNames, boolean isKernel, IProgressMonitor monitor) throws ExecutionException; |
| 126 | |
| 127 | /** |
| 128 | * Enables a list of events with no additional parameters. |
| 129 | * @param sessionName - a session name |
| 130 | * @param channelName - a channel name or null for default channel |
| 131 | * @param eventNames - a list of event names to be enabled, or null (list of size = 0)for all events . |
| 132 | * @param isKernel - a flag for indicating kernel or UST. |
| 133 | * @param monitor - a progress monitor |
| 134 | * @throws ExecutionException |
| 135 | */ |
| 136 | public void enableEvents(String sessionName, String channelName, List<String> eventNames, boolean isKernel, IProgressMonitor monitor) throws ExecutionException; |
| 137 | |
| 138 | /** |
| 139 | * Enables all syscall events. |
| 140 | * @param sessionName - a session name |
| 141 | * @param channelName - a channel name or null for default channel |
| 142 | * @param monitor - a progress monitor |
| 143 | * @throws ExecutionException |
| 144 | */ |
| 145 | public void enableSyscalls(String sessionName, String channelName, IProgressMonitor monitor) throws ExecutionException; |
| 146 | |
| 147 | /** |
| 148 | * Enables a dynamic probe or dynamic function entry/return probe. |
| 149 | * @param sessionName - a session name |
| 150 | * @param channelName - a channel name or null for default channel |
| 151 | * @param eventName - a event name |
| 152 | * @param isFunction - true for dynamic function entry/return probe else false |
| 153 | * @param probe - a dynamic probe information |
| 154 | * @param monitor - a progress monitor |
| 155 | * @throws ExecutionException |
| 156 | */ |
| 157 | public void enableProbe(String sessionName, String channelName, String eventName, boolean isFunction, String probe, IProgressMonitor monitor) throws ExecutionException; |
| 158 | |
| 159 | /** |
| 160 | * Enables events using log level |
| 161 | * @param sessionName - a session name |
| 162 | * @param channelName - a channel name (null for default channel) |
| 163 | * @param eventName - a event name |
| 164 | * @param logLevelType - a log level type |
| 165 | * @param level - a log level |
| 166 | * @param monitor - a progress monitor |
| 167 | * @throws ExecutionException |
| 168 | */ |
| 169 | public void enableLogLevel(String sessionName, String channelName, String eventName, LogLevelType logLevelType, TraceLogLevel level, IProgressMonitor monitor) throws ExecutionException; |
| 170 | |
| 171 | /** |
| 172 | * Disables a list of events with no additional parameters. |
| 173 | * @param sessionName - a session name |
| 174 | * @param channelName - a channel name (null for default channel) |
| 175 | * @param eventNames - a list of event names to enabled. |
| 176 | * @param isKernel - a flag for indicating kernel or UST. |
| 177 | * @param monitor - a progress monitor |
| 178 | * @throws ExecutionException |
| 179 | */ |
| 180 | public void disableEvent(String sessionName, String channelName, List<String> eventNames, boolean isKernel, IProgressMonitor monitor) throws ExecutionException; |
| 181 | |
| 182 | } |