linux.core: add Order to fields of Kernel Analysis Event layout
authorMatthew Khouzam <matthew.khouzam@ericsson.com>
Wed, 14 Dec 2016 21:30:06 +0000 (16:30 -0500)
committerMatthew Khouzam <matthew.khouzam@ericsson.com>
Fri, 16 Dec 2016 03:18:48 +0000 (22:18 -0500)
This will allow getting the number of pages allocated.

Change-Id: I16a0aa00cb4b32f83c964cecc9543d2e0add4e85
Signed-off-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/87180
Reviewed-by: Genevieve Bastien <gbastien+lttng@versatic.net>
Tested-by: Genevieve Bastien <gbastien+lttng@versatic.net>
Reviewed-by: Hudson CI
analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/trace/DefaultEventLayout.java
analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/trace/IKernelAnalysisEventLayout.java
lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/trace/layout/LttngEventLayout.java
lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/trace/layout/PerfEventLayout.java

index 2d87a0a45fce2c9f2bf533eeeadab8d362ae31ac..fc5dceae76d495705bcaf85131d3cc7f92d56581 100644 (file)
@@ -107,6 +107,7 @@ public class DefaultEventLayout implements IKernelAnalysisEventLayout {
     private static final String SOFT_EXPIRES = "softexpires"; //$NON-NLS-1$
     private static final String KMEM_ALLOC = "kmem_mm_page_alloc"; //$NON-NLS-1$
     private static final String KMEM_FREE = "kmem_mm_page_free"; //$NON-NLS-1$
+    private static final String ORDER = "order"; //$NON-NLS-1$
 
     /**
      * Constructor, to be used by classes extending this one. To get an instance
@@ -419,4 +420,12 @@ public class DefaultEventLayout implements IKernelAnalysisEventLayout {
         return SCHED_WAKING;
     }
 
+    /**
+     * @since 2.2
+     */
+    @Override
+    public @NonNull String fieldOrder() {
+        return ORDER;
+    }
+
 }
index 8a583c0544304595a0dcd1c7119b93fa69ac8394..757487d32aa9605c5d4953bda0f69990eb52874a 100644 (file)
@@ -769,6 +769,27 @@ public interface IKernelAnalysisEventLayout {
         return "vector"; //$NON-NLS-1$
     }
 
+
+    /**
+     * Get the name of the 'order' field from memory page allocation events.
+     *
+     * The 'order' of a page allocation is it's logarithm to the base 2, and the
+     * size of the allocation is 2^order, an integral power-of-2 number of
+     * pages. 'Order' ranges from from 0 to MAX_ORDER-1.
+     *
+     * The smallest - and most frequent - page allocation is 2^0 or 1 page. The
+     * maximum allocation possible is 2^(MAX_ORDER-1) pages. MAX_ORDER is
+     * assigned a default value of 11 - resulting in a maximum allocation of
+     * 2^10 or 1024 pages. However it may be redefined at kernel configuration
+     * time with the option CONFIG_FORCE_MAX_ZONEORDER.
+     *
+     * @return the name of the order field
+     * @since 2.2
+     */
+    default @Nullable String fieldOrder() {
+        return null;
+    }
+
     // ------------------------------------------------------------------------
     // Network events and fields
     // ------------------------------------------------------------------------
index f46363ee84307ae11945bffc46716b35f933c8fe..63aefe9c057df340297fc71795808a1e95761fa6 100644 (file)
@@ -105,6 +105,7 @@ public class LttngEventLayout implements IKernelAnalysisEventLayout {
     private static final String NR_SECTOR="nr_sector";
     private static final String RQ_SECTOR= "rq_sector";
     private static final String NEXTRQ_SECTOR= "nextrq_sector";
+    private static final String ORDER = "order";
 
     /* Network events and field names */
     private static final Collection<String> EVENTS_NETWORK_SEND = Collections.singleton("net_dev_queue");
@@ -510,6 +511,11 @@ public class LttngEventLayout implements IKernelAnalysisEventLayout {
         return TCP_FLAGS_FIELD;
     }
 
+    @Override
+    public @NonNull String fieldOrder() {
+        return ORDER;
+    }
+
     // ------------------------------------------------------------------------
     // VirtualMachine events : kvm entry/exit events
     // ------------------------------------------------------------------------
index a3e51b0c356b9c86491675b21656359ba0890d6c..6c9b44ce45e2c26c5f743565bbec99f19fc7932c 100644 (file)
@@ -14,6 +14,7 @@ package org.eclipse.tracecompass.internal.lttng2.kernel.core.trace.layout;
 
 import java.util.Collection;
 
+import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.jdt.annotation.Nullable;
 import org.eclipse.tracecompass.analysis.os.linux.core.trace.IKernelAnalysisEventLayout;
 
@@ -26,7 +27,8 @@ import com.google.common.collect.ImmutableList;
  */
 public final class PerfEventLayout implements IKernelAnalysisEventLayout {
 
-    private PerfEventLayout() {}
+    private PerfEventLayout() {
+    }
 
     private static final PerfEventLayout INSTANCE = new PerfEventLayout();
 
@@ -78,8 +80,7 @@ public final class PerfEventLayout implements IKernelAnalysisEventLayout {
         return "sched:sched_pi_setprio"; //$NON-NLS-1$
     }
 
-    private static final Collection<String> WAKEUP_EVENTS =
-            ImmutableList.of("sched:sched_wakeup", "sched:sched_wakeup_new"); //$NON-NLS-1$ //$NON-NLS-2$
+    private static final Collection<String> WAKEUP_EVENTS = ImmutableList.of("sched:sched_wakeup", "sched:sched_wakeup_new"); //$NON-NLS-1$ //$NON-NLS-2$
 
     @Override
     public Collection<String> eventsSchedWakeup() {
@@ -139,7 +140,7 @@ public final class PerfEventLayout implements IKernelAnalysisEventLayout {
 
     @Override
     public String eventSchedProcessWakeupNew() {
-        return "sched:process_wakeup_new";  //$NON-NLS-1$
+        return "sched:process_wakeup_new"; //$NON-NLS-1$
     }
 
     @Override
@@ -149,7 +150,7 @@ public final class PerfEventLayout implements IKernelAnalysisEventLayout {
 
     @Override
     public String eventHRTimerStart() {
-        return "timer:hrtimer_start";  //$NON-NLS-1$
+        return "timer:hrtimer_start"; //$NON-NLS-1$
     }
 
     @Override
@@ -301,6 +302,11 @@ public final class PerfEventLayout implements IKernelAnalysisEventLayout {
         return "now"; //$NON-NLS-1$
     }
 
+    @Override
+    public @NonNull String fieldOrder() {
+        return "order"; //$NON-NLS-1$
+    }
+
     // ------------------------------------------------------------------------
     // I/O events and fields
     // ------------------------------------------------------------------------
This page took 0.028285 seconds and 5 git commands to generate.