summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.examples/general
diff options
context:
space:
mode:
authorEugene Teo <eteo@redhat.com>2009-04-03 23:54:23 +0800
committerEugene Teo <eteo@redhat.com>2009-04-03 23:54:23 +0800
commita8e88602f1c7cbe302542d5af427d354d7d457ba (patch)
tree647eed4f0f782103b9d4d19442efbee81620c6c6 /testsuite/systemtap.examples/general
parent8e6c3aa3d61109b0276e96cdbc9ffdde60a5ac0a (diff)
downloadsystemtap-steved-a8e88602f1c7cbe302542d5af427d354d7d457ba.tar.gz
systemtap-steved-a8e88602f1c7cbe302542d5af427d354d7d457ba.tar.xz
systemtap-steved-a8e88602f1c7cbe302542d5af427d354d7d457ba.zip
Update scripts to use the new ANSI tapset
This updates the example scripts to use the new ANSI escape sequences tapset. It also adds the copyright header that was missing in ansi_colors.stp for a long time.
Diffstat (limited to 'testsuite/systemtap.examples/general')
-rwxr-xr-xtestsuite/systemtap.examples/general/ansi_colors.stp43
1 files changed, 26 insertions, 17 deletions
diff --git a/testsuite/systemtap.examples/general/ansi_colors.stp b/testsuite/systemtap.examples/general/ansi_colors.stp
index ae954e69..02c7c847 100755
--- a/testsuite/systemtap.examples/general/ansi_colors.stp
+++ b/testsuite/systemtap.examples/general/ansi_colors.stp
@@ -1,21 +1,30 @@
-#! /usr/bin/env stap
+#!/usr/bin/env stap
+# ansi_colors.stp
+# Copyright (C) 2006-2009 Red Hat, Inc., Eugene Teo <eteo@redhat.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
probe begin {
- printf("a \\ b |");
- for (c = 40; c < 48; c++)
- printf(" %d ", c);
- printf("\12");
- for (l = 0; l < 71; l++)
- printf("-");
- printf("\12");
+ printf("a \\ b |");
+ for (c = 40; c < 48; c++)
+ printf(" %d ", c);
+ ansi_new_line()
+ for (l = 0; l < 71; l++)
+ printf("-");
+ ansi_new_line()
- for (r = 30; r < 38; r++)
- for (t = 0; t < 2; t++) {
- printf("%d |", r);
- for (c = 40; c < 48; c++)
- printf("\033[%d;%d%s %s \033[0;0m",
- r, c, !t ? "m" : ";1m", !t ? "Normal" : "Bold ");
- printf("\12");
- }
- exit();
+ for (r = 30; r < 38; r++)
+ for (t = 0; t < 2; t++) {
+ printf("%d |", r);
+ for (c = 40; c < 48; c++) {
+ ansi_set_color3(r, c, t)
+ printf(" %s ", !t ? "Normal" : "Bold ")
+ ansi_reset_color()
+ }
+ ansi_new_line()
+ }
+ exit();
}