len += 3 + strlen (argv[i]) * 4;
d = *argp++ = xmalloc (len);
- d = stpcpy (d, "exec");
+ d = stpcpy (d, "(exec");
for (i = optind; i < argc; i++)
{
*d++ = ' ';
}
*d++ = '\'';
}
+ *d++ = ')';
*d++ = 0;
}
*argp++ = opt_Z;
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-global opt_f
-global opt_q
+# ` = 0' is there to prevent: WARNING: never-assigned global variable
+global opt_f = 0
+global opt_q = 0
+
+/* systemtap bug? /usr/share/doc/systemtap-1.3/SystemTap_Beginners_Guide.pdf
+ Example 3.19 reads or writes? */
global trace
-# FIXME: count()?
-global trace_count
global last_tid
probe begin
{
trace[target ()] = 1
- trace_count = 1
last_tid = target ()
}
function heading:string ()
{
- if (trace_count > 1)
+ foreach (tidi in trace limit 2)
+ tid_count++
+
+ if (tid_count > 1)
{
/* strace really calls TID a "pid". */
return sprintf ("[pid %5d] ", tid ())
#probe kprocess.start
#{
# trace[pid ()] = 1
-# trace_count++
#}
#probe kprocess.exit
#{
# trace[pid ()] = 0
-# trace_count--
#}
probe kprocess.create
{
/* systemtap bug? Why `new_pid' is provided but `new_tid' is not? */
new_tid = task_tid (task)
trace[new_tid] = 1
- trace_count++
if (!opt_q)
printf ("Process %d attached\n", new_tid);
}
unlock ()
}
delete trace[tid]
- trace_count--
if (!opt_q)
printf ("Process %d detached\n", tid);
}