Add scripts to create myops-getqueryview:
[myops.git] / web / collect / client / sysinfo / ModelOptions.py
1 #!/usr/bin/python
2
3 # Copyright (c) 2003 Intel Corporation
4 # All rights reserved.
5 #
6 # Copyright (c) 2004-2006 The Trustees of Princeton University
7 # All rights reserved.
8
9
10 import string
11
12 MINHW   = 0x001
13 SMP     = 0x002
14 X86_64  = 0x004
15 INTEL   = 0x008
16 AMD     = 0x010
17 NUMA    = 0x020
18 GEODE   = 0x040
19 BADHD   = 0x080
20 LAST    = 0x100
21 RAWDISK = 0x200
22
23 modeloptions = {'smp':SMP,
24                 'x64':X86_64,
25                 'i64':X86_64|INTEL,
26                 'a64':X86_64|AMD,
27                 'i32':INTEL,
28                 'a32':AMD,
29                 'numa':NUMA,
30                 'geode':GEODE,
31                 'badhd':BADHD,
32                 'minhw':MINHW,
33                 'rawdisk':RAWDISK}
34
35 def Get(model):
36     modelinfo = string.split(model,'/')
37     options= 0
38     for mi in modelinfo:
39         info = string.strip(mi)
40         info = info.lower()
41         options = options | modeloptions.get(info,0)
42
43     return options
44