Compute Library
 21.02
enable_tracing Namespace Reference

Functions

def find (path, pattern)
 
def get_class_and_args (function)
 
def do_insert_tracing (source, function, fd)
 

Variables

 logger = logging.getLogger("acl_tracing")
 
 parser
 
 action
 
 help
 
 args = parser.parse_args()
 
 logging_level = logging.INFO
 
 level
 
 fd = open(f,'r+')
 
 lines = fd.readlines()
 
bool contains_configure = False
 
 function_signature = None
 
bool insert_tracing = False
 
bool start = True
 
bool write = True
 
string source = "TracePoint::Layer::CORE"
 

Function Documentation

◆ do_insert_tracing()

def enable_tracing.do_insert_tracing (   source,
  function,
  fd 
)

Definition at line 69 of file enable_tracing.py.

References get_class_and_args(), and arm_compute::test.join().

69 def do_insert_tracing(source, function, fd):
70  logger.debug("Full signature = %s" % " ".join(function_signature))
71  class_name, arg_names = get_class_and_args(function)
72  if len(arg_names):
73  assert len(arg_names), "No argument to configure for %s ?" % class_name
74  spaces = re.match("([ ]*)void", function[0]).group(1)
75  fd.write("%s ARM_COMPUTE_CREATE_TRACEPOINT(%s, \"%s\", this, TracePoint::Args()" % (spaces, source, class_name))
76  for arg in arg_names:
77  fd.write("<<%s" % arg)
78  fd.write(");\n")
79  else:
80  print('Failed to get class name in %s ' % " ".join(function_signature))
81 
82 
std::string join(T first, T last, const std::string &separator)
Helper function to concatenate multiple strings.
Definition: Utils.h:93
def get_class_and_args(function)
def do_insert_tracing(source, function, fd)

◆ find()

def enable_tracing.find (   path,
  pattern 
)

Definition at line 39 of file enable_tracing.py.

Referenced by arm_compute.cl_winograd_convolution_layer_supported(), TensorInfo.is_dynamic(), and CPPDetectionOutputLayer.run().

39 def find(path, pattern):
40  matches = []
41  for root, dirnames, filenames, in os.walk(path):
42  for filename in fnmatch.filter(filenames, pattern):
43  matches.append(os.path.join(root,filename))
44  return matches
45 
46 # Returns the class name (Core or Runtime) and arguments of the given function
def find(path, pattern)

◆ get_class_and_args()

def enable_tracing.get_class_and_args (   function)

Definition at line 47 of file enable_tracing.py.

References arm_compute::test.join().

Referenced by do_insert_tracing().

47 def get_class_and_args(function):
48  decl = " ".join(function_signature)
49  m = re.match("void ([^:]+)::configure\(([^)]*)\)", decl)
50  if m:
51  assert m, "Can't parse '%s'" % line
52  class_name = m.group(1)
53  args = m.group(2)
54  #Remove comments:
55  args = re.sub("\/\*.*?\*\/","",args)
56  #Remove templates
57  args = re.sub("<.*?>","",args)
58  logger.debug(args)
59  arg_names = []
60  for arg in args.split(","):
61  m = re.match(".*?([^ &*]+)$", arg.strip())
62  arg_names.append(m.group(1))
63  logger.debug(" %s" % m.group(1))
64  return (class_name, arg_names)
65  else:
66  return ('','')
67 
68 # Adds the tracepoints to the source file for the given function
std::string join(T first, T last, const std::string &separator)
Helper function to concatenate multiple strings.
Definition: Utils.h:93
def get_class_and_args(function)

Variable Documentation

◆ action

action

Definition at line 89 of file enable_tracing.py.

◆ args

args = parser.parse_args()

Definition at line 90 of file enable_tracing.py.

◆ contains_configure

bool contains_configure = False

Definition at line 100 of file enable_tracing.py.

◆ fd

fd = open(f,'r+')

Definition at line 98 of file enable_tracing.py.

Referenced by MMappedFile.map().

◆ function_signature

list function_signature = None

Definition at line 109 of file enable_tracing.py.

◆ help

help

Definition at line 89 of file enable_tracing.py.

◆ insert_tracing

bool insert_tracing = False

Definition at line 110 of file enable_tracing.py.

◆ level

level

Definition at line 94 of file enable_tracing.py.

◆ lines

lines = fd.readlines()

Definition at line 99 of file enable_tracing.py.

◆ logger

logger = logging.getLogger("acl_tracing")

Definition at line 36 of file enable_tracing.py.

◆ logging_level

logging_level = logging.INFO

Definition at line 91 of file enable_tracing.py.

◆ parser

parser
Initial value:
1 = argparse.ArgumentParser(
2  formatter_class=argparse.RawDescriptionHelpFormatter,
3  description="Post process JSON benchmark files",
4  )

Definition at line 84 of file enable_tracing.py.

◆ source

string source = "TracePoint::Layer::CORE"

Definition at line 130 of file enable_tracing.py.

Referenced by Graph.add_connection().

◆ start

◆ write

bool write = True

Definition at line 113 of file enable_tracing.py.