Add linux softirq ids
[deliverable/tracecompass.git] / analysis / org.eclipse.tracecompass.analysis.os.linux.core / src / org / eclipse / tracecompass / internal / analysis / os / linux / core / kernelanalysis / LinuxValues.java
CommitLineData
03bd936a
AM
1/*******************************************************************************
2 * Copyright (c) 2015 EfficiOS Inc., Alexandre Montplaisir
3 *
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
03bd936a
AM
8 *******************************************************************************/
9
10package org.eclipse.tracecompass.internal.analysis.os.linux.core.kernelanalysis;
11
03bd936a
AM
12/**
13 * Definitions of values used in the Linux kernel code.
14 *
15 * Instead of using "magic numbers" in state providers, the definitions should
16 * be added here first.
17 *
18 * @author Alexandre Montplaisir
19 */
20@SuppressWarnings("javadoc")
03bd936a
AM
21public interface LinuxValues {
22
94383285 23 /**
03bd936a
AM
24 * Process states found in scheduler events.
25 *
26 * From include/linux/sched.h
27 *
94383285 28 * <pre>
03bd936a
AM
29 * #define TASK_RUNNING 0
30 * #define TASK_INTERRUPTIBLE 1
31 * #define TASK_UNINTERRUPTIBLE 2
32 * #define __TASK_STOPPED 4
33 * #define __TASK_TRACED 8
34 * #define EXIT_DEAD 16
35 * #define EXIT_ZOMBIE 32
36 * #define EXIT_TRACE (EXIT_ZOMBIE | EXIT_DEAD)
37 * #define TASK_DEAD 64
38 * #define TASK_WAKEKILL 128
39 * #define TASK_WAKING 256
40 * #define TASK_PARKED 512
41 * #define TASK_STATE_MAX 1024
94383285 42 * </pre>
03bd936a 43 */
2bfc6622 44 /**
2f693965
AM
45 * The task is running normally, can be interrupted, in a syscall or user
46 * mode.
2bfc6622 47 */
03bd936a 48 int TASK_STATE_RUNNING = 0;
2f693965
AM
49
50 int TASK_INTERRUPTIBLE = 1;
51
52 int TASK_UNINTERRUPTIBLE = 2;
53
2bfc6622
MK
54 /**
55 * The task is dead, that means the PID can be re-used.
56 */
2f693965
AM
57 int TASK_DEAD = 64;
58
2bfc6622 59 /**
2f693965
AM
60 * This is the maximum value + 1 that the task state can be. TASK_STATE_MAX
61 * - 1 is useful to mask the task state.
2bfc6622 62 */
03bd936a
AM
63 int TASK_STATE_MAX = 1024;
64
94383285 65 /**
03bd936a
AM
66 * Process statuses, used in LTTng statedump events.
67 *
68 * This is LTTng-specific, but the statedump are handled at this level, so
69 * it makes sense to add those definitions here.
70 *
71 * Taken from lttng-module's lttng-statedump-impl.c:
72 *
94383285 73 * <pre>
03bd936a
AM
74 * enum lttng_process_status {
75 * LTTNG_UNNAMED = 0,
76 * LTTNG_WAIT_FORK = 1,
77 * LTTNG_WAIT_CPU = 2,
78 * LTTNG_EXIT = 3,
79 * LTTNG_ZOMBIE = 4,
80 * LTTNG_WAIT = 5,
81 * LTTNG_RUN = 6,
82 * LTTNG_DEAD = 7,
83 * };
94383285 84 * </pre>
03bd936a 85 */
94383285
FG
86
87 /** Task is initially preempted */
03bd936a 88 int STATEDUMP_PROCESS_STATUS_WAIT_CPU = 2;
94383285
FG
89
90 /** Task is initially blocked */
03bd936a 91 int STATEDUMP_PROCESS_STATUS_WAIT = 5;
02993d57
FG
92
93 /**
94 * SoftIRQ definitions
95 *
96 * From linux/interrupt.h
97 * <pre>
98 * enum
99 * {
100 * HI_SOFTIRQ=0,
101 * TIMER_SOFTIRQ,
102 * NET_TX_SOFTIRQ,
103 * NET_RX_SOFTIRQ,
104 * BLOCK_SOFTIRQ,
105 * BLOCK_IOPOLL_SOFTIRQ,
106 * TASKLET_SOFTIRQ,
107 * SCHED_SOFTIRQ,
108 * HRTIMER_SOFTIRQ,
109 * RCU_SOFTIRQ,
110 * NR_SOFTIRQS // not used as this is the NUMBER of softirqs
111 * };
112 * </pre>
113 */
114
115 /** High-priority tasklet */
116 int SOFTIRQ_HI = 0;
117
118 /** Interrupted because of timer */
119 int SOFTIRQ_TIMER = 1;
120
121 /** Interrupted because of network transmission */
122 int SOFTIRQ_NET_TX = 2;
123
124 /** Interrupted because of network reception */
125 int SOFTIRQ_NET_RX = 3;
126
127 /** Interrupted because of block operation */
128 int SOFTIRQ_BLOCK = 4;
129
130 /** Interrupted because of block IO */
131 int SOFTIRQ_BLOCK_IOPOLL = 5;
132
133 /** Tasklet (differed device interrupt) */
134 int SOFTIRQ_TASKLET = 6;
135
136 /** Interrupted because of the scheduler */
137 int SOFTIRQ_SCHED = 7;
138
139 /** Interrupted because of HR timer */
140 int SOFTIRQ_HRTIMER = 8;
141
142 /** Interrupted because of RCU */
143 int SOFTIRQ_RCU = 9;
144
03bd936a 145}
This page took 0.037329 seconds and 5 git commands to generate.