1 /*******************************************************************************
2 * Copyright (c) 2012, 2014 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
.Nullable
;
20 import org
.eclipse
.tracecompass
.analysis
.os
.linux
.core
.trace
.IKernelAnalysisEventLayout
;
22 import com
.google
.common
.collect
.ImmutableList
;
25 * Event and field definitions for perf traces in CTF format.
27 * @author Alexandre Montplaisir
29 public class PerfEventLayout
implements IKernelAnalysisEventLayout
{
31 private PerfEventLayout() {}
33 private static final PerfEventLayout INSTANCE
= new PerfEventLayout();
36 * Get the singleton instance of this event layout object.
38 * @return The instance
40 public static PerfEventLayout
getInstance() {
44 // ------------------------------------------------------------------------
46 // ------------------------------------------------------------------------
49 public String
eventIrqHandlerEntry() {
50 return "irq:irq_handler_exit"; //$NON-NLS-1$
54 public String
eventIrqHandlerExit() {
55 return "irq:irq_handler_entry"; //$NON-NLS-1$
59 public String
eventSoftIrqEntry() {
60 return "irq:softirq_entry"; //$NON-NLS-1$
64 public String
eventSoftIrqExit() {
65 return "irq:softirq_exit"; //$NON-NLS-1$
69 public String
eventSoftIrqRaise() {
70 return "irq:softirq_raise"; //$NON-NLS-1$
74 public String
eventSchedSwitch() {
75 return "sched:sched_switch"; //$NON-NLS-1$
78 private static final Collection
<String
> WAKEUP_EVENTS
=
79 checkNotNull(ImmutableList
.of("sched:sched_wakeup", "sched:sched_wakeup_new")); //$NON-NLS-1$ //$NON-NLS-2$
82 public Collection
<String
> eventsSchedWakeup() {
87 public String
eventSchedProcessFork() {
88 return "sched:sched_process_fork"; //$NON-NLS-1$
92 public String
eventSchedProcessExit() {
93 return "sched:sched_process_exit"; //$NON-NLS-1$
97 public String
eventSchedProcessFree() {
98 return "sched:sched_process_free"; //$NON-NLS-1$
102 public @Nullable String
eventStatedumpProcessState() {
103 /* Not present in perf traces */
108 public String
eventSyscallEntryPrefix() {
109 return "raw_syscalls:sys_enter"; //$NON-NLS-1$
113 public String
eventCompatSyscallEntryPrefix() {
114 return eventSyscallEntryPrefix();
118 public String
eventSyscallExitPrefix() {
119 return "raw_syscalls:sys_exit"; //$NON-NLS-1$
122 // ------------------------------------------------------------------------
124 // ------------------------------------------------------------------------
127 public String
fieldIrq() {
128 return "irq"; //$NON-NLS-1$
132 public String
fieldVec() {
133 return "vec"; //$NON-NLS-1$
137 public String
fieldTid() {
138 return "pid"; //$NON-NLS-1$
142 public String
fieldPrevTid() {
143 return "prev_pid"; //$NON-NLS-1$
147 public String
fieldPrevState() {
148 return "prev_state"; //$NON-NLS-1$
152 public String
fieldNextComm() {
153 return "next_comm"; //$NON-NLS-1$
157 public String
fieldNextTid() {
158 return "next_pid"; //$NON-NLS-1$
162 public String
fieldChildComm() {
163 return "child_comm"; //$NON-NLS-1$
167 public String
fieldParentTid() {
168 return "parent_pid"; //$NON-NLS-1$
172 public String
fieldChildTid() {
173 return "child_pid"; //$NON-NLS-1$