tools/mac/power/collapse_profile.py
def write_down_samples(self):
    """Writes down self.samples to a file. In contrast to the Dtrace format full
    stacks are writtent on a single line. At first the different are separated
    by semi-colons and a space separates the weight associated with the
    function.

    Example:

    base::foo;content::bar;biz::baz 17
    base::biz;content::boo;biz::bim 23
    ...

    """

    if not os.path.exists(os.path.dirname(self.output_filename)):
      os.makedirs(os.path.dirname(self.output_filename))

    with open(self.output_filename, 'w') as f:
      for row in self.samples:
        line = ';'.join(row["frames"])
        weight = row["weight"]
        # Reform the line in stacked format and write it out.
        f.write(f"{line} {weight}\n")
Writes down self.samples to a file. In contrast to the Dtrace format full
    stacks are writtent on a single line. At first the different are separated
    by semi-colons and a space separates the weight associated with the
    function.

    Example:

    base::foo;content::bar;biz::baz 17
    base::biz;content::boo;biz::bim 23
    ...

    
Writes down self.samples to a file. In contrast to the Dtrace format full
stacks are writtent on a single line. At first the different are separated
by semi-colons and a space separates the weight associated with the
function.
Writes down self . samples to a file . In contrast to the Dtrace format full stacks are writtent on a single line . At first the different are separated by semi - colons and a space separates the weight associated with the function .
def write_down_samples(self):
    if not os.path.exists(os.path.dirname(self.output_filename)):
      os.makedirs(os.path.dirname(self.output_filename))
    with open(self.output_filename, 'w') as f:
      for row in self.samples:
        line = ';'.join(row["frames"])
        weight = row["weight"]
        f.write(f"{line} {weight}\n")
def write_down_samples ( self ) : if not os . path . exists ( os . path . dirname ( self . output_filename ) ) : os . makedirs ( os . path . dirname ( self . output_filename ) ) with open ( self . output_filename , 'w' ) as f : for row in self . samples : line = ';' . join ( row [ "frames" ] ) weight = row [ "weight" ] f . write ( f"{line} {weight}\n" )
Writes down self.samples to a file.
Writes down self . samples to a file .
"""Writes down self.samples to a file. In contrast to the Dtrace format full
    stacks are writtent on a single line. At first the different are separated
    by semi-colons and a space separates the weight associated with the
    function.

    Example:

    base::foo;content::bar;biz::baz 17
    base::biz;content::boo;biz::bim 23
    ...

    """ # Reform the line in stacked format and write it out.
self
examples
None