Skip to content

Commit

Permalink
Fix tegra parse with back compability
Browse files Browse the repository at this point in the history
  • Loading branch information
rbonghi committed Jun 10, 2022
1 parent 1b96bbf commit 0c25929
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 2 deletions.
2 changes: 1 addition & 1 deletion jtop/core/tegra_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
VALS_RE = re.compile(r'\b([A-Z0-9_]+) ([0-9%@]+)(?=[^/])\b')
VAL_FRE_RE = re.compile(r'\b(\d+)%@(\d+)')
CPU_RE = re.compile(r'CPU \[(.*?)\]')
WATT_RE = re.compile(r'\b(\w+) ([0-9.]+)(\w)W\/([0-9.]+)(\w)W\b')
WATT_RE = re.compile(r'\b(\w+) ([0-9.]+)(\w?)W?\/([0-9.]+)(\w?)W?\b')
TEMP_RE = re.compile(r'\b(\w+)@(-?[0-9.]+)C\b')


Expand Down
2 changes: 1 addition & 1 deletion jtop/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def __init__(self, force=False, path_tegrastats=PATH_TEGRASTATS, path_jetson_clo
self.fan = FanService(self.config, path_fan)
except JtopException as error:
logger.warning("{error} in paths {path}".format(error=error, path=path_fan))
self.fan = FanServiceLegacy(self.config, PATH_FAN_LEGACY)
self.fan = FanServiceLegacy(self.config, path_fan + PATH_FAN_LEGACY)
# Initialize jetson_clocks controller
try:
self.jetson_clocks = JetsonClocksService(self.config, self.fan, path_jetson_clocks)
Expand Down
33 changes: 33 additions & 0 deletions tests/Dockerfile.tox
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# -*- coding: UTF-8 -*-
# This file is part of the jetson_stats package (https://github.com/rbonghi/jetson_stats or http://rnext.it).
# Copyright (c) 2022 Raffaello Bonghi.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

FROM python:3.8

RUN apt update && \
apt install -y sudo bc && \
rm -rf /var/lib/apt/lists/*

COPY . /tests

RUN sudo groupadd jetson_stats && \
sudo /tests/develop.sh -s && \
sudo -H python -m pip install --upgrade pip && \
sudo -H pip install tox

RUN mkdir /jetson_stats

WORKDIR /jetson_stats

0 comments on commit 0c25929

Please sign in to comment.