Skip to content

Commit

Permalink
fixing bug in apex-summary.py, adding regular expressions for --drop …
Browse files Browse the repository at this point in the history
…and --keep flags in the apex-treesummary.py
  • Loading branch information
khuck committed Apr 13, 2023
1 parent a08de86 commit 34444d2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/scripts/apex-summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def convertToTAU(counters, timers, args):
def main():
args = parseArgs()
#print('Reading profiles...')
df = pd.read_csv('apex_profiles.csv') #, index_col=[0,1])
df = pd.read_csv(args.filename) #, index_col=[0,1])
df = df.fillna(0)
print()
if (args.counters):
Expand Down
15 changes: 15 additions & 0 deletions src/scripts/apex-treesummary.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from argparse import RawTextHelpFormatter
import math
import os
import re

# "process rank","node index","parent index","depth","name","calls","threads","total time(s)","inclusive time(s)","minimum time(s)","mean time(s)","maximum time(s)","stddev time(s)","total Recv Bytes","minimum Recv Bytes","mean Recv Bytes","maximum Recv Bytes","stddev Recv Bytes","median Recv Bytes","mode Recv Bytes","total Send Bytes","minimum Send Bytes","mean Send Bytes","maximum Send Bytes","stddev Send Bytes","median Send Bytes","mode Send Bytes"
endchar='\r'
Expand Down Expand Up @@ -141,6 +142,13 @@ def findKeepers(self, keeplist, rootlist):
if self.name in keeplist:
rootlist.append(self)
self.df['parent index'] = self.index
print('Keeping: \'', self.name, '\'', sep='')
for keeper in keeplist:
p = re.compile(keeper)
if p.match(self.name):
rootlist.append(self)
self.df['parent index'] = self.index
print('Keeping: \'', self.name, '\'', sep='')
for key in self.children:
self.children[key].findKeepers(keeplist, rootlist)

Expand Down Expand Up @@ -290,7 +298,14 @@ def graphRank(index, df, parentNode, droplist):
name = childDF['name'].iloc[0]
# should we skip this subtree?
if name in droplist:
print('Dropping: \'', name, '\'', sep='')
return
for dropped in droplist:
p = re.compile(dropped)
if p.match(name):
print('Dropping: \'', name, '\'', sep='')
return

#name = df.loc[df['node index'] == index, 'name'].iloc[0]
childNode = parentNode.addChild(name, childDF)

Expand Down

0 comments on commit 34444d2

Please sign in to comment.