Lines Matching +full:cycle +full:- +full:0
2 # SPDX-License-Identifier: GPL-2.0
43 print "Usage: $0 [options] file...\n";
46 print " --all\n";
47 print " --graph\n";
49 print " -I includedir\n";
52 print " $0 --graph include/linux/kernel.h | dot -Tpng -o graph.png\n";
78 return $filename if -f $filename;
82 return $path if -f $path;
103 for my $i (0 .. $#lines) {
114 # $cycle[n] includes $cycle[n + 1];
115 # $cycle[-1] will be the culprit
116 my $cycle = shift;
119 for my $i (0 .. $#$cycle - 1) {
120 $cycle->[$i]->[0] = $cycle->[$i + 1]->[0];
122 $cycle->[-1]->[0] = 0;
124 my $first = shift @$cycle;
125 my $last = pop @$cycle;
128 printf "%s from %s,\n", $msg, $last->[1] if defined $last;
130 for my $header (reverse @$cycle) {
133 $header->[1], $header->[0],
134 $header->[1] eq $last->[1] ? ' <-- here' : '';
138 $first->[1], $first->[0];
141 # Find and print the smallest cycle starting in the specified node.
143 my @queue = map { [[0, $_]] } @_;
146 my $name = $top->[-1]->[1];
149 my $chain = [@$top, [$dep->[0], $dep->[1]]];
152 # cycle...
153 if(grep { $_->[1] eq $dep->[1] } @$top) {
168 s/-/_/g;
187 printf "\t%s -> %s;\n",
188 mangle($header), mangle($dep->[1]);