]> git.proxmox.com Git - mirror_frr.git/blob - tools/symalyzer.html
*: manual SPDX License ID conversions
[mirror_frr.git] / tools / symalyzer.html
1 <html>
2 <!--
3 - SPDX-License-Identifier: NONE
4 - 2019 by David Lamparter, placed in public domain
5 -->
6 <head>
7 <title>Symalyzer report</title>
8 <style type="text/css">
9 html {
10 margin:auto;
11 max-width:70em;
12 font-family:Fira Sans, sans-serif;
13 }
14 dl {
15 display:grid;
16 grid-template-columns: 1.4em 1.4em 1fr 1fr;
17 grid-auto-rows: auto;
18 }
19 dt.dir {
20 background-color:#ff8;
21 color:#000;
22 border:1px solid #000;
23 border-bottom:2px solid #000;
24 font-size:14pt;
25 padding:2pt 15pt;
26 margin:0pt;
27 margin-top:10pt;
28 grid-column:1 / -1;
29 }
30 dt.file {
31 background-color:#ffa;
32 color:#000;
33 border-bottom:1px solid #000;
34 font-size:12pt;
35 padding:2pt 15pt;
36 margin:5pt 0pt;
37 grid-column:1 / -1;
38 }
39 dt.file.filehidden {
40 background-color:#ffc;
41 font-size:10pt;
42 padding:0.5pt 15pt;
43 margin-bottom:-5pt;
44 }
45 dd {
46 display:inline-block;
47 vertical-align:middle;
48 margin:0;
49 }
50 dd.symtype {
51 grid-column:1;
52
53 border:1px solid #666;
54 text-align:center;
55 }
56 dd.symklass {
57 grid-column:2;
58
59 border:1px solid #666;
60 text-align:center;
61 }
62 dd.symname {
63 grid-column:3;
64
65 font-family:monospace;
66 padding:0 0.5em;
67 padding-top:2px;
68 border-bottom:1px dashed #ccc;
69 }
70 dd.symloc {
71 grid-column:4;
72
73 padding:0 0.5em;
74 border-bottom:1px dashed #ccc;
75 }
76 .symloc-unknown {
77 font-style:italic;
78 color:#aaa;
79 }
80
81 .symtype.sym-static {
82 background-color:#cf4;
83 color:#000;
84 }
85 .symtype.sym-extrastatic {
86 background-color:#fe8;
87 color:#000;
88 }
89 .symtype.sym-liblocal {
90 background-color:#fc6;
91 color:#000;
92 }
93
94 .symklass.symk-T {
95 background-color:#ddd;
96 color:#000;
97 }
98 .symklass.symk-B,
99 .symklass.symk-C,
100 .symklass.symk-D {
101 background-color:#faa;
102 color:#000;
103 }
104 .symklass.symk-R {
105 background-color:#fd8;
106 color:#000;
107 }
108
109 .symtype.sym-api {
110 background-color:#d9f;
111 color:#000;
112 }
113 .symname.sym-api,
114 .symloc.sym-api {
115 background-color:#f8e8ff;
116 }
117
118 dt.file.dirhidden,
119 dd.dirhidden {
120 display:none;
121 }
122 dd.filehidden {
123 display:none;
124 }
125 dd.symhidden {
126 display:none;
127 }
128
129 ul {
130 font-size:10pt;
131 }
132 li {
133 margin-bottom:6pt;
134 text-indent:-2.5em;
135 margin-left:2.5em;
136 }
137 code {
138 background-color:#eee;
139 color:#060;
140 text-decoration:underline;
141 }
142 b.symtype,
143 b.symklass {
144 display:inline-block;
145 text-align:center;
146 border:1px solid #666;
147 width:1.4em;
148 text-indent:0;
149 }
150 </style>
151 <script src="jquery-3.4.1.min.js"></script>
152 <script>
153
154 function dirtoggle(elem, visible) {
155 if (visible) {
156 elem.removeClass("dirhidden");
157 } else {
158 elem.addClass("dirhidden");
159 }
160
161 var next = elem.next();
162 while (next.is("dd") || next.is("dt.file")) {
163 if (visible) {
164 next.removeClass("dirhidden");
165 } else {
166 next.addClass("dirhidden");
167 }
168 next = next.next();
169 }
170 }
171
172 function filetoggle(elem, visible) {
173 if (visible) {
174 elem.removeClass("filehidden");
175 } else {
176 elem.addClass("filehidden");
177 }
178
179 var next = elem.next();
180 while (next.is("dd")) {
181 if (visible) {
182 next.removeClass("filehidden");
183 } else {
184 next.addClass("filehidden");
185 }
186 next = next.next();
187 }
188 }
189
190 function symtoggle(elem, visible) {
191 if (visible) {
192 elem.removeClass("symhidden");
193 } else {
194 elem.addClass("symhidden");
195 }
196
197 var next = elem.next();
198 while (next.is(".symklass") || next.is(".symname") || next.is(".symloc")) {
199 if (visible) {
200 next.removeClass("symhidden");
201 } else {
202 next.addClass("symhidden");
203 }
204 next = next.next();
205 }
206 }
207
208
209 $(document).ready(function(){
210 $("dt.dir").each(function(){
211 var elem = $(this);
212
213 elem.click(function(){
214 dirtoggle(elem, elem.is(".dirhidden"));
215 });
216
217 dirtoggle(elem, false);
218 });
219
220 $("dt.file").each(function(){
221 var elem = $(this);
222
223 elem.click(function(){
224 filetoggle(elem, elem.is(".filehidden"));
225 });
226
227 /* filetoggle(elem, false); */
228 });
229
230 $("#f_hide_all").click(function(){
231 $("dt.file").each(function(){
232 filetoggle($(this), false);
233 });
234 });
235 $("#f_show_all").click(function(){
236 $("dt.file").each(function(){
237 filetoggle($(this), true);
238 });
239 });
240
241 $("#s_show_all").click(function(){
242 $("dd.symtype").each(function(){
243 symtoggle($(this), true);
244 });
245 });
246 $("#s_hide_all").click(function(){
247 $("dd.symtype").each(function(){
248 symtoggle($(this), false);
249 });
250 });
251 $("#s_show_vars").click(function(){
252 $("dd.symtype").each(function(){
253 var elem_type = $(this);
254 if (elem_type.text() === "A") {
255 return;
256 }
257
258 var elem_klass = elem_type.next();
259
260 if ("BbCDdGgnRrSs".indexOf(elem_klass.text()) >= 0) {
261 symtoggle(elem_type, true);
262 }
263 });
264 });
265 $("#s_show_funcs").click(function(){
266 $("dd.symtype").each(function(){
267 var elem_type = $(this);
268 if (elem_type.text() === "A") {
269 return;
270 }
271
272 var elem_klass = elem_type.next();
273
274 if ("Tt".indexOf(elem_klass.text()) >= 0) {
275 symtoggle(elem_type, true);
276 }
277 });
278 });
279 $("#s_show_api").click(function(){
280 $("dd.sym-api").each(function(){
281 symtoggle($(this), true);
282 });
283 });
284
285 $("#jsbuttons").show();
286 });
287 </script>
288 </head>
289 <body>
290 <table style="display:none" id="jsbuttons">
291 <tr><td>Files</td><td>
292 <button type="button" id="f_hide_all">Hide all</button>
293 <button type="button" id="f_show_all">Show all</button>
294 </td></tr>
295 <tr><td>Symbols</td><td>
296 <button type="button" id="s_hide_all">Hide all</button>
297 <button type="button" id="s_show_all">Show all</button><br>
298 <button type="button" id="s_show_vars">Show variables</button>
299 <button type="button" id="s_show_funcs">Show functions</button>
300 <button type="button" id="s_show_api">Show module/API usage</button>
301 </td></tr>
302 </table>
303 <div style="display:grid;grid-template-columns:1fr 1fr;">
304 <ul>
305 <li><b class="symtype sym-static">S</b> means the symbol is not used outside its own file.
306 It could either be completely unused or used locally. It might be appropriate to make it
307 <code>static</code>.</li>
308 <li><b class="symtype sym-extrastatic">Z</b> means the symbol is not used outside its own file,
309 and it's not visible to the outside of the library or daemon (i.e. ELF hidden linkage.)
310 It could still be completely unused, or used within the library. It might be appropriate to make it
311 <code>static</code>.</li>
312 <li><b class="symtype sym-liblocal">L</b> means the symbol is used from other files in the library,
313 but not from outside. It might be appropriate to make it <code>DSO_LOCAL</code>.</li>
314 <li><b class="symtype sym-api">A</b> means the symbol is used from some other file, most likely a
315 loadable module. Note this is only flagged for symbols in executable files, not libraries.</li>
316 </ul>
317 <ul>
318 <li><b class="symklass symk-T">T</b> are normal functions ("program <u>T</u>ext")</li>
319 <li style="text-indent:0;margin-left:0">
320 <b class="symklass symk-B">B</b> (<u>B</u>SS),<br>
321 <b class="symklass symk-C">C</b> (<u>C</u>ommon),<br>
322 <b class="symklass symk-D">D</b> (<u>D</u>ata)<br>
323 are various types of writable global variables</li>
324 <li><b class="symklass symk-R">R</b> are read-only global variables ("<u>R</u>odata")</li>
325 </ul>
326 </div>
327 <dl>
328 {%- for subdir, subreport in dirgroups.items()|sort %}
329 <dt class="dir">{{ subdir }}</dt>
330 {%- for obj, reports in subreport.items()|sort %}
331 <dt class="file">{{ obj }}</dt>
332 {%- for report in reports|sort %}
333 {#- <dd class="{{ report.idlong }}"> #}
334 <dd class="sym-{{ report.idlong }} symtype" title="{{ report.title }}">{{ report.idshort }}</dd>
335 <dd class="sym-{{ report.idlong }} symk-{{ report.sym.klass }} symklass" title="{{ klasses.get(report.sym.klass, '???') }}">{{ report.sym.klass }}</dd>
336 <dd class="sym-{{ report.idlong }} symname">{{ report.sym.name }}</dd>
337 {% if report.sym.loc %}
338 <dd class="sym-{{ report.idlong }} symloc">{{ report.sym.loc }}</dd>
339 {% else %}
340 <dd class="sym-{{ report.idlong }} symloc symloc-unknown">unknown</dd>
341 {% endif %}
342 {#- </dd> #}
343 {%- endfor %}
344 {%- endfor %}
345 {%- endfor %}
346 </dl>
347 </body>
348 </html>