Skip to content

Commit

Permalink
Improve EMC controller for AGX Xavier
Browse files Browse the repository at this point in the history
  • Loading branch information
rbonghi committed Feb 4, 2023
1 parent af58003 commit 1ebed17
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
2 changes: 2 additions & 0 deletions jtop/core/memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,8 @@ def get_status(self):
# Read EMC status
if os.path.isdir("/sys/kernel/debug/clk/emc"):
memory['EMC'] = read_engine("/sys/kernel/debug/clk/emc")
# Set always online this engine
memory['EMC']['online'] = True
# Percentage utilization
# https://forums.developer.nvidia.com/t/real-time-emc-bandwidth-with-sysfs/107479/3
utilization = int(cat("/sys/kernel/actmon_avg_activity/mc_all"))
Expand Down
20 changes: 13 additions & 7 deletions jtop/gui/pmem.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,9 @@ def action_swap(self, data):
if self._swap_pressed != -1:
# Read name swap
name = list(swap_table.keys())[self._swap_pressed]
swap = swap_table[name]
# Deactivate SWAP
if self.jetson.memory.swap_is_enable(name):
if self.jetson.memory.swap_is_enable(name) and swap['type'] == 'file':
self.jetson.memory.swap_deactivate(name)

def action_increase(self, data):
Expand Down Expand Up @@ -262,22 +263,27 @@ def draw_swap_table(self, pos_y, pos_x, width, height, key, mouse):
def draw_swap_controller(self, pos_y, pos_x, key, mouse):
swap_info = self.jetson.memory['SWAP']
swap_table = swap_info['table']
name = ''
string_name = ''
color = curses.A_REVERSE
# Read swap name
if self._swap_pressed != -1:
operation = ''
# Read name swap
name = list(swap_table.keys())[self._swap_pressed]
# Get info swap
swap = swap_table[name]
if swap['type'] == 'partition':
color = NColors.magenta()
color = NColors.imagenta()
elif swap['type'] == 'file':
color = NColors.yellow()
color = NColors.iyellow()
operation = 'Disable '
else:
color = NColors.cyan()
color = NColors.icyan()
# Swap name and operation
string_name = "{operation}{name}".format(operation=operation, name=name)
# Swap controller button
label = 'Disable {name}'.format(name=name) if name else 'Select swap'
self._button_swap.draw(pos_y, pos_x, key, mouse, label=label, color=NColors.iyellow())
label = string_name if string_name else 'Select swap'
self._button_swap.draw(pos_y, pos_x, key, mouse, label=label, color=color)
# Button create new swap
self._button_create.draw(pos_y + 2, pos_x, key, mouse, label="Create new")
# Draw selected number
Expand Down

0 comments on commit 1ebed17

Please sign in to comment.