Debian Codegraph @

testsuite/systemtap.examples/general/ansi_colors2.stp

raw
1 #!/usr/bin/env stap
2 # ansi_colors2.stp
3 # Copyright (C) 2009 Red Hat, Inc., Eugene Teo <[email protected]>
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License version 2 as
7 # published by the Free Software Foundation.
8 #
9
10 probe begin {
11 printf("fg,t \\ bg |");
12 for (c = 40; c < 48; c++)
13 printf(" %d ", c);
14 ansi_new_line()
15 for (l = 0; l < 75; l++)
16 printf("-");
17 ansi_new_line()
18
19 for (r = 30; r < 38; r++)
20 # this displays more attributes
21 for (t = 0; t < 8; !t ? ++t : (t+=3)) {
22 printf(" %2d,%1d |", r, t);
23 for (c = 40; c < 48; c++) {
24 ansi_set_color(r, c, t)
25 printf(" Colors ")
26 ansi_reset_color()
27 }
28 ansi_new_line()
29 }
30 exit();
31 }