diff --git a/xtop/core/data_source.py b/xtop/core/data_source.py index ddc3d6f..4646f84 100644 --- a/xtop/core/data_source.py +++ b/xtop/core/data_source.py @@ -254,12 +254,12 @@ def get_partitions_info(self) -> Dict[str, str]: Read partitions file to map device numbers to names. Returns dict: {major:minor -> device_name} """ - partitions_file = self.datadir / 'partitions' + partitions_file = Path('/proc/partitions') device_map = {} - + if not partitions_file.exists(): return device_map - + try: with open(partitions_file, 'r') as f: # Skip header line @@ -273,7 +273,7 @@ def get_partitions_info(self) -> Dict[str, str]: device_map[f"{major}:{minor}"] = name except Exception: pass - + return device_map def __enter__(self): diff --git a/xtop/core/materializer.py b/xtop/core/materializer.py index 383166c..6cfd470 100644 --- a/xtop/core/materializer.py +++ b/xtop/core/materializer.py @@ -140,7 +140,7 @@ def _materialize_source(self, source: str): SELECT REGEXP_EXTRACT_ALL(column0, ' +(\\w+)') field_list FROM - read_csv('{self.datadir}/partitions', skip=1, header=false) + read_csv('/proc/partitions', skip=1, header=false) WHERE field_list IS NOT NULL ) diff --git a/xtop/sql/fragments/base_partitions.sql b/xtop/sql/fragments/base_partitions.sql index dd413a7..0528c2e 100644 --- a/xtop/sql/fragments/base_partitions.sql +++ b/xtop/sql/fragments/base_partitions.sql @@ -8,7 +8,7 @@ FROM ( SELECT REGEXP_EXTRACT_ALL(column0, ' +(\w+)') field_list FROM - read_csv('#XTOP_DATADIR#/partitions', skip=1, header=false) + read_csv('/proc/partitions', skip=1, header=false) WHERE field_list IS NOT NULL ) \ No newline at end of file diff --git a/xtop/sql/fragments/get_partitions.sql b/xtop/sql/fragments/get_partitions.sql index 300ccb2..65497ce 100644 --- a/xtop/sql/fragments/get_partitions.sql +++ b/xtop/sql/fragments/get_partitions.sql @@ -9,7 +9,7 @@ LEFT OUTER JOIN ( SELECT REGEXP_EXTRACT_ALL(column0, ' +(\w+)') field_list FROM - read_csv('#XTOP_DATADIR#/partitions', skip=1, header=false) + read_csv('/proc/partitions', skip=1, header=false) WHERE field_list IS NOT NULL ) diff --git a/xtop/tui/cell_peek_modal_old.py b/xtop/tui/cell_peek_modal_old.py index 00eb405..a4d25f9 100644 --- a/xtop/tui/cell_peek_modal_old.py +++ b/xtop/tui/cell_peek_modal_old.py @@ -406,7 +406,7 @@ def _build_iolat_histogram_query(self) -> str: SELECT REGEXP_EXTRACT_ALL(column0, ' +(\\w+)') field_list FROM - read_csv('{self.datadir}/partitions', skip=1, header=false) + read_csv('/proc/partitions', skip=1, header=false) WHERE field_list IS NOT NULL )