Fix example code rendering, \n needs escaping to show up.
PR: 203536 Submitted by: Fabian Keil
This commit is contained in:
parent
acf4dc71d6
commit
af1e9f5a46
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=292265
@ -91,8 +91,8 @@ io:::start
|
||||
|
||||
END
|
||||
{
|
||||
printf("%10s %20s %10s %15s\n", "DEVICE", "APP", "PID", "BYTES");
|
||||
printa("%10s %20s %10d %15@d\n", @);
|
||||
printf("%10s %20s %10s %15s\\n", "DEVICE", "APP", "PID", "BYTES");
|
||||
printa("%10s %20s %10d %15@d\\n", @);
|
||||
}
|
||||
.Ed
|
||||
.Sh COMPATIBILITY
|
||||
|
@ -239,7 +239,7 @@ by the kernel:
|
||||
|
||||
dtrace:::BEGIN
|
||||
{
|
||||
printf(" %10s %30s %-30s %8s %6s\n", "DELTA(us)", "SOURCE",
|
||||
printf(" %10s %30s %-30s %8s %6s\\n", "DELTA(us)", "SOURCE",
|
||||
"DEST", "INT", "BYTES");
|
||||
last = timestamp;
|
||||
}
|
||||
@ -247,7 +247,7 @@ dtrace:::BEGIN
|
||||
ip:::send
|
||||
{
|
||||
this->elapsed = (timestamp - last) / 1000;
|
||||
printf(" %10d %30s -> %-30s %8s %6d\n", this->elapsed,
|
||||
printf(" %10d %30s -> %-30s %8s %6d\\n", this->elapsed,
|
||||
args[2]->ip_saddr, args[2]->ip_daddr, args[3]->if_name,
|
||||
args[2]->ip_plength);
|
||||
last = timestamp;
|
||||
@ -256,7 +256,7 @@ ip:::send
|
||||
ip:::receive
|
||||
{
|
||||
this->elapsed = (timestamp - last) / 1000;
|
||||
printf(" %10d %30s <- %-30s %8s %6d\n", this->elapsed,
|
||||
printf(" %10d %30s <- %-30s %8s %6d\\n", this->elapsed,
|
||||
args[2]->ip_daddr, args[2]->ip_saddr, args[3]->if_name,
|
||||
args[2]->ip_plength);
|
||||
last = timestamp;
|
||||
|
@ -300,7 +300,7 @@ The following script logs TCP segments in real time:
|
||||
|
||||
dtrace:::BEGIN
|
||||
{
|
||||
printf(" %3s %15s:%-5s %15s:%-5s %6s %s\n", "CPU",
|
||||
printf(" %3s %15s:%-5s %15s:%-5s %6s %s\\n", "CPU",
|
||||
"LADDR", "LPORT", "RADDR", "RPORT", "BYTES", "FLAGS");
|
||||
}
|
||||
|
||||
@ -317,7 +317,7 @@ tcp:::send
|
||||
printf("%s", args[4]->tcp_flags & TH_ACK ? "ACK|" : "");
|
||||
printf("%s", args[4]->tcp_flags & TH_URG ? "URG|" : "");
|
||||
printf("%s", args[4]->tcp_flags == 0 ? "null " : "");
|
||||
printf("\b)\n");
|
||||
printf("\b)\\n");
|
||||
}
|
||||
|
||||
tcp:::receive
|
||||
@ -333,7 +333,7 @@ tcp:::receive
|
||||
printf("%s", args[4]->tcp_flags & TH_ACK ? "ACK|" : "");
|
||||
printf("%s", args[4]->tcp_flags & TH_URG ? "URG|" : "");
|
||||
printf("%s", args[4]->tcp_flags == 0 ? "null " : "");
|
||||
printf("\b)\n");
|
||||
printf("\b)\\n");
|
||||
}
|
||||
.Ed
|
||||
The following script logs TCP connection state changes as they occur:
|
||||
@ -345,14 +345,14 @@ int last[int];
|
||||
|
||||
dtrace:::BEGIN
|
||||
{
|
||||
printf(" %12s %-20s %-20s %s\n",
|
||||
printf(" %12s %-20s %-20s %s\\n",
|
||||
"DELTA(us)", "OLD", "NEW", "TIMESTAMP");
|
||||
}
|
||||
|
||||
tcp:::state-change
|
||||
{
|
||||
this->elapsed = (timestamp - last[args[1]->cs_cid]) / 1000;
|
||||
printf(" %12d %-20s -> %-20s %d\n", this->elapsed,
|
||||
printf(" %12d %-20s -> %-20s %d\\n", this->elapsed,
|
||||
tcp_state_string[args[5]->tcps_state],
|
||||
tcp_state_string[args[3]->tcps_state], timestamp);
|
||||
last[args[1]->cs_cid] = timestamp;
|
||||
@ -361,7 +361,7 @@ tcp:::state-change
|
||||
tcp:::state-change
|
||||
/last[args[1]->cs_cid] == 0/
|
||||
{
|
||||
printf(" %12s %-20s -> %-20s %d\n", "-",
|
||||
printf(" %12s %-20s -> %-20s %d\\n", "-",
|
||||
tcp_state_string[args[5]->tcps_state],
|
||||
tcp_state_string[args[3]->tcps_state], timestamp);
|
||||
last[args[1]->cs_cid] = timestamp;
|
||||
|
@ -151,7 +151,7 @@ by the kernel:
|
||||
|
||||
dtrace:::BEGIN
|
||||
{
|
||||
printf(" %10s %36s %-36s %6s\n", "DELTA(us)", "SOURCE",
|
||||
printf(" %10s %36s %-36s %6s\\n", "DELTA(us)", "SOURCE",
|
||||
"DEST", "BYTES");
|
||||
last = timestamp;
|
||||
}
|
||||
@ -161,7 +161,7 @@ udp:::send
|
||||
this->elapsed = (timestamp - last) / 1000;
|
||||
self->dest = strjoin(strjoin(args[2]->ip_daddr, ":"),
|
||||
lltostr(args[4]->udp_dport));
|
||||
printf(" %10d %30s:%-5d -> %-36s %6d\n", this->elapsed,
|
||||
printf(" %10d %30s:%-5d -> %-36s %6d\\n", this->elapsed,
|
||||
args[2]->ip_saddr, args[4]->udp_sport,
|
||||
self->dest, args[4]->udp_length);
|
||||
last = timestamp;
|
||||
@ -172,7 +172,7 @@ udp:::receive
|
||||
this->elapsed = (timestamp - last) / 1000;
|
||||
self->dest = strjoin(strjoin(args[2]->ip_saddr, ":"),
|
||||
lltostr(args[4]->udp_sport));
|
||||
printf(" %10d %30s:%-5d <- %-36s %6d\n", this->elapsed,
|
||||
printf(" %10d %30s:%-5d <- %-36s %6d\\n", this->elapsed,
|
||||
args[2]->ip_daddr, args[4]->udp_dport,
|
||||
self->dest, args[4]->udp_length);
|
||||
last = timestamp;
|
||||
|
Loading…
Reference in New Issue
Block a user