Lines Matching +full:sub +full:- +full:path
2 # SPDX-License-Identifier: GPL-2.0
42 sub help {
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";
56 sub version {
62 sub strip {
76 sub search {
78 return $filename if -f $filename;
81 my $path = "$i/$filename";
82 return $path if -f $path;
87 sub parse_all {
96 my $path = search($header);
97 next unless $path;
99 open(my $file, '<', $path) or die($!);
113 sub print_cycle {
115 # $cycle[-1] will be the culprit
119 for my $i (0 .. $#$cycle - 1) {
120 $cycle->[$i]->[0] = $cycle->[$i + 1]->[0];
122 $cycle->[-1]->[0] = 0;
128 printf "%s from %s,\n", $msg, $last->[1] if defined $last;
133 $header->[1], $header->[0],
134 $header->[1] eq $last->[1] ? ' <-- here' : '';
138 $first->[1], $first->[0];
142 sub detect_cycles {
146 my $name = $top->[-1]->[1];
149 my $chain = [@$top, [$dep->[0], $dep->[1]]];
153 if(grep { $_->[1] eq $dep->[1] } @$top) {
164 sub mangle {
168 s/-/_/g;
173 sub graph {
187 printf "\t%s -> %s;\n",
188 mangle($header), mangle($dep->[1]);