Commit | Line | Data |
---|---|---|
6d02c5c1 HD |
1 | /******************************************************************************* |
2 | * Copyright (c) 2016 École Polytechnique de Montréal | |
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 | ||
10 | package org.eclipse.tracecompass.analysis.os.linux.core.inputoutput; | |
11 | ||
12 | /** | |
13 | * Enum type for IO operations | |
14 | * | |
15 | * @author Geneviève Bastien | |
16 | * @since 2.0 | |
17 | */ | |
18 | public enum IoOperationType { | |
19 | ||
20 | /** | |
21 | * Write to the disk | |
22 | */ | |
23 | WRITE, | |
24 | /** | |
25 | * Read on the disk | |
26 | */ | |
27 | READ; | |
28 | ||
29 | /** | |
30 | * Get the BIO type from the rwbs value of a block operation. | |
31 | * | |
32 | * @param rwbs | |
33 | * The rwbs value of the block operation | |
34 | * @return The BIO type | |
35 | */ | |
36 | public static IoOperationType getType(int rwbs) { | |
37 | /* Even is a "read", odd is a "write" */ | |
38 | return (rwbs % 2 == 0) ? READ : WRITE; | |
39 | } | |
40 | } |