| 1 |
#!/usr/bin/env stap |
| 2 |
# ansi_colors.stp |
| 3 |
# Copyright (C) 2006-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 |
for (t = 0; t < 2; t++) { |
| 21 |
printf(" %2d,%1d |", r, t); |
| 22 |
for (c = 40; c < 48; c++) { |
| 23 |
ansi_set_color(r, c, t) |
| 24 |
printf(" %s ", !t ? "Normal" : "Bold ") |
| 25 |
ansi_reset_color() |
| 26 |
} |
| 27 |
ansi_new_line() |
| 28 |
} |
| 29 |
exit(); |
| 30 |
} |