Commit | Line | Data |
---|---|---|
af3275f8 AM |
1 | /******************************************************************************* |
2 | * Copyright (c) 2012, 2015 Ericsson | |
3 | * | |
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 | |
8 | * | |
9 | * Contributors: | |
10 | * Alexandre Montplaisir - Initial API and implementation | |
11 | ******************************************************************************/ | |
12 | ||
13 | package org.lttng.scope.lttng.kernel.core.analysis.os; | |
14 | ||
15 | import ca.polymtl.dorsal.libdelorean.statevalue.ITmfStateValue; | |
16 | import ca.polymtl.dorsal.libdelorean.statevalue.TmfStateValue; | |
17 | ||
18 | /** | |
19 | * State values that are used in the kernel event handler. It's much better to | |
20 | * use integer values whenever possible, since those take much less space in the | |
21 | * history file. | |
22 | * | |
23 | * @author Alexandre Montplaisir | |
24 | * @noimplement This interface is not intended to be implemented by clients. | |
25 | */ | |
26 | @SuppressWarnings("javadoc") | |
27 | public interface StateValues { | |
28 | ||
29 | /* Process status */ | |
30 | int PROCESS_STATUS_UNKNOWN = 0; | |
31 | int PROCESS_STATUS_WAIT_BLOCKED = 1; | |
32 | int PROCESS_STATUS_RUN_USERMODE = 2; | |
33 | int PROCESS_STATUS_RUN_SYSCALL = 3; | |
34 | int PROCESS_STATUS_INTERRUPTED = 4; | |
35 | int PROCESS_STATUS_WAIT_FOR_CPU = 5; | |
36 | int PROCESS_STATUS_WAIT_UNKNOWN = 6; | |
37 | ||
38 | ITmfStateValue PROCESS_STATUS_UNKNOWN_VALUE = TmfStateValue.newValueInt(PROCESS_STATUS_UNKNOWN); | |
39 | ITmfStateValue PROCESS_STATUS_WAIT_UNKNOWN_VALUE = TmfStateValue.newValueInt(PROCESS_STATUS_WAIT_UNKNOWN); | |
40 | ITmfStateValue PROCESS_STATUS_WAIT_BLOCKED_VALUE = TmfStateValue.newValueInt(PROCESS_STATUS_WAIT_BLOCKED); | |
41 | ITmfStateValue PROCESS_STATUS_RUN_USERMODE_VALUE = TmfStateValue.newValueInt(PROCESS_STATUS_RUN_USERMODE); | |
42 | ITmfStateValue PROCESS_STATUS_RUN_SYSCALL_VALUE = TmfStateValue.newValueInt(PROCESS_STATUS_RUN_SYSCALL); | |
43 | ITmfStateValue PROCESS_STATUS_INTERRUPTED_VALUE = TmfStateValue.newValueInt(PROCESS_STATUS_INTERRUPTED); | |
44 | ITmfStateValue PROCESS_STATUS_WAIT_FOR_CPU_VALUE = TmfStateValue.newValueInt(PROCESS_STATUS_WAIT_FOR_CPU); | |
45 | ||
46 | /* CPU Status */ | |
47 | int CPU_STATUS_IDLE = 0; | |
48 | /** | |
49 | * Soft IRQ raised, could happen in the CPU attribute but should not since | |
50 | * this means that the CPU went idle when a softirq was raised. | |
51 | */ | |
52 | int CPU_STATUS_SOFT_IRQ_RAISED = (1 << 0); | |
53 | int CPU_STATUS_RUN_USERMODE = (1 << 1); | |
54 | int CPU_STATUS_RUN_SYSCALL = (1 << 2); | |
55 | int CPU_STATUS_SOFTIRQ = (1 << 3); | |
56 | int CPU_STATUS_IRQ = (1 << 4); | |
57 | ||
58 | ITmfStateValue CPU_STATUS_IDLE_VALUE = TmfStateValue.newValueInt(CPU_STATUS_IDLE); | |
59 | ITmfStateValue CPU_STATUS_RUN_USERMODE_VALUE = TmfStateValue.newValueInt(CPU_STATUS_RUN_USERMODE); | |
60 | ITmfStateValue CPU_STATUS_RUN_SYSCALL_VALUE = TmfStateValue.newValueInt(CPU_STATUS_RUN_SYSCALL); | |
61 | ITmfStateValue CPU_STATUS_IRQ_VALUE = TmfStateValue.newValueInt(CPU_STATUS_IRQ); | |
62 | ITmfStateValue CPU_STATUS_SOFTIRQ_VALUE = TmfStateValue.newValueInt(CPU_STATUS_SOFTIRQ); | |
63 | ||
64 | /** Soft IRQ is raised, CPU is in user mode */ | |
65 | ITmfStateValue SOFT_IRQ_RAISED_VALUE = TmfStateValue.newValueInt(CPU_STATUS_SOFT_IRQ_RAISED); | |
66 | ||
67 | /** If the softirq is running and another is raised at the same time. */ | |
68 | ITmfStateValue SOFT_IRQ_RAISED_RUNNING_VALUE = TmfStateValue.newValueInt(CPU_STATUS_SOFT_IRQ_RAISED | CPU_STATUS_SOFTIRQ); | |
69 | } |