| 84 | # forking.Popen = _Popen |
| 85 | |
| 86 | class DataSource(object): |
| 87 | bits = platform.architecture()[0] |
| 88 | cpu_count = multiprocessing.cpu_count() |
| 89 | is_windows = platform.system().lower() == 'windows' |
| 90 | raw_arch_string = platform.machine() |
| 91 | can_cpuid = True |
| 92 | |
| 93 | @staticmethod |
| 94 | def has_proc_cpuinfo(): |
| 95 | return os.path.exists('/proc/cpuinfo') |
| 96 | |
| 97 | @staticmethod |
| 98 | def has_dmesg(): |
| 99 | return len(program_paths('dmesg')) > 0 |
| 100 | |
| 101 | @staticmethod |
| 102 | def has_var_run_dmesg_boot(): |
| 103 | return os.path.exists('/var/run/dmesg.boot') |
| 104 | |
| 105 | @staticmethod |
| 106 | def has_cpufreq_info(): |
| 107 | return len(program_paths('cpufreq-info')) > 0 |
| 108 | |
| 109 | @staticmethod |
| 110 | def has_sestatus(): |
| 111 | return len(program_paths('sestatus')) > 0 |
| 112 | |
| 113 | @staticmethod |
| 114 | def has_sysctl(): |
| 115 | return len(program_paths('sysctl')) > 0 |
| 116 | |
| 117 | @staticmethod |
| 118 | def has_isainfo(): |
| 119 | return len(program_paths('isainfo')) > 0 |
| 120 | |
| 121 | @staticmethod |
| 122 | def has_kstat(): |
| 123 | return len(program_paths('kstat')) > 0 |
| 124 | |
| 125 | @staticmethod |
| 126 | def has_sysinfo(): |
| 127 | return len(program_paths('sysinfo')) > 0 |
| 128 | |
| 129 | @staticmethod |
| 130 | def has_lscpu(): |
| 131 | return len(program_paths('lscpu')) > 0 |
| 132 | |
| 133 | @staticmethod |
| 134 | def has_ibm_pa_features(): |
| 135 | return len(program_paths('lsprop')) > 0 |
| 136 | |
| 137 | @staticmethod |
| 138 | def cat_proc_cpuinfo(): |
| 139 | return run_and_get_stdout(['cat', '/proc/cpuinfo']) |
| 140 | |
| 141 | @staticmethod |
| 142 | def cpufreq_info(): |
| 143 | return run_and_get_stdout(['cpufreq-info']) |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…