org.eclipse.tracecompass.analysis.os.linux.ui.views.cpuusage,
org.eclipse.tracecompass.analysis.os.linux.ui.views.resources,
org.eclipse.tracecompass.internal.analysis.os.linux.ui;x-internal:=true,
- org.eclipse.tracecompass.internal.analysis.os.linux.ui.views.latency;x-internal:=true
+ org.eclipse.tracecompass.internal.analysis.os.linux.ui.views.latency;x-internal:=true,
+ org.eclipse.tracecompass.internal.analysis.os.linux.ui.views.resources;x-internal:=true
package org.eclipse.tracecompass.analysis.os.linux.ui.views.resources;
import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.tracecompass.internal.analysis.os.linux.ui.views.resources.SoftIrqLabelProvider;
import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.ITimeGraphEntry;
import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.TimeGraphEntry;
*/
public ResourcesEntry(int quark, @NonNull ITmfTrace trace,
long startTime, long endTime, Type type, int id) {
- this(quark, trace, type.toString() + " " + id, startTime, endTime, type, id); //$NON-NLS-1$
+ this(quark, trace, computeEntryName(type, id), startTime, endTime, type, id);
+ }
+
+ private static String computeEntryName(Type type, int id) {
+ if (Type.SOFT_IRQ.equals(type)) {
+ return type.toString() + ' ' + id + ' ' + SoftIrqLabelProvider.getSoftIrq(id);
+ }
+ return type.toString() + ' ' + id;
}
/**
@Override
public int compareTo(ITimeGraphEntry other) {
if (!(other instanceof ResourcesEntry)) {
- /* Should not happen, but if it does, put those entries at the end */
+ /*
+ * Should not happen, but if it does, put those entries at the end
+ */
return -1;
}
ResourcesEntry o = (ResourcesEntry) other;
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 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
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.internal.analysis.os.linux.ui.views.resources;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * Softirq names. Not the C style ones, but descriptive ones
+ *
+ * @author Matthew Khouzam
+ */
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.tracecompass.internal.analysis.os.linux.ui.views.resources.messages"; //$NON-NLS-1$
+ /** softirq 0 */
+ public static String SoftIrqLabelProvider_softIrq0;
+ /** softirq 1 */
+ public static String SoftIrqLabelProvider_softIrq1;
+ /** softirq 2 */
+ public static String SoftIrqLabelProvider_softIrq2;
+ /** softirq 3 */
+ public static String SoftIrqLabelProvider_softIrq3;
+ /** softirq 4 */
+ public static String SoftIrqLabelProvider_softIrq4;
+ /** softirq 5 */
+ public static String SoftIrqLabelProvider_softIrq5;
+ /** softirq 6 */
+ public static String SoftIrqLabelProvider_softIrq6;
+ /** softirq 7 */
+ public static String SoftIrqLabelProvider_softIrq7;
+ /** softirq 8 */
+ public static String SoftIrqLabelProvider_softIrq8;
+ /** softirq 9 */
+ public static String SoftIrqLabelProvider_softIrq9;
+ /** other softirq */
+ public static String SoftIrqLabelProvider_Unknown;
+
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 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
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.internal.analysis.os.linux.ui.views.resources;
+
+import static org.eclipse.tracecompass.common.core.NonNullUtils.nullToEmptyString;
+
+import org.eclipse.jdt.annotation.NonNull;
+
+/**
+ * SoftIRQ definitions are hard-coded to the following
+ *
+ * From linux/interrupt.h
+ *
+ * <pre>
+ * enum
+ * {
+ * HI_SOFTIRQ=0,
+ * TIMER_SOFTIRQ,
+ * NET_TX_SOFTIRQ,
+ * NET_RX_SOFTIRQ,
+ * BLOCK_SOFTIRQ,
+ * BLOCK_IOPOLL_SOFTIRQ,
+ * TASKLET_SOFTIRQ,
+ * SCHED_SOFTIRQ,
+ * HRTIMER_SOFTIRQ,
+ * RCU_SOFTIRQ,
+ * NR_SOFTIRQS // not used as this is the NUMBER of softirqs
+ * };
+ * </pre>
+ *
+ * @author Matthew Khouzam
+ */
+public final class SoftIrqLabelProvider {
+
+ private SoftIrqLabelProvider() {
+ // do nothing
+ }
+
+ /**
+ * Gets a human readable name for a softirq
+ *
+ * @param irqNumber
+ * the number of the softirq
+ * @return a human readable string, cannot be null, may be empty
+ */
+ public static @NonNull String getSoftIrq(int irqNumber) {
+ switch (irqNumber) {
+ case 0:
+ return nullToEmptyString(Messages.SoftIrqLabelProvider_softIrq0);
+ case 1:
+ return nullToEmptyString(Messages.SoftIrqLabelProvider_softIrq1);
+ case 2:
+ return nullToEmptyString(Messages.SoftIrqLabelProvider_softIrq2);
+ case 3:
+ return nullToEmptyString(Messages.SoftIrqLabelProvider_softIrq3);
+ case 4:
+ return nullToEmptyString(Messages.SoftIrqLabelProvider_softIrq4);
+ case 5:
+ return nullToEmptyString(Messages.SoftIrqLabelProvider_softIrq5);
+ case 6:
+ return nullToEmptyString(Messages.SoftIrqLabelProvider_softIrq6);
+ case 7:
+ return nullToEmptyString(Messages.SoftIrqLabelProvider_softIrq7);
+ case 8:
+ return nullToEmptyString(Messages.SoftIrqLabelProvider_softIrq8);
+ case 9:
+ return nullToEmptyString(Messages.SoftIrqLabelProvider_softIrq9);
+ default:
+ return nullToEmptyString(Messages.SoftIrqLabelProvider_Unknown);
+ }
+ }
+}
--- /dev/null
+###############################################################################
+# Copyright (c) 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 accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Ericsson - Initial API and implementation
+###############################################################################
+
+SoftIrqLabelProvider_softIrq0=High priority tasklet
+SoftIrqLabelProvider_softIrq1=Timer
+SoftIrqLabelProvider_softIrq2=Network TX
+SoftIrqLabelProvider_softIrq3=Network RX
+SoftIrqLabelProvider_softIrq4=Block device
+SoftIrqLabelProvider_softIrq5=Block device IO Poll
+SoftIrqLabelProvider_softIrq6=Tasklet
+SoftIrqLabelProvider_softIrq7=Scheduler
+SoftIrqLabelProvider_softIrq8=High res timer
+SoftIrqLabelProvider_softIrq9=RCU data
+SoftIrqLabelProvider_Unknown=unknown