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_START
= "hrtimer_start";
44 private static final String HRTIMER_CANCEL
= "hrtimer_cancel";
45 private static final String HRTIMER_EXPIRE_ENTRY
= "hrtimer_expire_entry";
46 private static final String HRTIMER_EXPIRE_EXIT
= "hrtimer_expire_exit";
47 private static final String SCHED_SWITCH
= "sched_switch";
48 private static final String SCHED_PI_SETPRIO
= "sched_pi_setprio";
50 private static final String SCHED_TTWU
= "sched_ttwu";
51 private static final String SCHED_WAKEUP
= "sched_wakeup";
52 private static final String SCHED_WAKEUP_NEW
= "sched_wakeup_new";
53 private static final Collection
<String
> SCHED_WAKEUP_EVENTS
=
54 checkNotNull(ImmutableList
.of(SCHED_WAKEUP
, SCHED_WAKEUP_NEW
));
56 private static final String SCHED_PROCESS_FORK
= "sched_process_fork";
57 private static final String SCHED_PROCESS_EXIT
= "sched_process_exit";
58 private static final String SCHED_PROCESS_FREE
= "sched_process_free";
59 private static final String SCHED_PROCESS_EXEC
= "sched_process_exec";
60 private static final String STATEDUMP_PROCESS_STATE
= "lttng_statedump_process_state";
62 private static final String SYSCALL_ENTRY_PREFIX
= "sys_";
63 private static final String COMPAT_SYSCALL_ENTRY_PREFIX
= "compat_sys_";
64 private static final String SYSCALL_EXIT_PREFIX
= "exit_syscall";
67 private static final String IRQ
= "irq";
68 private static final String TID
= "tid";
69 private static final String VEC
= "vec";
70 private static final String PREV_TID
= "prev_tid";
71 private static final String PREV_STATE
= "prev_state";
72 private static final String NEXT_COMM
= "next_comm";
73 private static final String NEXT_TID
= "next_tid";
74 private static final String PARENT_TID
= "parent_tid";
75 private static final String CHILD_COMM
= "child_comm";
76 private static final String CHILD_TID
= "child_tid";
77 private static final String PRIO
= "prio";
78 private static final String NEXT_PRIO
= "next_prio";
79 private static final String NEW_PRIO
= "newprio";
80 private static final String COMM
= "comm";
81 private static final String NAME
= "name";
82 private static final String STATUS
= "status";
83 private static final String PREV_COMM
= "prev_comm";
84 private static final String FILENAME
= "filename";
85 private static final String HRTIMER
= "hrtimer";
86 private static final String HRTIMER_FUNCTION
= "function";
87 private static final String HRTIMER_EXPIRES
= "expires";
88 private static final String HRTIMER_NOW
= "now";
89 private static final String HRTIMER_SOFT_EXPIRES
= "softexpires";
91 /** All instances are the same. Only provide a static instance getter */
92 protected LttngEventLayout() {
95 private static final IKernelAnalysisEventLayout INSTANCE
= new LttngEventLayout();
98 * Get an instance of this event layout
100 * This object is completely immutable, so no need to create additional
101 * instances via the constructor.
103 * @return The instance
105 public static IKernelAnalysisEventLayout
getInstance() {
109 // ------------------------------------------------------------------------
111 // ------------------------------------------------------------------------
114 public String
eventIrqHandlerEntry() {
115 return IRQ_HANDLER_ENTRY
;
119 public String
eventIrqHandlerExit() {
120 return IRQ_HANDLER_EXIT
;
124 public String
eventSoftIrqEntry() {
125 return SOFTIRQ_ENTRY
;
129 public String
eventSoftIrqExit() {
134 public String
eventSoftIrqRaise() {
135 return SOFTIRQ_RAISE
;
139 public String
eventSchedSwitch() {
144 public String
eventSchedPiSetprio() {
145 return SCHED_PI_SETPRIO
;
149 public Collection
<String
> eventsSchedWakeup() {
150 return SCHED_WAKEUP_EVENTS
;
154 public String
eventSchedProcessFork() {
155 return SCHED_PROCESS_FORK
;
159 public String
eventSchedProcessExit() {
160 return SCHED_PROCESS_EXIT
;
164 public String
eventSchedProcessFree() {
165 return SCHED_PROCESS_FREE
;
169 public @NonNull String
eventStatedumpProcessState() {
170 return STATEDUMP_PROCESS_STATE
;
174 public String
eventSyscallEntryPrefix() {
175 return SYSCALL_ENTRY_PREFIX
;
179 public String
eventCompatSyscallEntryPrefix() {
180 return COMPAT_SYSCALL_ENTRY_PREFIX
;
184 public String
eventSyscallExitPrefix() {
185 return SYSCALL_EXIT_PREFIX
;
189 public String
eventCompatSyscallExitPrefix() {
191 * In LTTng < 2.6, the same generic event name is used for both standard
192 * and compat syscalls.
194 return SYSCALL_EXIT_PREFIX
;
197 // ------------------------------------------------------------------------
199 // ------------------------------------------------------------------------
202 public String
fieldIrq() {
207 public String
fieldVec() {
212 public String
fieldTid() {
217 public String
fieldPrevTid() {
222 public String
fieldPrevState() {
227 public String
fieldNextComm() {
232 public String
fieldNextTid() {
237 public String
fieldChildComm() {
242 public String
fieldParentTid() {
247 public String
fieldChildTid() {
252 public String
fieldPrio() {
257 public String
fieldNewPrio() {
262 public String
fieldNextPrio() {
267 public String
fieldComm() {
272 public String
fieldName() {
277 public String
fieldStatus() {
282 public String
fieldPrevComm() {
287 public String
fieldFilename() {
292 public String
eventSchedProcessExec() {
293 return SCHED_PROCESS_EXEC
;
297 public String
eventSchedProcessWakeup() {
302 public String
eventSchedProcessWakeupNew() {
303 return SCHED_WAKEUP_NEW
;
307 public String
eventHRTimerStart() {
308 return HRTIMER_START
;
312 public String
eventHRTimerCancel() {
313 return HRTIMER_CANCEL
;
317 public String
eventHRTimerExpireEntry() {
318 return HRTIMER_EXPIRE_ENTRY
;
322 public String
eventHRTimerExpireExit() {
323 return HRTIMER_EXPIRE_EXIT
;
327 * Event indicating the source of the wakeup signal.
329 * @return The name of the event
332 public String
eventSchedProcessTTWU() {
337 public String
fieldHRtimer() {
341 public String
fieldHRtimerFunction() {
342 return HRTIMER_FUNCTION
;
346 public String
fieldHRtimerExpires() {
347 return HRTIMER_EXPIRES
;
351 public String
fieldHRtimerSoftexpires() {
352 return HRTIMER_SOFT_EXPIRES
;
355 public String
fieldHRtimerNow() {