code: def track_process(p: psutil.Process):
      pid = p.pid
  
      with p.oneshot():
          try:
              res = p.memory_info()
              tracker.add(
                  {
                      f"process.{p.pid}.{p.name()}.rss": res.rss,
                      f"process.{p.pid}.{p.name()}.vms": res.vms,
                  }
              )
          except psutil.AccessDenied:
              pass
          try:
              res = p.memory_percent()
              tracker.add(
                  {
                      f"process.{p.pid}.{p.name()}.mem": res,
                  }
              )
          except psutil.AccessDenied:
              pass
  
          try:
              res = p.cpu_percent()
              tracker.add(
                  {
                      f"process.{p.pid}.{p.name()}.cpu": res,
                  }
              )
          except psutil.AccessDenied:
              pass
  
          try:
              res = p.num_threads()
              tracker.add(
                  {
                      f"process.{p.pid}.{p.name()}.threads": res,
                  }
              )
          except psutil.AccessDenied:
              pass
  
file_path: labml/client/test/hardware_track.py
imports: import time
  import psutil
  from labml import lab, experiment, tracker
  from labml.logger import inspect
label_desc: Use image node_id 7 for calling a global function with example usage: track_process(p) without return types