From cc637c9ef930cd8af20f3163fc251a6507df59fb Mon Sep 17 00:00:00 2001 From: hunt Date: Tue, 14 Jun 2005 21:39:51 +0000 Subject: [PATCH] 2005-06-14 Martin Hunt * README: Removed old docs and replaced with simple build instructions. * Makefile: New file. * probes/build: New file. --- runtime/ChangeLog | 13 +++++++ runtime/Makefile | 15 ++++++++ runtime/probes/build | 81 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 109 insertions(+) create mode 100644 runtime/Makefile create mode 100755 runtime/probes/build diff --git a/runtime/ChangeLog b/runtime/ChangeLog index 2bbf949e7..e00e43f0d 100644 --- a/runtime/ChangeLog +++ b/runtime/ChangeLog @@ -1,3 +1,16 @@ +2005-06-14 Martin Hunt + + * README: Removed old docs and replaced with simple build + instructions. + + * Makefile: New file. + + * probes/build: New file. + +2005-06-13 Martin Hunt + + * print.c (next_fmt): Move this func to print.c. + 2005-06-02 Martin Hunt * string.c (_stp_string_cat_cstr): Be sure result is diff --git a/runtime/Makefile b/runtime/Makefile new file mode 100644 index 000000000..1b654f67d --- /dev/null +++ b/runtime/Makefile @@ -0,0 +1,15 @@ +# +# Makefile for SystemTap runtime and example probes +# + +all: + make -w -C relayfs + make -w -C transport + make -w -C stpd + cd probes; ./build + +clean: + make -w -C relayfs clean + make -w -C transport clean + make -w -C stpd clean + cd probes; ./build clean diff --git a/runtime/probes/build b/runtime/probes/build new file mode 100755 index 000000000..ac9994a9a --- /dev/null +++ b/runtime/probes/build @@ -0,0 +1,81 @@ +#!/usr/bin/tclsh +# -*- tcl -*- + +# simple script to do a make or "make clean" in each probe directory + +proc usage {} { + puts "Usage: build \[clean\]" + exit +} + +set clean 0 + +foreach arg $argv { + if {$arg == "clean"} { + set clean 1 + } else { + usage + } +} + +set dirs {shellsnoop test4 where_func scf} + +foreach i $dirs { + cd $i + if {$clean} { + puts "Cleaning $i" + if {[catch {exec make clean >& compile.errors} res]} { + [exec cat compile.errors] + exit + } + } else { + puts "Building $i" + if {[catch {exec make >& compile.errors} res]} { + puts "\n------------ Compile error in $i -------------------\n" + if {[catch {open compile.errors r} fd]} { + puts "Compile failed for unknown reasons" + exit + } + while {[gets $fd line] >= 0} { + puts $line + } + close $fd + exit + } else { + if {![catch {open compile.errors r} fd]} { + # search for warnings + set bad 0 + while {[gets $fd line] >= 0} { + if {[regexp {[^W]*([A-Za-z][A-Za-z0-9_]*)[^\"]*\"([^\"]*)} $line match warn var]} { + if {$warn == "Warning"} { + switch $var { + _stp_ctrl_unregister - + _stp_ctrl_register - + relay_subbufs_consumed - + _stp_ctrl_send - + relay_open - + relayfs_create_dir - + relayfs_remove_dir - + relay_close {} + default { + if {$bad == 0} { + puts "\n------------ Unexpected Warnings in $i -------------------\n" + } + puts $line + set bad 1 + } + } + } + } + } + close $fd + } + if {$bad} { + exit + } + } + } + catch {exec /bin/rm compile.errors} + cd .. +} + -- 2.43.5