From a8b8de057e048e31dd69d8c95d39fa8a327902be Mon Sep 17 00:00:00 2001 From: Bernd Hufmann Date: Tue, 27 Oct 2015 07:40:22 -0400 Subject: [PATCH] lttng: update and add HR timer related events and fields Change-Id: I87b3e1ac4a79059a2c70b1b3ef7e07be6baa4f10 Signed-off-by: Bernd Hufmann Reviewed-on: https://git.eclipse.org/r/59011 Reviewed-by: Hudson CI Reviewed-by: Alexandre Montplaisir Tested-by: Alexandre Montplaisir Reviewed-by: Bernd Hufmann --- .../linux/core/trace/DefaultEventLayout.java | 49 ++++++++++++ .../trace/IKernelAnalysisEventLayout.java | 77 +++++++++++++++++++ .../core/trace/layout/Lttng27EventLayout.java | 26 ++++++- .../core/trace/layout/LttngEventLayout.java | 41 ++++++++++ .../core/trace/layout/PerfEventLayout.java | 35 +++++++++ 5 files changed, 227 insertions(+), 1 deletion(-) diff --git a/analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/trace/DefaultEventLayout.java b/analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/trace/DefaultEventLayout.java index 7b0f09a546..dc500a9c11 100644 --- a/analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/trace/DefaultEventLayout.java +++ b/analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/trace/DefaultEventLayout.java @@ -38,6 +38,8 @@ public class DefaultEventLayout implements IKernelAnalysisEventLayout{ private static final String SOFTIRQ_ENTRY = "softirq_entry"; //$NON-NLS-1$ private static final String SOFTIRQ_EXIT = "softirq_exit"; //$NON-NLS-1$ private static final String SOFTIRQ_RAISE = "softirq_raise"; //$NON-NLS-1$ + private static final String HRTIMER_START = "hrtimer_start"; //$NON-NLS-1$ + private static final String HRTIMER_CANCEL = "hrtimer_cancel"; //$NON-NLS-1$ private static final String HRTIMER_EXPIRE_ENTRY = "hrtimer_expire_entry"; //$NON-NLS-1$ private static final String HRTIMER_EXPIRE_EXIT = "hrtimer_expire_exit"; //$NON-NLS-1$ private static final String SCHED_SWITCH = "sched_switch"; //$NON-NLS-1$ @@ -78,6 +80,11 @@ public class DefaultEventLayout implements IKernelAnalysisEventLayout{ private static final String STATUS = "status"; //$NON-NLS-1$ private static final String PREV_COMM = "prev_comm"; //$NON-NLS-1$ private static final String FILENAME = "filename"; //$NON-NLS-1$ + private static final String HRTIMER = "hrtimer"; //$NON-NLS-1$ + private static final String FUNCTION = "function"; //$NON-NLS-1$ + private static final String EXPIRES = "expires"; //$NON-NLS-1$ + private static final String NOW = "now"; //$NON-NLS-1$ + private static final String SOFT_EXPIRES = "softexpires"; //$NON-NLS-1$ /** All instances are the same. Only provide a static instance getter */ private DefaultEventLayout() { @@ -293,6 +300,18 @@ public class DefaultEventLayout implements IKernelAnalysisEventLayout{ return SCHED_WAKEUP_NEW; } + /** @since 2.0 */ + @Override + public String eventHRTimerStart() { + return HRTIMER_START; + } + + /** @since 2.0 */ + @Override + public String eventHRTimerCancel() { + return HRTIMER_CANCEL; + } + /** @since 2.0 */ @Override public String eventHRTimerExpireEntry() { @@ -315,4 +334,34 @@ public class DefaultEventLayout implements IKernelAnalysisEventLayout{ return SCHED_TTWU; } + /** @since 2.0 */ + @Override + public String fieldHRtimer() { + return HRTIMER; + } + + /** @since 2.0 */ + @Override + public String fieldHRtimerFunction() { + return FUNCTION; + } + + /** @since 2.0 */ + @Override + public String fieldHRtimerExpires() { + return EXPIRES; + } + + /** @since 2.0 */ + @Override + public String fieldHRtimerSoftexpires() { + return SOFT_EXPIRES; + } + + /** @since 2.0 */ + @Override + public String fieldHRtimerNow() { + return NOW; + } + } diff --git a/analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/trace/IKernelAnalysisEventLayout.java b/analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/trace/IKernelAnalysisEventLayout.java index fbfeb1de25..0d7e59b854 100644 --- a/analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/trace/IKernelAnalysisEventLayout.java +++ b/analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/trace/IKernelAnalysisEventLayout.java @@ -216,6 +216,39 @@ public interface IKernelAnalysisEventLayout { */ String eventSchedProcessWakeupNew(); + + /** + * Starting the high resolution timer + *

