2 # ############################################################################
3 # Time-stamp: <Fri Aug 25 1995 23:17:43 Stardate: [-31]6189.64 hwloidl>
4 # (C) Hans Wolfgang Loidl, November 1994
6 # Usage: tf [options] <gr-file>
8 # Show the `taskflow' in the .gr file (especially useful for keeping track of
9 # migrated tasks. It's also possible to focus on a given PE or on a given
13 # -p <int> ... Print all events on PE <int>
14 # -t <int> ... Print all events that occur on task <int>
15 # -e <str> ... Print all <str> events
16 # -n <hex> ... Print all events about fetching the node at address <hex>.
17 # -s <int> ... Print all events with a spark name <int>
18 # -L ... Print all events with spark queue length information
19 # -H ... Print header of the <gr-file>, too
20 # -h ... print help message (this text)
23 # ############################################################################
25 # ----------------------------------------------------------------------------
26 # Command line processing and initialization
27 # ----------------------------------------------------------------------------
31 &Getopts('hvHLp:t:e:n:s:S:');
36 do print_verbose_message();
39 # ----------------------------------------------------------------------------
43 if ( $opt_H && $in_header ) {
45 $in_header = 0 if /^\+\+\+\+\+/;
48 @c = split(/[\s\[\]:;,]+/);
49 if ( ( $check_proc ? $proc eq $c[1] : 1 ) &&
50 ( $check_event ? $event eq $c[3] : 1 ) &&
51 ( $check_task ? $task eq $c[4] : 1) &&
52 ( $check_node ? $node eq $c[5] : 1) &&
53 ( $check_spark ? (("END" eq $c[3]) && ($spark eq $c[6])) : 1) &&
54 ( $negated_spark ? (("END" eq $c[3]) && ($spark ne $c[6])) : 1) &&
55 ( $spark_queue_len ? ($c[5] =~ /sparks/) : 1 ) ) {
62 # ----------------------------------------------------------------------------
103 open (ME,$0) || die "!$: $0";
113 # ----------------------------------------------------------------------------
115 sub print_verbose_message {
117 if ( $opt_p ne "" ) {
118 print "Processor: $proc\n";
121 if ( $opt_t ne "" ) {
122 print "Task: $task\n";
125 if ( $opt_e ne "" ) {
126 print "Event: $event\n";
129 if ( $opt_n ne "" ) {
130 print "Node: $node\n";
133 if ( $opt_s ne "" ) {
134 print "Spark: $spark\n";
137 if ( $opt_S ne "" ) {
138 print "Negated Spark: $spark\n";
141 if ( $opt_L ne "" ) {
142 print "Printing spark queue len info.\n";
147 # ----------------------------------------------------------------------------