1 /*******************************************************************************
2 * Copyright (c) 2012, 2015 Ericsson
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
10 * Alexandre Montplaisir - Initial API and implementation
11 ******************************************************************************/
13 package org
.eclipse
.tracecompass
.internal
.lttng2
.kernel
.core
.trace
.layout
;
15 import static org
.eclipse
.tracecompass
.common
.core
.NonNullUtils
.checkNotNull
;
17 import java
.util
.Collection
;
19 import org
.eclipse
.jdt
.annotation
.NonNull
;
20 import org
.eclipse
.tracecompass
.analysis
.os
.linux
.core
.trace
.IKernelAnalysisEventLayout
;
22 import com
.google
.common
.collect
.ImmutableList
;
25 * This file defines all the known event and field names for LTTng kernel
26 * traces, for versions of lttng-modules up to 2.5.
28 * These should not be externalized, since they need to match exactly what the
29 * tracer outputs. If you want to localize them in a view, you should do a
30 * mapping in the view itself.
32 * @author Alexandre Montplaisir
34 @SuppressWarnings("nls")
35 public class LttngEventLayout
implements IKernelAnalysisEventLayout
{
38 private static final String IRQ_HANDLER_ENTRY
= "irq_handler_entry";
39 private static final String IRQ_HANDLER_EXIT
= "irq_handler_exit";
40 private static final String SOFTIRQ_ENTRY
= "softirq_entry";
41 private static final String SOFTIRQ_EXIT
= "softirq_exit";
42 private static final String SOFTIRQ_RAISE
= "softirq_raise";
43 private static final String HRTIMER_EXPIRE_ENTRY
= "hrtimer_expire_entry";
44 private static final String HRTIMER_EXPIRE_EXIT
= "hrtimer_expire_exit";
45 private static final String SCHED_SWITCH
= "sched_switch";
46 private static final String SCHED_PI_SETPRIO
= "sched_pi_setprio";
48 private static final String SCHED_TTWU
= "sched_ttwu";
49 private static final String SCHED_WAKEUP
= "sched_wakeup";
50 private static final String SCHED_WAKEUP_NEW
= "sched_wakeup_new";
51 private static final Collection
<String
> SCHED_WAKEUP_EVENTS
=
52 checkNotNull(ImmutableList
.of(SCHED_WAKEUP
, SCHED_WAKEUP_NEW
));
54 private static final String SCHED_PROCESS_FORK
= "sched_process_fork";
55 private static final String SCHED_PROCESS_EXIT
= "sched_process_exit";
56 private static final String SCHED_PROCESS_FREE
= "sched_process_free";
57 private static final String SCHED_PROCESS_EXEC
= "sched_process_exec";
58 private static final String STATEDUMP_PROCESS_STATE
= "lttng_statedump_process_state";
60 private static final String SYSCALL_ENTRY_PREFIX
= "sys_";
61 private static final String COMPAT_SYSCALL_ENTRY_PREFIX
= "compat_sys_";
62 private static final String SYSCALL_EXIT_PREFIX
= "exit_syscall";
65 private static final String IRQ
= "irq";
66 private static final String TID
= "tid";
67 private static final String VEC
= "vec";
68 private static final String PREV_TID
= "prev_tid";
69 private static final String PREV_STATE
= "prev_state";
70 private static final String NEXT_COMM
= "next_comm";
71 private static final String NEXT_TID
= "next_tid";
72 private static final String PARENT_TID
= "parent_tid";
73 private static final String CHILD_COMM
= "child_comm";
74 private static final String CHILD_TID
= "child_tid";
75 private static final String PRIO
= "prio";
76 private static final String NEXT_PRIO
= "next_prio";
77 private static final String NEW_PRIO
= "newprio";
78 private static final String COMM
= "comm";
79 private static final String NAME
= "name";
80 private static final String STATUS
= "status";
81 private static final String PREV_COMM
= "prev_comm";
82 private static final String FILENAME
= "filename";
84 /** All instances are the same. Only provide a static instance getter */
85 protected LttngEventLayout() {
88 private static final IKernelAnalysisEventLayout INSTANCE
= new LttngEventLayout();
91 * Get an instance of this event layout
93 * This object is completely immutable, so no need to create additional
94 * instances via the constructor.
96 * @return The instance
98 public static IKernelAnalysisEventLayout
getInstance() {
102 // ------------------------------------------------------------------------
104 // ------------------------------------------------------------------------
107 public String
eventIrqHandlerEntry() {
108 return IRQ_HANDLER_ENTRY
;
112 public String
eventIrqHandlerExit() {
113 return IRQ_HANDLER_EXIT
;
117 public String
eventSoftIrqEntry() {
118 return SOFTIRQ_ENTRY
;
122 public String
eventSoftIrqExit() {
127 public String
eventSoftIrqRaise() {
128 return SOFTIRQ_RAISE
;
132 public String
eventSchedSwitch() {
137 public String
eventSchedPiSetprio() {
138 return SCHED_PI_SETPRIO
;
142 public Collection
<String
> eventsSchedWakeup() {
143 return SCHED_WAKEUP_EVENTS
;
147 public String
eventSchedProcessFork() {
148 return SCHED_PROCESS_FORK
;
152 public String
eventSchedProcessExit() {
153 return SCHED_PROCESS_EXIT
;
157 public String
eventSchedProcessFree() {
158 return SCHED_PROCESS_FREE
;
162 public @NonNull String
eventStatedumpProcessState() {
163 return STATEDUMP_PROCESS_STATE
;
167 public String
eventSyscallEntryPrefix() {
168 return SYSCALL_ENTRY_PREFIX
;
172 public String
eventCompatSyscallEntryPrefix() {
173 return COMPAT_SYSCALL_ENTRY_PREFIX
;
177 public String
eventSyscallExitPrefix() {
178 return SYSCALL_EXIT_PREFIX
;
181 // ------------------------------------------------------------------------
183 // ------------------------------------------------------------------------
186 public String
fieldIrq() {
191 public String
fieldVec() {
196 public String
fieldTid() {
201 public String
fieldPrevTid() {
206 public String
fieldPrevState() {
211 public String
fieldNextComm() {
216 public String
fieldNextTid() {
221 public String
fieldChildComm() {
226 public String
fieldParentTid() {
231 public String
fieldChildTid() {
236 public String
fieldPrio() {
241 public String
fieldNewPrio() {
246 public String
fieldNextPrio() {
251 public String
fieldComm() {
256 public String
fieldName() {
261 public String
fieldStatus() {
266 public String
fieldPrevComm() {
271 public String
fieldFilename() {
276 public String
eventSchedProcessExec() {
277 return SCHED_PROCESS_EXEC
;
281 public String
eventSchedProcessWakeup() {
286 public String
eventSchedProcessWakeupNew() {
287 return SCHED_WAKEUP_NEW
;
291 public String
eventHRTimerExpireEntry() {
292 return HRTIMER_EXPIRE_ENTRY
;
296 public String
eventHRTimerExpireExit() {
297 return HRTIMER_EXPIRE_EXIT
;
301 * Event indicating the source of the wakeup signal.
303 * @return The name of the event
306 public String
eventSchedProcessTTWU() {