+ * In Linux, High resolution timers are used in the following: + *

    + *
  • nanosleep
  • + *
  • itimers
  • + *
  • posix timers
  • + *
+ * + * @return the event name + * + * @since 2.0 + */ + String eventHRTimerStart(); + + /** + * Canceling the high resolution timer + *

+ * In Linux, High resolution timers are used in the following: + *

    + *
  • nanosleep
  • + *
  • itimers
  • + *
  • posix timers
  • + *
+ * + * @return the event name + * + * @since 2.0 + */ + String eventHRTimerCancel(); + /** * Entering the high resolution timer expired handler. *

@@ -440,4 +473,48 @@ public interface IKernelAnalysisEventLayout { * @since 1.0 */ String fieldNextPrio(); + + /** + * The field with the hrtimer. The hrtimer holds the timer instance. + * + * @return the name of the hrTimer field + * @since 2.0 + */ + String fieldHRtimer(); + + /** + * The field with the expires value. The expires field holds the expiry time. + * of the hrtimer. + * + * @return the name of the expires field + * @since 2.0 + */ + String fieldHRtimerExpires(); + + /** + * Gets the field name with the softexpires value. The softexpire value is the + * absolute earliest expiry time of the hrtimer. + * + * @return the name of the softexpires field + * @since 2.0 + */ + String fieldHRtimerSoftexpires(); + + /** + * The field of the function address value. The function field holds timer + * expiry callback function. + * + * @return the name of the function field + * @since 2.0 + */ + String fieldHRtimerFunction(); + + /** + * The field of the now value. The now field holds the current time. + * + * @return the name of the now field (hrtimer) + * @since 2.0 + */ + String fieldHRtimerNow(); + } diff --git a/lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/trace/layout/Lttng27EventLayout.java b/lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/trace/layout/Lttng27EventLayout.java index cb86444be5..109d12bb5f 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/trace/layout/Lttng27EventLayout.java +++ b/lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/trace/layout/Lttng27EventLayout.java @@ -29,7 +29,31 @@ public class Lttng27EventLayout extends Lttng26EventLayout { public static final Lttng27EventLayout INSTANCE = new Lttng27EventLayout(); // ------------------------------------------------------------------------ - // New definitions in LTTng 2.7 + // New event definition in LTTng 2.7 + // ------------------------------------------------------------------------ + + @Override + public String eventHRTimerStart() { + return "timer_hrtimer_start"; + } + + @Override + public String eventHRTimerCancel() { + return "timer_hrtimer_cancel"; + } + + @Override + public String eventHRTimerExpireEntry() { + return "timer_hrtimer_expire_entry"; + } + + @Override + public String eventHRTimerExpireExit() { + return "timer_hrtimer_expire_exit"; + } + + // ------------------------------------------------------------------------ + // New field definitions in LTTng 2.7 // ------------------------------------------------------------------------ public String fieldParentNSInum() { diff --git a/lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/trace/layout/LttngEventLayout.java b/lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/trace/layout/LttngEventLayout.java index ec4897f379..d0454610b1 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/trace/layout/LttngEventLayout.java +++ b/lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/trace/layout/LttngEventLayout.java @@ -40,6 +40,8 @@ public class LttngEventLayout implements IKernelAnalysisEventLayout { private static final String SOFTIRQ_ENTRY = "softirq_entry"; private static final String SOFTIRQ_EXIT = "softirq_exit"; private static final String SOFTIRQ_RAISE = "softirq_raise"; + private static final String HRTIMER_START = "hrtimer_start"; + private static final String HRTIMER_CANCEL = "hrtimer_cancel"; private static final String HRTIMER_EXPIRE_ENTRY = "hrtimer_expire_entry"; private static final String HRTIMER_EXPIRE_EXIT = "hrtimer_expire_exit"; private static final String SCHED_SWITCH = "sched_switch"; @@ -80,6 +82,11 @@ public class LttngEventLayout implements IKernelAnalysisEventLayout { private static final String STATUS = "status"; private static final String PREV_COMM = "prev_comm"; private static final String FILENAME = "filename"; + private static final String HRTIMER = "hrtimer"; + private static final String HRTIMER_FUNCTION = "function"; + private static final String HRTIMER_EXPIRES = "expires"; + private static final String HRTIMER_NOW = "now"; + private static final String HRTIMER_SOFT_EXPIRES = "softexpires"; /** All instances are the same. Only provide a static instance getter */ protected LttngEventLayout() { @@ -287,6 +294,16 @@ public class LttngEventLayout implements IKernelAnalysisEventLayout { return SCHED_WAKEUP_NEW; } + @Override + public String eventHRTimerStart() { + return HRTIMER_START; + } + + @Override + public String eventHRTimerCancel() { + return HRTIMER_CANCEL; + } + @Override public String eventHRTimerExpireEntry() { return HRTIMER_EXPIRE_ENTRY; @@ -306,4 +323,28 @@ public class LttngEventLayout implements IKernelAnalysisEventLayout { public String eventSchedProcessTTWU() { return SCHED_TTWU; } + + @Override + public String fieldHRtimer() { + return HRTIMER; + } + @Override + public String fieldHRtimerFunction() { + return HRTIMER_FUNCTION; + } + + @Override + public String fieldHRtimerExpires() { + return HRTIMER_EXPIRES; + } + + @Override + public String fieldHRtimerSoftexpires() { + return HRTIMER_SOFT_EXPIRES; + } + @Override + public String fieldHRtimerNow() { + return HRTIMER_NOW; + } + } diff --git a/lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/trace/layout/PerfEventLayout.java b/lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/trace/layout/PerfEventLayout.java index edfac24b37..ad164dc28d 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/trace/layout/PerfEventLayout.java +++ b/lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/trace/layout/PerfEventLayout.java @@ -139,6 +139,16 @@ public class PerfEventLayout implements IKernelAnalysisEventLayout { return "sched:process_wakeup_new"; //$NON-NLS-1$ } + @Override + public String eventHRTimerStart() { + return "timer:hrtimer_start"; //$NON-NLS-1$ + } + + @Override + public String eventHRTimerCancel() { + return "timer:hrtimer_cancel"; //$NON-NLS-1$ + } + @Override public String eventHRTimerExpireEntry() { return "timer:hrtimer_expire_entry"; //$NON-NLS-1$ @@ -243,4 +253,29 @@ public class PerfEventLayout implements IKernelAnalysisEventLayout { return "filename"; //$NON-NLS-1$ } + @Override + public String fieldHRtimer() { + return "hrtimer"; //$NON-NLS-1$ + } + + @Override + public String fieldHRtimerFunction() { + return "function"; //$NON-NLS-1$ + } + + @Override + public String fieldHRtimerExpires() { + return "expires"; //$NON-NLS-1$ + } + + @Override + public String fieldHRtimerSoftexpires() { + return "softexpires"; //$NON-NLS-1$ + } + + @Override + public String fieldHRtimerNow() { + return "now"; //$NON-NLS-1$ + } + } -- 2.34.1