code: def start(self, action_name: str) -> None:
      import torch_xla.debug.profiler as xp
  
      # The action name is formatted as '[TYPE]{class name}.{hook name}'
      # Example: [LightningModule]BoringModel.training_step
      if action_name.split(".")[-1] in self.RECORD_FUNCTIONS:
          if not self._start_trace:
              self.server = xp.start_server(self.port)
              self._start_trace = True
  
          if action_name.split(".")[-1] in self.STEP_FUNCTIONS:
              step = self._get_step_num(action_name)
              recording = xp.StepTrace(action_name, step_num=step)
          else:
              recording = xp.Trace(action_name)
          recording.__enter__()
          self._recording_map[action_name] = recording
  
file_path: pytorch-lightning/src/lightning/pytorch/profilers/xla.py
imports: import logging
  from typing import Dict
  from typing_extensions import override
  from lightning.fabric.accelerators.xla import _XLA_AVAILABLE
  from lightning.pytorch.profilers.profiler import Profiler
label_desc: Use image node_id 2 for calling the XLAProfiler obj's underlying member method code with example usage: obj.start(action_name) without return types